├── Demo └── AppLordDemo │ ├── AppLordDemo │ ├── Assets.xcassets │ │ ├── first.imageset │ │ │ ├── first.pdf │ │ │ └── Contents.json │ │ ├── second.imageset │ │ │ ├── second.pdf │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Task1.h │ ├── Task2.h │ ├── Task3.h │ ├── Task4.h │ ├── Task5.h │ ├── FirstViewController.h │ ├── SecondViewController.h │ ├── TabBarServiceImpl.h │ ├── Task3.m │ ├── Task5.m │ ├── AppDelegate.h │ ├── main.m │ ├── Task1.m │ ├── Task2.m │ ├── Task4.m │ ├── TabBarService.h │ ├── TabBarLauncherModule.h │ ├── FirstViewController.m │ ├── TabBarServiceImpl.m │ ├── SecondViewController.m │ ├── TabBarLauncherModule.m │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── AppDelegate.m │ └── AppLordDemo.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── AppLord.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── AppLord ├── ALService.h ├── ALModule.h ├── AppLord.h ├── ALMacros.h ├── Info.plist ├── ALTask.h ├── ALContext.h ├── ALTask.m └── ALContext.m ├── .gitignore ├── AppLord.podspec ├── LICENSE └── README.md /Demo/AppLordDemo/AppLordDemo/Assets.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NianJi/AppLord/HEAD/Demo/AppLordDemo/AppLordDemo/Assets.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Assets.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NianJi/AppLord/HEAD/Demo/AppLordDemo/AppLordDemo/Assets.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /AppLord.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task1.h: -------------------------------------------------------------------------------- 1 | // 2 | // Task1.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | @interface Task1 : ALTask 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task2.h: -------------------------------------------------------------------------------- 1 | // 2 | // Task2.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | @interface Task2 : ALTask 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Task3.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | @interface Task3 : ALTask 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task4.h: -------------------------------------------------------------------------------- 1 | // 2 | // Task4.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | @interface Task4 : ALTask 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task5.h: -------------------------------------------------------------------------------- 1 | // 2 | // Task5.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | @interface Task5 : ALTask 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Assets.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Assets.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/FirstViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FirstViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/TabBarServiceImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarServiceImpl.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TabBarService.h" 11 | 12 | @interface TabBarServiceImpl : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task3.m: -------------------------------------------------------------------------------- 1 | // 2 | // Task3.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "Task3.h" 10 | 11 | @implementation Task3 12 | 13 | - (void)executeTask 14 | { 15 | sleep(4); 16 | 17 | [self finishWithError:nil]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task5.m: -------------------------------------------------------------------------------- 1 | // 2 | // Task5.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "Task5.h" 10 | 11 | @implementation Task5 12 | 13 | - (void)executeTask 14 | { 15 | sleep(6); 16 | 17 | [self finishWithError:nil]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /AppLord/ALService.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALService.h 3 | // AppLord 4 | // 5 | // Created by fengnianji on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ALService 12 | 13 | @optional 14 | /** 15 | * 是否全局可见,默认service是使用时创建,如果是全局可见的,那么是持久化的一个service 16 | */ 17 | + (BOOL)globalVisible; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task1.m: -------------------------------------------------------------------------------- 1 | // 2 | // Task1.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "Task1.h" 10 | 11 | @implementation Task1 12 | 13 | - (void)executeTask 14 | { 15 | sleep(2); 16 | 17 | [self finishWithError:nil]; 18 | } 19 | 20 | - (BOOL)needMainThread 21 | { 22 | return NO; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task2.m: -------------------------------------------------------------------------------- 1 | // 2 | // Task2.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "Task2.h" 10 | 11 | @implementation Task2 12 | 13 | - (void)executeTask 14 | { 15 | sleep(3); 16 | 17 | [self finishWithError:nil]; 18 | } 19 | 20 | - (BOOL)needMainThread 21 | { 22 | return NO; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Task4.m: -------------------------------------------------------------------------------- 1 | // 2 | // Task4.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "Task4.h" 10 | 11 | @implementation Task4 12 | 13 | - (void)executeTask 14 | { 15 | sleep(5); 16 | 17 | [self finishWithError:nil]; 18 | } 19 | 20 | - (BOOL)needMainThread 21 | { 22 | return NO; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/TabBarService.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarService.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol TabBarService 12 | 13 | - (UITabBarController *)tabBarController; 14 | - (void)switchToTabIndex:(NSUInteger)index; 15 | 16 | 17 | @end 18 | 19 | typedef id TTabBarService; -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/TabBarLauncherModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarLauncherModule.h 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface TabBarLauncherModule : NSObject 13 | 14 | @property (nonatomic, strong) UITabBarController *tabBarController; 15 | @property (nonatomic, strong) UIWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AppLord/ALModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALModule.h 3 | // AppLord 4 | // 5 | // Created by fengnianji on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol ALModule 15 | 16 | /** 17 | * module did create 18 | */ 19 | - (void)moduleDidInit:(ALContext *)context; 20 | 21 | @optional 22 | 23 | /** 24 | * config when load this module, init when main thread is idle 25 | */ 26 | + (BOOL)loadAfterLaunch; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /AppLord/AppLord.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppLord.h 3 | // AppLord 4 | // 5 | // Created by fengnianji on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for AppLord. 12 | FOUNDATION_EXPORT double AppLordVersionNumber; 13 | 14 | //! Project version string for AppLord. 15 | FOUNDATION_EXPORT const unsigned char AppLordVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import 20 | #import 21 | #import 22 | #import 23 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/FirstViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "FirstViewController.h" 10 | 11 | @interface FirstViewController () 12 | 13 | @end 14 | 15 | @implementation FirstViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | self.title = @"first"; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /AppLord/ALMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALMacros.h 3 | // AppLord 4 | // 5 | // Created by fengnianji on 16/11/16. 6 | // Copyright © 2016年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #ifndef ALMacros_h 10 | #define ALMacros_h 11 | 12 | 13 | #define ALAnnotationDATA __attribute((used, section("__DATA,AppLord"))) 14 | 15 | /** 16 | * Use this to annotation a `module` 17 | * like this: @AppLordModule() 18 | */ 19 | #define AppLordModule(modName) \ 20 | protocol ALModule; \ 21 | char * kAppLordModule_##modName ALAnnotationDATA = "M:"#modName""; 22 | 23 | 24 | #define AppLordService(serviceName,cls) \ 25 | protocol ALService; \ 26 | char * kAppLordService_##serviceName ALAnnotationDATA = "S:"#serviceName":"#cls""; 27 | 28 | #endif /* ALMocros_h */ 29 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/TabBarServiceImpl.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarServiceImpl.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "TabBarServiceImpl.h" 10 | #import "TabBarLauncherModule.h" 11 | 12 | @AppLordService(TabBarService, TabBarServiceImpl) 13 | @implementation TabBarServiceImpl 14 | 15 | - (UITabBarController *)tabBarController 16 | { 17 | TabBarLauncherModule *module = [[ALContext sharedContext] findModule:[TabBarLauncherModule class]]; 18 | return module.tabBarController; 19 | } 20 | 21 | - (void)switchToTabIndex:(NSUInteger)index 22 | { 23 | TabBarLauncherModule *module = [[ALContext sharedContext] findModule:[TabBarLauncherModule class]]; 24 | [module.tabBarController setSelectedIndex:index]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /AppLord.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "AppLord" 3 | s.version = "1.2.1" 4 | s.summary = "The lord of iOS app modules" 5 | 6 | s.description = <<-DESC 7 | 8 | * Module: module management 9 | * Service Between modules 10 | * Task manage global tasks 11 | DESC 12 | 13 | s.platform = :ios 14 | s.ios.deployment_target = '6.0' 15 | 16 | s.homepage = "https://github.com/NianJi/AppLord" 17 | s.license = { :type => "MIT", :file => "LICENSE" } 18 | 19 | s.author = { "fengnianji" => "765409243@qq.com" } 20 | 21 | s.source = { :git => "https://github.com/NianJi/AppLord.git", :tag => "1.2.1" } 22 | s.source_files = "AppLord/**/*.{h,m}" 23 | 24 | s.frameworks = 'Foundation', 'UIKit' 25 | s.requires_arc = true 26 | 27 | end 28 | -------------------------------------------------------------------------------- /AppLord/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /AppLord/ALTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALTask.h 3 | // AppLordDemo 4 | // 5 | // Created by fengnianji on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * task helper class, 13 | * 1. use taskWithBlock method. you don't need call `finishWithError:` 14 | * OR 15 | * 2. imp `executeTask` method. 16 | * - DO NOT override `start` or `main` method. 17 | * - you should call `finishWithError:` when the task is done! 18 | */ 19 | @interface ALTask : NSOperation 20 | 21 | @property (nonatomic, strong) NSError *error; 22 | 23 | /** 24 | * create task with block. 25 | */ 26 | + (instancetype)taskWithBlock:(NSError *(^)(ALTask *task))block; 27 | 28 | /** 29 | * require override, do the real job in this method, when finish, should call `finishWithError:` 30 | */ 31 | - (void)executeTask; 32 | 33 | /** 34 | * call this method when task is finished, if error is nil, consider it successed. 35 | */ 36 | - (void)finishWithError:(NSError *)error; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 fengnianji 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | #import "TabBarService.h" 11 | 12 | @interface SecondViewController () 13 | 14 | @end 15 | 16 | @implementation SecondViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | self.title = @"second"; 22 | 23 | UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 24 | [button setTitle:@"去first" forState:UIControlStateNormal]; 25 | button.frame = CGRectMake(100, 200, 80, 44); 26 | [button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; 27 | [self.view addSubview:button]; 28 | } 29 | 30 | - (void)buttonTapped:(id)sender 31 | { 32 | TTabBarService service = [[ALContext sharedContext] findService:@protocol(TabBarService)]; 33 | [service switchToTabIndex:0]; 34 | } 35 | 36 | - (void)didReceiveMemoryWarning { 37 | [super didReceiveMemoryWarning]; 38 | // Dispose of any resources that can be recreated. 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/TabBarLauncherModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarLauncherModule.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "TabBarLauncherModule.h" 10 | #import "FirstViewController.h" 11 | #import "SecondViewController.h" 12 | 13 | @AppLordModule(TabBarLauncherModule) 14 | @implementation TabBarLauncherModule 15 | 16 | - (void)moduleDidInit:(ALContext *)context 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | self.window.backgroundColor = [UIColor whiteColor]; 20 | [[UIApplication sharedApplication] delegate].window = self.window; 21 | 22 | self.tabBarController = [[UITabBarController alloc] init]; 23 | 24 | NSMutableArray *vcArray = [NSMutableArray array]; 25 | { 26 | FirstViewController *vc = [[FirstViewController alloc] init]; 27 | [vcArray addObject:vc]; 28 | } 29 | { 30 | SecondViewController *vc = [[SecondViewController alloc] init]; 31 | [vcArray addObject:vc]; 32 | } 33 | self.tabBarController.viewControllers = vcArray.copy; 34 | 35 | self.window.rootViewController = self.tabBarController; 36 | [self.window makeKeyAndVisible]; 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AppLord 2 | 3 | module and service management of ios app 4 | 5 | ## add to your project 6 | 7 | management by `cocoapods`, use: 8 | 9 | pod 'AppLord' 10 | 11 | ## module 12 | 13 | what is module? every business or task could be module. 14 | 15 | when the module init? when app launch or after app launch 16 | 17 | how to impl? 18 | 19 | first, create class: 20 | 21 | ```objc 22 | #import 23 | @interface MyModule : NSObject 24 | @end 25 | ``` 26 | 27 | then, impl like this: 28 | ```objc 29 | @AppLordModule(MyModule) // Annotation for regist the module, required 30 | @implementation MyModule 31 | 32 | // module object init 33 | - (void)moduleDidInit:(ALContext *)context 34 | { 35 | // do some init thing 36 | } 37 | 38 | @end 39 | ``` 40 | ## service 41 | 42 | we can receive events from other modules in a module, but it does not always meet the demand. we can't notify back to the sender. so we provide another way to transfer event between modules: `service`. 43 | 44 | How to use? 45 | 46 | Define your custom service 47 | ```objc 48 | @protocol MyService 49 | 50 | - (void)doSomething; 51 | 52 | @end 53 | ``` 54 | 55 | Impl it 56 | ```objc 57 | @interface MyServiceImpl : NSObject 58 | 59 | @end 60 | 61 | @AppLordService(MyService, MyServiceImpl) // regist MyService's Impl class: MyServiceImpl 62 | @implementation MyServiceImpl 63 | 64 | - (void)doSomething 65 | { 66 | 67 | } 68 | 69 | // optional 70 | + (BOOL)globalVisible 71 | { 72 | // if return YES, service will be always in the memory 73 | } 74 | 75 | @end 76 | ``` 77 | 78 | How to get the instance of service? 79 | 80 | ```objc 81 | id service = [[ALContext sharedContext] findServiceByName:@"MyService"]; 82 | // or 83 | id service = [[ALContext sharedContext] findService:@protocol(MyService)]; 84 | ``` 85 | 86 | -------------------------------------------------------------------------------- /AppLord/ALContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALContext.h 3 | // AppLord 4 | // 5 | // Created by fengnianji on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol ALModule, ALService; 14 | @interface ALContext : NSObject 15 | 16 | /** 17 | * Get the singletion 18 | */ 19 | + (instancetype)sharedContext; 20 | 21 | @end 22 | 23 | @interface ALContext (Service) 24 | 25 | /** 26 | * Register a service with it's implement class 27 | */ 28 | - (void)registerService:(Protocol *)proto withImpl:(Class)implClass; 29 | 30 | /** 31 | * Find the service implement of the protocol, return nil if not registered, create instance 32 | * if not create 33 | */ 34 | - (__nullable id)findService:(Protocol *)serviceProtocol; 35 | 36 | /** 37 | * Just like `findService`, but you can pass a service's class name 38 | */ 39 | - (__nullable id)findServiceByName:(NSString *)name; 40 | 41 | /** 42 | * Figure out if a service is registered 43 | */ 44 | - (BOOL)existService:(NSString *)serviceName; 45 | 46 | 47 | @end 48 | 49 | 50 | @interface ALContext (Module) 51 | 52 | /** 53 | * register a module with it's class name 54 | */ 55 | - (void)registerModule:(Class)moduleClass; 56 | 57 | /** 58 | * init all the module registered 59 | */ 60 | - (void)loadModules; 61 | 62 | /** 63 | * Find the module instance 64 | */ 65 | - (__nullable id)findModule:(Class)moduleClass; 66 | 67 | @end 68 | 69 | @interface ALContext (Task) 70 | 71 | /** 72 | * the max concurrent of default operation queue 73 | */ 74 | @property (nonatomic, assign) NSInteger maxConcurrentOperationCount; 75 | 76 | /** 77 | * batch run tasks, async on current thread. 78 | */ 79 | - (void)addAsyncTasks:(NSArray *)tasks; 80 | 81 | /** 82 | * add a task in the default background operation queue. 83 | */ 84 | - (void)addTask:(NSOperation *)task; 85 | 86 | @end 87 | 88 | @interface ALContext (Object) 89 | 90 | - (void)setObject:(id _Nonnull)value forKey:(NSString *)key; 91 | - (nullable id)objectForKey:(NSString *)key; 92 | 93 | - (nullable NSString *)stringForKey:(NSString *)key; 94 | - (nullable NSDictionary *)dictionaryForKey:(NSString *)key; 95 | - (nullable NSArray *)arrayForKey:(NSString *)key; 96 | 97 | @end 98 | 99 | NS_ASSUME_NONNULL_END 100 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarTintParameters 32 | 33 | UINavigationBar 34 | 35 | Style 36 | UIBarStyleDefault 37 | Translucent 38 | 39 | 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | UISupportedInterfaceOrientations~ipad 48 | 49 | UIInterfaceOrientationPortrait 50 | UIInterfaceOrientationPortraitUpsideDown 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | ALLaunchTasks 55 | 56 | 57 | className 58 | Task1 59 | sync 60 | 61 | 62 | 63 | className 64 | Task2 65 | dependency 66 | Task1 67 | 68 | 69 | className 70 | Task3 71 | dependency 72 | Task1 73 | 74 | 75 | className 76 | Task4 77 | dependency 78 | Task2,Task3 79 | 80 | 81 | className 82 | Task5 83 | dependency 84 | Task4 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AppLordDemo 4 | // 5 | // Created by 念纪 on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | 22 | // 加载启动modules 23 | [[ALContext sharedContext] loadModules]; 24 | 25 | [[ALContext sharedContext] setObject:launchOptions forKey:@"ALLaunchOptionsKey"]; 26 | 27 | [self testTasksRun]; 28 | return YES; 29 | } 30 | 31 | - (void)testTasksRun 32 | { 33 | NSArray *launchTasks = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"ALLaunchTasks"]; 34 | if (launchTasks.count) { 35 | 36 | NSMutableArray *asyncTasks = [[NSMutableArray alloc] init]; 37 | 38 | NSMutableDictionary *taskMap = [[NSMutableDictionary alloc] init]; 39 | for (NSDictionary *taskInfo in launchTasks) { 40 | NSAssert([taskInfo isKindOfClass:[NSDictionary class]], @"launchTasks config error"); 41 | 42 | NSString *className = [taskInfo objectForKey:@"className"]; 43 | Class cls = NSClassFromString(className); 44 | if ([cls isSubclassOfClass:[NSOperation class]]) { 45 | 46 | NSOperation *task = [[cls alloc] init]; 47 | [asyncTasks addObject:task]; 48 | [taskMap setObject:task forKey:className]; 49 | //depedency 50 | NSArray *dependencyList = [[taskInfo objectForKey:@"dependency"] componentsSeparatedByString:@","]; 51 | if (dependencyList.count) { 52 | for (NSString *depedencyClass in dependencyList) { 53 | NSOperation *preTask = [taskMap objectForKey:depedencyClass]; 54 | if (preTask) { 55 | [task addDependency:preTask]; 56 | } 57 | } 58 | } 59 | 60 | } 61 | } 62 | 63 | if (asyncTasks.count) { 64 | [[ALContext sharedContext] addAsyncTasks:asyncTasks]; 65 | } 66 | } 67 | } 68 | 69 | - (void)applicationWillResignActive:(UIApplication *)application { 70 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 71 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 72 | } 73 | 74 | - (void)applicationDidEnterBackground:(UIApplication *)application { 75 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 76 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 77 | } 78 | 79 | - (void)applicationWillEnterForeground:(UIApplication *)application { 80 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 81 | } 82 | 83 | - (void)applicationDidBecomeActive:(UIApplication *)application { 84 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 85 | 86 | } 87 | 88 | - (void)applicationWillTerminate:(UIApplication *)application { 89 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 90 | 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /AppLord/ALTask.m: -------------------------------------------------------------------------------- 1 | // 2 | // ALTask.m 3 | // AppLordDemo 4 | // 5 | // Created by fengnianji on 15/11/19. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALTask.h" 10 | 11 | typedef NS_ENUM(NSInteger, ALTaskState) { 12 | ALTaskStateCreate, 13 | ALTaskStateReady = 1, 14 | ALTaskStateLoading, 15 | ALTaskStateSuccessed, 16 | ALTaskStateFailure, 17 | ALTaskStateCanceled, 18 | }; 19 | 20 | static inline BOOL ALTaskStateTransitionIsValid(ALTaskState fromState, ALTaskState toState) { 21 | 22 | switch (fromState) { 23 | case ALTaskStateReady: 24 | { 25 | switch (toState) { 26 | case ALTaskStateLoading: 27 | case ALTaskStateSuccessed: 28 | case ALTaskStateFailure: 29 | case ALTaskStateCanceled: 30 | return YES; 31 | break; 32 | default: 33 | return NO; 34 | break; 35 | } 36 | break; 37 | } 38 | case ALTaskStateLoading: 39 | { 40 | switch (toState) { 41 | case ALTaskStateSuccessed: 42 | case ALTaskStateFailure: 43 | case ALTaskStateCanceled: 44 | return YES; 45 | break; 46 | default: 47 | return NO; 48 | break; 49 | } 50 | } 51 | case (ALTaskState)0: 52 | { 53 | if (toState == ALTaskStateReady) { 54 | return YES; 55 | } else { 56 | return NO; 57 | } 58 | } 59 | 60 | default: 61 | return NO; 62 | break; 63 | } 64 | } 65 | 66 | @interface ALTask () 67 | 68 | @property (nonatomic, assign) ALTaskState state; 69 | @property (nonatomic, strong, readonly) NSRecursiveLock *lock; 70 | @property (nonatomic, copy) NSError *(^mainBlock)(ALTask *task); 71 | 72 | @end 73 | 74 | @implementation ALTask 75 | 76 | @synthesize lock = _lock; 77 | 78 | #pragma mark - init 79 | 80 | + (instancetype)taskWithBlock:(NSError *(^)(ALTask *))block 81 | { 82 | ALTask *task = [[ALTask alloc] init]; 83 | [task setMainBlock:block]; 84 | return task; 85 | } 86 | 87 | - (instancetype)init 88 | { 89 | self = [super init]; 90 | if (self) { 91 | self.state = ALTaskStateReady; 92 | } 93 | return self; 94 | } 95 | 96 | - (NSRecursiveLock *)lock { 97 | if (!_lock) { 98 | _lock = [[NSRecursiveLock alloc] init]; 99 | } 100 | return _lock; 101 | } 102 | 103 | #pragma mark - operation lifetime 104 | 105 | - (void)start 106 | { 107 | [self.lock lock]; 108 | if ([self isReady]) { 109 | 110 | self.state = ALTaskStateLoading; 111 | NSLog(@"%@ begin", NSStringFromClass(self.class)); 112 | [self.lock unlock]; 113 | 114 | [self executeTask]; 115 | } else { 116 | [self.lock unlock]; 117 | } 118 | } 119 | 120 | #pragma mark - state 121 | 122 | - (void)executeTask 123 | { 124 | if (self.mainBlock) { 125 | NSError *error = self.mainBlock(self); 126 | [self finishWithError:error]; 127 | } else { 128 | @throw [NSException exceptionWithName:@"ALTaskException" reason:@"need override" userInfo:nil]; 129 | } 130 | } 131 | 132 | - (void)finishWithError:(NSError *)error 133 | { 134 | [self.lock lock]; 135 | if (![self isFinished]) { 136 | 137 | NSLog(@"%@ finish", NSStringFromClass(self.class)); 138 | if (error) { 139 | self.error = error; 140 | self.state = ALTaskStateFailure; 141 | } else { 142 | self.state = ALTaskStateSuccessed; 143 | } 144 | 145 | } 146 | [self.lock unlock]; 147 | } 148 | 149 | - (void)cancel 150 | { 151 | [self.lock lock]; 152 | 153 | if (![self isFinished]) 154 | { 155 | self.state = ALTaskStateCanceled; 156 | [super cancel]; 157 | NSLog(@"%@ cancel", NSStringFromClass(self.class)); 158 | } 159 | 160 | [self.lock unlock]; 161 | } 162 | 163 | 164 | - (BOOL)isConcurrent 165 | { 166 | return YES; 167 | } 168 | 169 | - (BOOL)isReady 170 | { 171 | return self.state == ALTaskStateReady && [super isReady]; 172 | } 173 | 174 | - (BOOL)isFinished 175 | { 176 | return self.state == ALTaskStateSuccessed || self.state == ALTaskStateFailure || self.state == ALTaskStateCanceled; 177 | } 178 | 179 | - (BOOL)isExecuting 180 | { 181 | return self.state == ALTaskStateLoading; 182 | } 183 | 184 | - (BOOL)isCancelled 185 | { 186 | return self.state == ALTaskStateCanceled; 187 | } 188 | 189 | - (void)setState:(ALTaskState)state 190 | { 191 | [self.lock lock]; 192 | if (!ALTaskStateTransitionIsValid(_state, state)) { 193 | [self.lock unlock]; 194 | return; 195 | } 196 | 197 | switch (state) { 198 | case ALTaskStateCanceled: 199 | { 200 | [self willChangeValueForKey:@"isExecuting"]; 201 | [self willChangeValueForKey:@"isFinished"]; 202 | [self willChangeValueForKey:@"isCancelled"]; 203 | _state = state; 204 | [self didChangeValueForKey:@"isExecuting"]; 205 | [self didChangeValueForKey:@"isFinished"]; 206 | [self didChangeValueForKey:@"isCancelled"]; 207 | break; 208 | } 209 | case ALTaskStateLoading: 210 | { 211 | [self willChangeValueForKey:@"isExecuting"]; 212 | _state = state; 213 | [self didChangeValueForKey:@"isExecuting"]; 214 | break; 215 | } 216 | case ALTaskStateSuccessed: 217 | case ALTaskStateFailure: 218 | { 219 | [self willChangeValueForKey:@"isFinished"]; 220 | [self willChangeValueForKey:@"isExecuting"]; 221 | _state = state; 222 | [self didChangeValueForKey:@"isFinished"]; 223 | [self didChangeValueForKey:@"isExecuting"]; 224 | break; 225 | } 226 | case ALTaskStateReady: 227 | { 228 | [self willChangeValueForKey:@"isReady"]; 229 | _state = state; 230 | [self didChangeValueForKey:@"isReady"]; 231 | break; 232 | } 233 | default: 234 | { 235 | _state = state; 236 | break; 237 | } 238 | } 239 | 240 | [self.lock unlock]; 241 | } 242 | 243 | @end 244 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /AppLord/ALContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // ALContext.m 3 | // AppLord 4 | // 5 | // Created by fengnianji on 15/11/9. 6 | // Copyright © 2015年 cnbluebox. All rights reserved. 7 | // 8 | 9 | #import "ALContext.h" 10 | #import "ALModule.h" 11 | #import "ALService.h" 12 | #import "ALTask.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | NSArray* AppLordReadConfigFromSection(const char *sectionName){ 19 | 20 | #ifndef __LP64__ 21 | const struct mach_header *mhp = NULL; 22 | #else 23 | const struct mach_header_64 *mhp = NULL; 24 | #endif 25 | 26 | NSMutableArray *configs = [NSMutableArray array]; 27 | Dl_info info; 28 | if (mhp == NULL) { 29 | dladdr(AppLordReadConfigFromSection, &info); 30 | #ifndef __LP64__ 31 | mhp = (struct mach_header*)info.dli_fbase; 32 | #else 33 | mhp = (struct mach_header_64*)info.dli_fbase; 34 | #endif 35 | } 36 | 37 | #ifndef __LP64__ 38 | unsigned long size = 0; 39 | uint32_t *memory = (uint32_t*)getsectiondata(mhp, SEG_DATA, sectionName, & size); 40 | #else /* defined(__LP64__) */ 41 | unsigned long size = 0; 42 | uint64_t *memory = (uint64_t*)getsectiondata(mhp, SEG_DATA, sectionName, & size); 43 | #endif /* defined(__LP64__) */ 44 | 45 | for(int idx = 0; idx < size/sizeof(void*); ++idx){ 46 | char *string = (char*)memory[idx]; 47 | 48 | NSString *str = [NSString stringWithUTF8String:string]; 49 | if(!str)continue; 50 | 51 | if(str) [configs addObject:str]; 52 | } 53 | 54 | return configs; 55 | } 56 | 57 | #define CLOCK(...) dispatch_semaphore_wait(_configLock, DISPATCH_TIME_FOREVER); \ 58 | __VA_ARGS__; \ 59 | dispatch_semaphore_signal(_configLock); 60 | 61 | @interface ALContext () 62 | { 63 | NSMutableDictionary> *_modulesByName; 64 | NSMutableDictionary> *_moduleClassesByName; 65 | 66 | NSMutableDictionary> *_servicesByName; 67 | NSMutableDictionary> *_serviceClassesByName; 68 | 69 | BOOL _finishedStart; 70 | 71 | NSOperationQueue *_taskQueue; 72 | 73 | NSMutableDictionary *_config; 74 | dispatch_semaphore_t _configLock; 75 | } 76 | 77 | @end 78 | 79 | @implementation ALContext 80 | 81 | + (instancetype)sharedContext 82 | { 83 | static ALContext *context = nil; 84 | static dispatch_once_t onceToken; 85 | dispatch_once(&onceToken, ^{ 86 | context = [[self alloc] init]; 87 | }); 88 | return context; 89 | } 90 | 91 | - (instancetype)init 92 | { 93 | self = [super init]; 94 | if (self) { 95 | _modulesByName = [[NSMutableDictionary alloc] init]; 96 | _moduleClassesByName = [[NSMutableDictionary alloc] init]; 97 | 98 | _servicesByName = [[NSMutableDictionary alloc] init]; 99 | _serviceClassesByName = [[NSMutableDictionary alloc] init]; 100 | 101 | _taskQueue = [[NSOperationQueue alloc] init]; 102 | _taskQueue.name = @"AppLord.ALContext.TaskQueue"; 103 | 104 | _config = [[NSMutableDictionary alloc] init]; 105 | _configLock = dispatch_semaphore_create(1);; 106 | 107 | [self readModuleAndServiceRegistedInSection]; 108 | } 109 | return self; 110 | } 111 | 112 | - (void)readModuleAndServiceRegistedInSection 113 | { 114 | NSArray *dataListInSection = AppLordReadConfigFromSection("AppLord"); 115 | for (NSString *item in dataListInSection) { 116 | NSArray *components = [item componentsSeparatedByString:@":"]; 117 | if (components.count >= 2) { 118 | NSString *type = components[0]; 119 | if ([type isEqualToString:@"M"]) { 120 | NSString *modName = components[1]; 121 | Class modCls = NSClassFromString(modName); 122 | if (modCls) { 123 | [self registerModule:modCls]; 124 | } 125 | } else if ([type isEqualToString:@"S"] && components.count == 3) { 126 | NSString *serName = components[1]; 127 | NSString *serImplName = components[2]; 128 | 129 | Protocol *serPro = NSProtocolFromString(serName); 130 | Class serCls = NSClassFromString(serImplName); 131 | if (serPro && serCls) { 132 | [self registerService:serPro withImpl:serCls]; 133 | } 134 | } 135 | } 136 | } 137 | } 138 | 139 | #pragma mark - service 140 | 141 | - (void)registerService:(Protocol *)proto withImpl:(Class)implClass 142 | { 143 | NSParameterAssert(proto != nil); 144 | NSParameterAssert(implClass != nil); 145 | 146 | if (![implClass conformsToProtocol:proto]) { 147 | @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"%@ 服务不符合 %@ 协议", NSStringFromClass(implClass), NSStringFromProtocol(proto)] userInfo:nil]; 148 | } 149 | 150 | if ([_servicesByName objectForKey:NSStringFromProtocol(proto)]) { 151 | @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"%@ 协议已经注册", NSStringFromProtocol(proto)] userInfo:nil]; 152 | } 153 | 154 | // Register Protocol 155 | NSString *protoName = NSStringFromProtocol(proto); 156 | if (protoName) { 157 | if ([implClass respondsToSelector:@selector(globalVisible)]) { 158 | BOOL isGlobal = [implClass globalVisible]; 159 | if (isGlobal) { 160 | id service = [[implClass alloc] init]; 161 | [_servicesByName setObject:service forKey:protoName]; 162 | } else { 163 | [_serviceClassesByName setObject:implClass forKey:protoName]; 164 | } 165 | } else { 166 | [_serviceClassesByName setObject:implClass forKey:protoName]; 167 | } 168 | } 169 | } 170 | 171 | - (id)findService:(Protocol *)serviceProtocol 172 | { 173 | return [self findServiceByName:NSStringFromProtocol(serviceProtocol)]; 174 | } 175 | 176 | - (id)findServiceByName:(NSString *)name 177 | { 178 | id obj = [_servicesByName objectForKey:name]; 179 | if (obj) { 180 | return obj; 181 | } else { 182 | Class cls = [_serviceClassesByName objectForKey:name]; 183 | if (cls) { 184 | return [[cls alloc] init]; 185 | } 186 | } 187 | return nil; 188 | } 189 | 190 | - (BOOL)existService:(NSString *)serviceName 191 | { 192 | id obj = [_servicesByName objectForKey:serviceName]; 193 | if (obj) { 194 | return YES; 195 | } else { 196 | Class cls = [_serviceClassesByName objectForKey:serviceName]; 197 | if (cls) { 198 | return YES; 199 | } 200 | } 201 | return NO; 202 | } 203 | 204 | #pragma mark - module 205 | 206 | - (void)registerModule:(Class)moduleClass 207 | { 208 | NSParameterAssert(moduleClass != nil); 209 | 210 | if (![moduleClass conformsToProtocol:@protocol(ALModule)]) { 211 | @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"%@ 模块不符合 ALModule 协议", NSStringFromClass(moduleClass)] userInfo:nil]; 212 | } 213 | 214 | if ([_moduleClassesByName objectForKey:NSStringFromClass(moduleClass)]) { 215 | @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"%@ 模块类已经注册", NSStringFromClass(moduleClass)] userInfo:nil]; 216 | } 217 | 218 | NSString *key = NSStringFromClass(moduleClass); 219 | [_moduleClassesByName setObject:moduleClass forKey:key]; 220 | } 221 | 222 | - (id)findModule:(Class)moduleClass 223 | { 224 | NSString *key = NSStringFromClass(moduleClass); 225 | id module = [_modulesByName objectForKey:key]; 226 | if (!module) { 227 | module = [self setupModuleWithClass:moduleClass]; 228 | } 229 | return module; 230 | } 231 | 232 | - (id)setupModuleWithClass:(Class)moduleClass 233 | { 234 | NSAssert([NSThread isMainThread], @"must run in main thread"); 235 | id module = [[moduleClass alloc] init]; 236 | [_modulesByName setObject:module forKey:NSStringFromClass(moduleClass)]; 237 | if ([module respondsToSelector:@selector(moduleDidInit:)]) { 238 | [module moduleDidInit:self]; 239 | } 240 | return module; 241 | } 242 | 243 | - (void)loadModules 244 | { 245 | NSAssert([NSThread isMainThread], @"must run in main thread"); 246 | NSArray *moduleClassArray = _moduleClassesByName.allValues; 247 | for (Class moduleClass in moduleClassArray) { 248 | 249 | if ([moduleClass respondsToSelector:@selector(loadAfterLaunch)]) { 250 | 251 | dispatch_async(dispatch_get_main_queue(), ^{ 252 | 253 | [self setupModuleWithClass:moduleClass]; 254 | }); 255 | continue; 256 | } 257 | 258 | [self setupModuleWithClass:moduleClass]; 259 | } 260 | } 261 | 262 | #pragma mark - task 263 | 264 | - (void)setMaxConcurrentOperationCount:(NSInteger)maxConcurrentOperationCount 265 | { 266 | [_taskQueue setMaxConcurrentOperationCount:maxConcurrentOperationCount]; 267 | } 268 | 269 | - (NSInteger)maxConcurrentOperationCount 270 | { 271 | return _taskQueue.maxConcurrentOperationCount; 272 | } 273 | 274 | - (void)addAsyncTasks:(NSArray *)tasks 275 | { 276 | if (tasks.count) { 277 | [_taskQueue addOperations:tasks waitUntilFinished:NO]; 278 | } 279 | } 280 | 281 | - (void)addTask:(NSOperation *)task 282 | { 283 | [_taskQueue addOperation:task]; 284 | } 285 | 286 | #pragma mark - config 287 | 288 | - (void)setObject:(id)value forKey:(NSString *)key 289 | { 290 | if (value && key) { 291 | CLOCK([_config setObject:value forKey:key];) 292 | } 293 | } 294 | 295 | - (id)objectForKey:(NSString *)key 296 | { 297 | CLOCK(id object = [_config objectForKey:key]); 298 | return object; 299 | } 300 | 301 | - (NSString *)stringForKey:(NSString *)key 302 | { 303 | CLOCK(id object = [_config objectForKey:key]); 304 | if ([object isKindOfClass:[NSString class]]) { 305 | return object; 306 | } 307 | else if ([object isKindOfClass:[NSNumber class]]) { 308 | return [object stringValue]; 309 | } 310 | else { 311 | return nil; 312 | } 313 | } 314 | 315 | - (NSDictionary *)dictionaryForKey:(NSString *)key 316 | { 317 | CLOCK(id object = [_config objectForKey:key]); 318 | if ([object isKindOfClass:[NSDictionary class]]) { 319 | return object; 320 | } 321 | else { 322 | return nil; 323 | } 324 | } 325 | 326 | - (NSArray *)arrayForKey:(NSString *)key 327 | { 328 | CLOCK(id object = [_config objectForKey:key]); 329 | if ([object isKindOfClass:[NSArray class]]) { 330 | return object; 331 | } 332 | else { 333 | return nil; 334 | } 335 | } 336 | 337 | @end 338 | -------------------------------------------------------------------------------- /AppLord.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A371C2461BF0798D00A7D4C7 /* AppLord.h in Headers */ = {isa = PBXBuildFile; fileRef = A371C2451BF0798D00A7D4C7 /* AppLord.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | A371C2531BF07ABE00A7D4C7 /* ALContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A371C2511BF07ABE00A7D4C7 /* ALContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | A371C2541BF07ABE00A7D4C7 /* ALContext.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C2521BF07ABE00A7D4C7 /* ALContext.m */; }; 13 | A371C2571BF07ACC00A7D4C7 /* ALService.h in Headers */ = {isa = PBXBuildFile; fileRef = A371C2551BF07ACC00A7D4C7 /* ALService.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | A371C25B1BF07ADD00A7D4C7 /* ALModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A371C2591BF07ADD00A7D4C7 /* ALModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | A3C7B2221C7DE4EC00C766BA /* ALTask.h in Headers */ = {isa = PBXBuildFile; fileRef = A3C7B2201C7DE4EC00C766BA /* ALTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | A3C7B2231C7DE4EC00C766BA /* ALTask.m in Sources */ = {isa = PBXBuildFile; fileRef = A3C7B2211C7DE4EC00C766BA /* ALTask.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | A371C2421BF0798D00A7D4C7 /* AppLord.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AppLord.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | A371C2451BF0798D00A7D4C7 /* AppLord.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppLord.h; sourceTree = ""; }; 22 | A371C2471BF0798E00A7D4C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | A371C2511BF07ABE00A7D4C7 /* ALContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALContext.h; sourceTree = ""; }; 24 | A371C2521BF07ABE00A7D4C7 /* ALContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALContext.m; sourceTree = ""; }; 25 | A371C2551BF07ACC00A7D4C7 /* ALService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALService.h; sourceTree = ""; }; 26 | A371C2591BF07ADD00A7D4C7 /* ALModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALModule.h; sourceTree = ""; }; 27 | A3B9D4461DDC0C7A00546C8C /* ALMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALMacros.h; sourceTree = ""; }; 28 | A3C7B2201C7DE4EC00C766BA /* ALTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALTask.h; sourceTree = ""; }; 29 | A3C7B2211C7DE4EC00C766BA /* ALTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALTask.m; sourceTree = ""; }; 30 | /* End PBXFileReference section */ 31 | 32 | /* Begin PBXFrameworksBuildPhase section */ 33 | A371C23E1BF0798D00A7D4C7 /* Frameworks */ = { 34 | isa = PBXFrameworksBuildPhase; 35 | buildActionMask = 2147483647; 36 | files = ( 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | A371C2381BF0798D00A7D4C7 = { 44 | isa = PBXGroup; 45 | children = ( 46 | A371C2441BF0798D00A7D4C7 /* AppLord */, 47 | A371C2431BF0798D00A7D4C7 /* Products */, 48 | ); 49 | sourceTree = ""; 50 | }; 51 | A371C2431BF0798D00A7D4C7 /* Products */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | A371C2421BF0798D00A7D4C7 /* AppLord.framework */, 55 | ); 56 | name = Products; 57 | sourceTree = ""; 58 | }; 59 | A371C2441BF0798D00A7D4C7 /* AppLord */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | A3C7B2201C7DE4EC00C766BA /* ALTask.h */, 63 | A3C7B2211C7DE4EC00C766BA /* ALTask.m */, 64 | A371C2451BF0798D00A7D4C7 /* AppLord.h */, 65 | A371C2511BF07ABE00A7D4C7 /* ALContext.h */, 66 | A371C2521BF07ABE00A7D4C7 /* ALContext.m */, 67 | A371C2551BF07ACC00A7D4C7 /* ALService.h */, 68 | A371C2591BF07ADD00A7D4C7 /* ALModule.h */, 69 | A371C2471BF0798E00A7D4C7 /* Info.plist */, 70 | A3B9D4461DDC0C7A00546C8C /* ALMacros.h */, 71 | ); 72 | path = AppLord; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXHeadersBuildPhase section */ 78 | A371C23F1BF0798D00A7D4C7 /* Headers */ = { 79 | isa = PBXHeadersBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | A3C7B2221C7DE4EC00C766BA /* ALTask.h in Headers */, 83 | A371C2461BF0798D00A7D4C7 /* AppLord.h in Headers */, 84 | A371C2531BF07ABE00A7D4C7 /* ALContext.h in Headers */, 85 | A371C2571BF07ACC00A7D4C7 /* ALService.h in Headers */, 86 | A371C25B1BF07ADD00A7D4C7 /* ALModule.h in Headers */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXHeadersBuildPhase section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | A371C2411BF0798D00A7D4C7 /* AppLord */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = A371C24A1BF0798E00A7D4C7 /* Build configuration list for PBXNativeTarget "AppLord" */; 96 | buildPhases = ( 97 | A371C23D1BF0798D00A7D4C7 /* Sources */, 98 | A371C23E1BF0798D00A7D4C7 /* Frameworks */, 99 | A371C23F1BF0798D00A7D4C7 /* Headers */, 100 | A371C2401BF0798D00A7D4C7 /* Resources */, 101 | ); 102 | buildRules = ( 103 | ); 104 | dependencies = ( 105 | ); 106 | name = AppLord; 107 | productName = AppLord; 108 | productReference = A371C2421BF0798D00A7D4C7 /* AppLord.framework */; 109 | productType = "com.apple.product-type.framework"; 110 | }; 111 | /* End PBXNativeTarget section */ 112 | 113 | /* Begin PBXProject section */ 114 | A371C2391BF0798D00A7D4C7 /* Project object */ = { 115 | isa = PBXProject; 116 | attributes = { 117 | LastUpgradeCheck = 0710; 118 | ORGANIZATIONNAME = cnbluebox; 119 | TargetAttributes = { 120 | A371C2411BF0798D00A7D4C7 = { 121 | CreatedOnToolsVersion = 7.1; 122 | DevelopmentTeam = N44L3X6FN9; 123 | }; 124 | }; 125 | }; 126 | buildConfigurationList = A371C23C1BF0798D00A7D4C7 /* Build configuration list for PBXProject "AppLord" */; 127 | compatibilityVersion = "Xcode 3.2"; 128 | developmentRegion = English; 129 | hasScannedForEncodings = 0; 130 | knownRegions = ( 131 | en, 132 | ); 133 | mainGroup = A371C2381BF0798D00A7D4C7; 134 | productRefGroup = A371C2431BF0798D00A7D4C7 /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | A371C2411BF0798D00A7D4C7 /* AppLord */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXResourcesBuildPhase section */ 144 | A371C2401BF0798D00A7D4C7 /* Resources */ = { 145 | isa = PBXResourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXSourcesBuildPhase section */ 154 | A371C23D1BF0798D00A7D4C7 /* Sources */ = { 155 | isa = PBXSourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | A371C2541BF07ABE00A7D4C7 /* ALContext.m in Sources */, 159 | A3C7B2231C7DE4EC00C766BA /* ALTask.m in Sources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXSourcesBuildPhase section */ 164 | 165 | /* Begin XCBuildConfiguration section */ 166 | A371C2481BF0798E00A7D4C7 /* Debug */ = { 167 | isa = XCBuildConfiguration; 168 | buildSettings = { 169 | ALWAYS_SEARCH_USER_PATHS = NO; 170 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 171 | CLANG_CXX_LIBRARY = "libc++"; 172 | CLANG_ENABLE_MODULES = YES; 173 | CLANG_ENABLE_OBJC_ARC = YES; 174 | CLANG_WARN_BOOL_CONVERSION = YES; 175 | CLANG_WARN_CONSTANT_CONVERSION = YES; 176 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 177 | CLANG_WARN_EMPTY_BODY = YES; 178 | CLANG_WARN_ENUM_CONVERSION = YES; 179 | CLANG_WARN_INT_CONVERSION = YES; 180 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 181 | CLANG_WARN_UNREACHABLE_CODE = YES; 182 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 183 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 184 | COPY_PHASE_STRIP = NO; 185 | CURRENT_PROJECT_VERSION = 1; 186 | DEBUG_INFORMATION_FORMAT = dwarf; 187 | ENABLE_STRICT_OBJC_MSGSEND = YES; 188 | ENABLE_TESTABILITY = YES; 189 | GCC_C_LANGUAGE_STANDARD = gnu99; 190 | GCC_DYNAMIC_NO_PIC = NO; 191 | GCC_NO_COMMON_BLOCKS = YES; 192 | GCC_OPTIMIZATION_LEVEL = 0; 193 | GCC_PREPROCESSOR_DEFINITIONS = ( 194 | "DEBUG=1", 195 | "$(inherited)", 196 | ); 197 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 198 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 199 | GCC_WARN_UNDECLARED_SELECTOR = YES; 200 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 201 | GCC_WARN_UNUSED_FUNCTION = YES; 202 | GCC_WARN_UNUSED_VARIABLE = YES; 203 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 204 | MTL_ENABLE_DEBUG_INFO = YES; 205 | ONLY_ACTIVE_ARCH = YES; 206 | SDKROOT = iphoneos; 207 | TARGETED_DEVICE_FAMILY = "1,2"; 208 | VERSIONING_SYSTEM = "apple-generic"; 209 | VERSION_INFO_PREFIX = ""; 210 | }; 211 | name = Debug; 212 | }; 213 | A371C2491BF0798E00A7D4C7 /* Release */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 218 | CLANG_CXX_LIBRARY = "libc++"; 219 | CLANG_ENABLE_MODULES = YES; 220 | CLANG_ENABLE_OBJC_ARC = YES; 221 | CLANG_WARN_BOOL_CONVERSION = YES; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 224 | CLANG_WARN_EMPTY_BODY = YES; 225 | CLANG_WARN_ENUM_CONVERSION = YES; 226 | CLANG_WARN_INT_CONVERSION = YES; 227 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 228 | CLANG_WARN_UNREACHABLE_CODE = YES; 229 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 230 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 231 | COPY_PHASE_STRIP = NO; 232 | CURRENT_PROJECT_VERSION = 1; 233 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 234 | ENABLE_NS_ASSERTIONS = NO; 235 | ENABLE_STRICT_OBJC_MSGSEND = YES; 236 | GCC_C_LANGUAGE_STANDARD = gnu99; 237 | GCC_NO_COMMON_BLOCKS = YES; 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 245 | MTL_ENABLE_DEBUG_INFO = NO; 246 | SDKROOT = iphoneos; 247 | TARGETED_DEVICE_FAMILY = "1,2"; 248 | VALIDATE_PRODUCT = YES; 249 | VERSIONING_SYSTEM = "apple-generic"; 250 | VERSION_INFO_PREFIX = ""; 251 | }; 252 | name = Release; 253 | }; 254 | A371C24B1BF0798E00A7D4C7 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | DEFINES_MODULE = YES; 258 | DYLIB_COMPATIBILITY_VERSION = 1; 259 | DYLIB_CURRENT_VERSION = 1; 260 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 261 | INFOPLIST_FILE = AppLord/Info.plist; 262 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 263 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 264 | PRODUCT_BUNDLE_IDENTIFIER = com.cnbluebox.AppLord; 265 | PRODUCT_NAME = "$(TARGET_NAME)"; 266 | SKIP_INSTALL = YES; 267 | }; 268 | name = Debug; 269 | }; 270 | A371C24C1BF0798E00A7D4C7 /* Release */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | DEFINES_MODULE = YES; 274 | DYLIB_COMPATIBILITY_VERSION = 1; 275 | DYLIB_CURRENT_VERSION = 1; 276 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 277 | INFOPLIST_FILE = AppLord/Info.plist; 278 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = com.cnbluebox.AppLord; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | SKIP_INSTALL = YES; 283 | }; 284 | name = Release; 285 | }; 286 | /* End XCBuildConfiguration section */ 287 | 288 | /* Begin XCConfigurationList section */ 289 | A371C23C1BF0798D00A7D4C7 /* Build configuration list for PBXProject "AppLord" */ = { 290 | isa = XCConfigurationList; 291 | buildConfigurations = ( 292 | A371C2481BF0798E00A7D4C7 /* Debug */, 293 | A371C2491BF0798E00A7D4C7 /* Release */, 294 | ); 295 | defaultConfigurationIsVisible = 0; 296 | defaultConfigurationName = Release; 297 | }; 298 | A371C24A1BF0798E00A7D4C7 /* Build configuration list for PBXNativeTarget "AppLord" */ = { 299 | isa = XCConfigurationList; 300 | buildConfigurations = ( 301 | A371C24B1BF0798E00A7D4C7 /* Debug */, 302 | A371C24C1BF0798E00A7D4C7 /* Release */, 303 | ); 304 | defaultConfigurationIsVisible = 0; 305 | defaultConfigurationName = Release; 306 | }; 307 | /* End XCConfigurationList section */ 308 | }; 309 | rootObject = A371C2391BF0798D00A7D4C7 /* Project object */; 310 | } 311 | -------------------------------------------------------------------------------- /Demo/AppLordDemo/AppLordDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A371C2731BF0C17200A7D4C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C2721BF0C17200A7D4C7 /* main.m */; }; 11 | A371C2761BF0C17200A7D4C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C2751BF0C17200A7D4C7 /* AppDelegate.m */; }; 12 | A371C2791BF0C17200A7D4C7 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C2781BF0C17200A7D4C7 /* FirstViewController.m */; }; 13 | A371C27C1BF0C17200A7D4C7 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C27B1BF0C17200A7D4C7 /* SecondViewController.m */; }; 14 | A371C27F1BF0C17200A7D4C7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A371C27D1BF0C17200A7D4C7 /* Main.storyboard */; }; 15 | A371C2811BF0C17200A7D4C7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A371C2801BF0C17200A7D4C7 /* Assets.xcassets */; }; 16 | A371C2841BF0C17200A7D4C7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A371C2821BF0C17200A7D4C7 /* LaunchScreen.storyboard */; }; 17 | A371C2961BF0C19900A7D4C7 /* ALContext.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C28D1BF0C19900A7D4C7 /* ALContext.m */; }; 18 | A371C29C1BF0C3E300A7D4C7 /* TabBarLauncherModule.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C29B1BF0C3E300A7D4C7 /* TabBarLauncherModule.m */; }; 19 | A371C2A01BF0CACA00A7D4C7 /* TabBarServiceImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = A371C29F1BF0CACA00A7D4C7 /* TabBarServiceImpl.m */; }; 20 | A3D1F7051BFDF1E700E3D16F /* ALTask.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F7041BFDF1E700E3D16F /* ALTask.m */; }; 21 | A3D1F7081BFE033200E3D16F /* Task1.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F7071BFE033200E3D16F /* Task1.m */; }; 22 | A3D1F70B1BFE034100E3D16F /* Task2.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F70A1BFE034100E3D16F /* Task2.m */; }; 23 | A3D1F70E1BFE034D00E3D16F /* Task3.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F70D1BFE034D00E3D16F /* Task3.m */; }; 24 | A3D1F7111BFE035900E3D16F /* Task4.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F7101BFE035900E3D16F /* Task4.m */; }; 25 | A3D1F7141BFE036700E3D16F /* Task5.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D1F7131BFE036700E3D16F /* Task5.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | A371C26E1BF0C17200A7D4C7 /* AppLordDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppLordDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | A371C2721BF0C17200A7D4C7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | A371C2741BF0C17200A7D4C7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 32 | A371C2751BF0C17200A7D4C7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 33 | A371C2771BF0C17200A7D4C7 /* FirstViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; 34 | A371C2781BF0C17200A7D4C7 /* FirstViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; 35 | A371C27A1BF0C17200A7D4C7 /* SecondViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 36 | A371C27B1BF0C17200A7D4C7 /* SecondViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 37 | A371C27E1BF0C17200A7D4C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 38 | A371C2801BF0C17200A7D4C7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 39 | A371C2831BF0C17200A7D4C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 40 | A371C2851BF0C17200A7D4C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | A371C28C1BF0C19900A7D4C7 /* ALContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALContext.h; sourceTree = ""; }; 42 | A371C28D1BF0C19900A7D4C7 /* ALContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALContext.m; sourceTree = ""; }; 43 | A371C2921BF0C19900A7D4C7 /* ALModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALModule.h; sourceTree = ""; }; 44 | A371C2931BF0C19900A7D4C7 /* ALService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALService.h; sourceTree = ""; }; 45 | A371C2941BF0C19900A7D4C7 /* AppLord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppLord.h; sourceTree = ""; }; 46 | A371C29A1BF0C3E300A7D4C7 /* TabBarLauncherModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabBarLauncherModule.h; sourceTree = ""; }; 47 | A371C29B1BF0C3E300A7D4C7 /* TabBarLauncherModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabBarLauncherModule.m; sourceTree = ""; }; 48 | A371C29E1BF0CACA00A7D4C7 /* TabBarServiceImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabBarServiceImpl.h; sourceTree = ""; }; 49 | A371C29F1BF0CACA00A7D4C7 /* TabBarServiceImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabBarServiceImpl.m; sourceTree = ""; }; 50 | A371C2A11BF0CADC00A7D4C7 /* TabBarService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabBarService.h; sourceTree = ""; }; 51 | A3B9D4471DDC0E5A00546C8C /* ALMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALMacros.h; sourceTree = ""; }; 52 | A3D1F7031BFDF1E700E3D16F /* ALTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALTask.h; sourceTree = ""; }; 53 | A3D1F7041BFDF1E700E3D16F /* ALTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALTask.m; sourceTree = ""; }; 54 | A3D1F7061BFE033200E3D16F /* Task1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task1.h; sourceTree = ""; }; 55 | A3D1F7071BFE033200E3D16F /* Task1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task1.m; sourceTree = ""; }; 56 | A3D1F7091BFE034100E3D16F /* Task2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task2.h; sourceTree = ""; }; 57 | A3D1F70A1BFE034100E3D16F /* Task2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task2.m; sourceTree = ""; }; 58 | A3D1F70C1BFE034D00E3D16F /* Task3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task3.h; sourceTree = ""; }; 59 | A3D1F70D1BFE034D00E3D16F /* Task3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task3.m; sourceTree = ""; }; 60 | A3D1F70F1BFE035900E3D16F /* Task4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task4.h; sourceTree = ""; }; 61 | A3D1F7101BFE035900E3D16F /* Task4.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task4.m; sourceTree = ""; }; 62 | A3D1F7121BFE036700E3D16F /* Task5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task5.h; sourceTree = ""; }; 63 | A3D1F7131BFE036700E3D16F /* Task5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task5.m; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | A371C26B1BF0C17200A7D4C7 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | A371C2651BF0C17200A7D4C7 = { 78 | isa = PBXGroup; 79 | children = ( 80 | A371C28B1BF0C19900A7D4C7 /* AppLord */, 81 | A371C2701BF0C17200A7D4C7 /* AppLordDemo */, 82 | A371C26F1BF0C17200A7D4C7 /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | A371C26F1BF0C17200A7D4C7 /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | A371C26E1BF0C17200A7D4C7 /* AppLordDemo.app */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | A371C2701BF0C17200A7D4C7 /* AppLordDemo */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | A371C2741BF0C17200A7D4C7 /* AppDelegate.h */, 98 | A371C2751BF0C17200A7D4C7 /* AppDelegate.m */, 99 | A371C2771BF0C17200A7D4C7 /* FirstViewController.h */, 100 | A371C2781BF0C17200A7D4C7 /* FirstViewController.m */, 101 | A371C27A1BF0C17200A7D4C7 /* SecondViewController.h */, 102 | A371C27B1BF0C17200A7D4C7 /* SecondViewController.m */, 103 | A371C27D1BF0C17200A7D4C7 /* Main.storyboard */, 104 | A371C2801BF0C17200A7D4C7 /* Assets.xcassets */, 105 | A371C2821BF0C17200A7D4C7 /* LaunchScreen.storyboard */, 106 | A371C2851BF0C17200A7D4C7 /* Info.plist */, 107 | A371C2711BF0C17200A7D4C7 /* Supporting Files */, 108 | A371C29A1BF0C3E300A7D4C7 /* TabBarLauncherModule.h */, 109 | A371C29B1BF0C3E300A7D4C7 /* TabBarLauncherModule.m */, 110 | A371C29E1BF0CACA00A7D4C7 /* TabBarServiceImpl.h */, 111 | A371C29F1BF0CACA00A7D4C7 /* TabBarServiceImpl.m */, 112 | A371C2A11BF0CADC00A7D4C7 /* TabBarService.h */, 113 | A3D1F7061BFE033200E3D16F /* Task1.h */, 114 | A3D1F7071BFE033200E3D16F /* Task1.m */, 115 | A3D1F7091BFE034100E3D16F /* Task2.h */, 116 | A3D1F70A1BFE034100E3D16F /* Task2.m */, 117 | A3D1F70C1BFE034D00E3D16F /* Task3.h */, 118 | A3D1F70D1BFE034D00E3D16F /* Task3.m */, 119 | A3D1F70F1BFE035900E3D16F /* Task4.h */, 120 | A3D1F7101BFE035900E3D16F /* Task4.m */, 121 | A3D1F7121BFE036700E3D16F /* Task5.h */, 122 | A3D1F7131BFE036700E3D16F /* Task5.m */, 123 | ); 124 | path = AppLordDemo; 125 | sourceTree = ""; 126 | }; 127 | A371C2711BF0C17200A7D4C7 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | A371C2721BF0C17200A7D4C7 /* main.m */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | A371C28B1BF0C19900A7D4C7 /* AppLord */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | A3B9D4471DDC0E5A00546C8C /* ALMacros.h */, 139 | A371C28C1BF0C19900A7D4C7 /* ALContext.h */, 140 | A371C28D1BF0C19900A7D4C7 /* ALContext.m */, 141 | A371C2921BF0C19900A7D4C7 /* ALModule.h */, 142 | A371C2931BF0C19900A7D4C7 /* ALService.h */, 143 | A371C2941BF0C19900A7D4C7 /* AppLord.h */, 144 | A3D1F7031BFDF1E700E3D16F /* ALTask.h */, 145 | A3D1F7041BFDF1E700E3D16F /* ALTask.m */, 146 | ); 147 | name = AppLord; 148 | path = ../../AppLord; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | A371C26D1BF0C17200A7D4C7 /* AppLordDemo */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = A371C2881BF0C17200A7D4C7 /* Build configuration list for PBXNativeTarget "AppLordDemo" */; 157 | buildPhases = ( 158 | A371C26A1BF0C17200A7D4C7 /* Sources */, 159 | A371C26B1BF0C17200A7D4C7 /* Frameworks */, 160 | A371C26C1BF0C17200A7D4C7 /* Resources */, 161 | ); 162 | buildRules = ( 163 | ); 164 | dependencies = ( 165 | ); 166 | name = AppLordDemo; 167 | productName = AppLordDemo; 168 | productReference = A371C26E1BF0C17200A7D4C7 /* AppLordDemo.app */; 169 | productType = "com.apple.product-type.application"; 170 | }; 171 | /* End PBXNativeTarget section */ 172 | 173 | /* Begin PBXProject section */ 174 | A371C2661BF0C17200A7D4C7 /* Project object */ = { 175 | isa = PBXProject; 176 | attributes = { 177 | LastUpgradeCheck = 0710; 178 | ORGANIZATIONNAME = cnbluebox; 179 | TargetAttributes = { 180 | A371C26D1BF0C17200A7D4C7 = { 181 | CreatedOnToolsVersion = 7.1; 182 | DevelopmentTeam = N44L3X6FN9; 183 | }; 184 | }; 185 | }; 186 | buildConfigurationList = A371C2691BF0C17200A7D4C7 /* Build configuration list for PBXProject "AppLordDemo" */; 187 | compatibilityVersion = "Xcode 3.2"; 188 | developmentRegion = English; 189 | hasScannedForEncodings = 0; 190 | knownRegions = ( 191 | en, 192 | Base, 193 | ); 194 | mainGroup = A371C2651BF0C17200A7D4C7; 195 | productRefGroup = A371C26F1BF0C17200A7D4C7 /* Products */; 196 | projectDirPath = ""; 197 | projectRoot = ""; 198 | targets = ( 199 | A371C26D1BF0C17200A7D4C7 /* AppLordDemo */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | A371C26C1BF0C17200A7D4C7 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | A371C2841BF0C17200A7D4C7 /* LaunchScreen.storyboard in Resources */, 210 | A371C2811BF0C17200A7D4C7 /* Assets.xcassets in Resources */, 211 | A371C27F1BF0C17200A7D4C7 /* Main.storyboard in Resources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | A371C26A1BF0C17200A7D4C7 /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | A371C27C1BF0C17200A7D4C7 /* SecondViewController.m in Sources */, 223 | A3D1F70E1BFE034D00E3D16F /* Task3.m in Sources */, 224 | A371C2761BF0C17200A7D4C7 /* AppDelegate.m in Sources */, 225 | A3D1F70B1BFE034100E3D16F /* Task2.m in Sources */, 226 | A3D1F7141BFE036700E3D16F /* Task5.m in Sources */, 227 | A371C2961BF0C19900A7D4C7 /* ALContext.m in Sources */, 228 | A371C29C1BF0C3E300A7D4C7 /* TabBarLauncherModule.m in Sources */, 229 | A371C2A01BF0CACA00A7D4C7 /* TabBarServiceImpl.m in Sources */, 230 | A3D1F7081BFE033200E3D16F /* Task1.m in Sources */, 231 | A3D1F7051BFDF1E700E3D16F /* ALTask.m in Sources */, 232 | A371C2791BF0C17200A7D4C7 /* FirstViewController.m in Sources */, 233 | A371C2731BF0C17200A7D4C7 /* main.m in Sources */, 234 | A3D1F7111BFE035900E3D16F /* Task4.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | A371C27D1BF0C17200A7D4C7 /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | A371C27E1BF0C17200A7D4C7 /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | A371C2821BF0C17200A7D4C7 /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | A371C2831BF0C17200A7D4C7 /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | A371C2861BF0C17200A7D4C7 /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 278 | COPY_PHASE_STRIP = NO; 279 | DEBUG_INFORMATION_FORMAT = dwarf; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | ENABLE_TESTABILITY = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu99; 283 | GCC_DYNAMIC_NO_PIC = NO; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_OPTIMIZATION_LEVEL = 0; 286 | GCC_PREPROCESSOR_DEFINITIONS = ( 287 | "DEBUG=1", 288 | "$(inherited)", 289 | ); 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 297 | MTL_ENABLE_DEBUG_INFO = YES; 298 | ONLY_ACTIVE_ARCH = YES; 299 | SDKROOT = iphoneos; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | }; 302 | name = Debug; 303 | }; 304 | A371C2871BF0C17200A7D4C7 /* Release */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 322 | COPY_PHASE_STRIP = NO; 323 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 324 | ENABLE_NS_ASSERTIONS = NO; 325 | ENABLE_STRICT_OBJC_MSGSEND = YES; 326 | GCC_C_LANGUAGE_STANDARD = gnu99; 327 | GCC_NO_COMMON_BLOCKS = YES; 328 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 330 | GCC_WARN_UNDECLARED_SELECTOR = YES; 331 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 332 | GCC_WARN_UNUSED_FUNCTION = YES; 333 | GCC_WARN_UNUSED_VARIABLE = YES; 334 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 335 | MTL_ENABLE_DEBUG_INFO = NO; 336 | SDKROOT = iphoneos; 337 | TARGETED_DEVICE_FAMILY = "1,2"; 338 | VALIDATE_PRODUCT = YES; 339 | }; 340 | name = Release; 341 | }; 342 | A371C2891BF0C17200A7D4C7 /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | CODE_SIGN_IDENTITY = "iPhone Developer"; 347 | HEADER_SEARCH_PATHS = ../../; 348 | INFOPLIST_FILE = AppLordDemo/Info.plist; 349 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 350 | PRODUCT_BUNDLE_IDENTIFIER = com.cnbluebox.AppLordDemo; 351 | PRODUCT_NAME = "$(TARGET_NAME)"; 352 | }; 353 | name = Debug; 354 | }; 355 | A371C28A1BF0C17200A7D4C7 /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | CODE_SIGN_IDENTITY = "iPhone Developer"; 360 | HEADER_SEARCH_PATHS = ../../; 361 | INFOPLIST_FILE = AppLordDemo/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 363 | PRODUCT_BUNDLE_IDENTIFIER = com.cnbluebox.AppLordDemo; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | }; 366 | name = Release; 367 | }; 368 | /* End XCBuildConfiguration section */ 369 | 370 | /* Begin XCConfigurationList section */ 371 | A371C2691BF0C17200A7D4C7 /* Build configuration list for PBXProject "AppLordDemo" */ = { 372 | isa = XCConfigurationList; 373 | buildConfigurations = ( 374 | A371C2861BF0C17200A7D4C7 /* Debug */, 375 | A371C2871BF0C17200A7D4C7 /* Release */, 376 | ); 377 | defaultConfigurationIsVisible = 0; 378 | defaultConfigurationName = Release; 379 | }; 380 | A371C2881BF0C17200A7D4C7 /* Build configuration list for PBXNativeTarget "AppLordDemo" */ = { 381 | isa = XCConfigurationList; 382 | buildConfigurations = ( 383 | A371C2891BF0C17200A7D4C7 /* Debug */, 384 | A371C28A1BF0C17200A7D4C7 /* Release */, 385 | ); 386 | defaultConfigurationIsVisible = 0; 387 | defaultConfigurationName = Release; 388 | }; 389 | /* End XCConfigurationList section */ 390 | }; 391 | rootObject = A371C2661BF0C17200A7D4C7 /* Project object */; 392 | } 393 | --------------------------------------------------------------------------------