├── Bifrost.podspec
├── Bifrost
├── Bifrost.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Bifrost.xcscheme
└── Lib
│ ├── Bifrost+Router.h
│ ├── Bifrost+Router.m
│ ├── Bifrost.h
│ ├── Bifrost.m
│ ├── BifrostHeader.h
│ └── BifrostProtocol.h
├── Demo
├── App
│ ├── App.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── BifrostDemo.xcscheme
│ │ └── xcuserdata
│ │ │ └── yangke.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── App
│ │ ├── AppDelegate
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.storyboard
│ │ └── main.m
│ │ ├── Definition
│ │ └── Info.plist
│ │ └── Resource
│ │ └── Asset.xcassets
│ │ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-120.png
│ │ ├── Icon-121.png
│ │ ├── Icon-180.png
│ │ ├── Icon-40.png
│ │ ├── Icon-58.png
│ │ ├── Icon-60.png
│ │ ├── Icon-80.png
│ │ ├── Icon-87.png
│ │ └── bifrost.png
│ │ ├── Contents.json
│ │ └── logo.imageset
│ │ ├── Contents.json
│ │ └── Icon-512.png
├── BifrostDemo.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Modules
│ ├── Common
│ │ ├── Common.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcuserdata
│ │ │ │ └── yangke.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ ├── Common
│ │ │ ├── Definition
│ │ │ │ ├── Info.plist
│ │ │ │ └── YZWeakDefine.h
│ │ │ ├── Kits
│ │ │ │ ├── ToolKits
│ │ │ │ │ ├── Utils.h
│ │ │ │ │ └── Utils.m
│ │ │ │ └── UIKits
│ │ │ │ │ └── UIKits.txt
│ │ │ └── Service
│ │ │ │ ├── BaseService.h
│ │ │ │ └── BaseService.m
│ │ ├── CommonBundle
│ │ │ └── Info.plist
│ │ └── image.xcassets
│ │ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Goods
│ │ ├── Goods.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ └── contents.xcworkspacedata
│ │ │ └── xcuserdata
│ │ │ │ └── yangke.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ ├── Goods
│ │ │ ├── Common
│ │ │ │ ├── GoodsModel.h
│ │ │ │ └── GoodsModel.m
│ │ │ ├── Feature
│ │ │ │ ├── GoodsDetail
│ │ │ │ │ ├── GoodsDetailsViewController.h
│ │ │ │ │ └── GoodsDetailsViewController.m
│ │ │ │ ├── GoodsList
│ │ │ │ │ └── Controller
│ │ │ │ │ │ ├── GoodsListViewController.h
│ │ │ │ │ │ └── GoodsListViewController.m
│ │ │ │ └── GoodsManager
│ │ │ │ │ ├── GoodsManager.h
│ │ │ │ │ └── GoodsManager.m
│ │ │ └── Module
│ │ │ │ ├── GoodsBundle.h
│ │ │ │ ├── GoodsBundle.m
│ │ │ │ ├── GoodsModule.h
│ │ │ │ └── GoodsModule.m
│ │ └── GoodsBundle
│ │ │ └── Info.plist
│ ├── Home
│ │ ├── Home.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcuserdata
│ │ │ │ └── yangke.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ ├── Home
│ │ │ ├── Feature
│ │ │ │ └── HomePage
│ │ │ │ │ ├── HomeViewController.h
│ │ │ │ │ ├── HomeViewController.m
│ │ │ │ │ └── home.storyboard
│ │ │ └── Module
│ │ │ │ ├── HomeBundle.h
│ │ │ │ ├── HomeBundle.m
│ │ │ │ ├── HomeModule.h
│ │ │ │ └── HomeModule.m
│ │ └── HomeBundle
│ │ │ └── Info.plist
│ ├── Mediator
│ │ ├── Mediator.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcuserdata
│ │ │ │ └── yangke.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ └── Mediator
│ │ │ ├── ModuleHelper
│ │ │ ├── ModuleBundle.h
│ │ │ ├── ModuleBundle.m
│ │ │ ├── ModuleExceptionHandler.h
│ │ │ └── ModuleExceptionHandler.m
│ │ │ └── ModuleService
│ │ │ ├── GoodsModuleService.h
│ │ │ ├── HomeModuleService.h
│ │ │ ├── LaunchModuleService.h
│ │ │ ├── SaleModuleService.h
│ │ │ └── ShopModuleService.h
│ ├── Sale
│ │ ├── Sale.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcuserdata
│ │ │ │ └── yangke.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ ├── Sale
│ │ │ ├── Common
│ │ │ │ ├── Definition
│ │ │ │ │ └── SaleModule-Definition.h
│ │ │ │ └── Kits
│ │ │ │ │ └── Kits.txt
│ │ │ ├── Feature
│ │ │ │ ├── SaleManager
│ │ │ │ │ ├── SaleManager.h
│ │ │ │ │ └── SaleManager.m
│ │ │ │ └── ShoppingCart
│ │ │ │ │ └── Controller
│ │ │ │ │ ├── ShoppingCartManager.h
│ │ │ │ │ ├── ShoppingCartManager.m
│ │ │ │ │ ├── ShoppingCartViewController.h
│ │ │ │ │ └── ShoppingCartViewController.m
│ │ │ └── Module
│ │ │ │ ├── SaleBundle.h
│ │ │ │ ├── SaleBundle.m
│ │ │ │ ├── SaleModule.h
│ │ │ │ └── SaleModule.m
│ │ └── SaleBundle
│ │ │ ├── Info.plist
│ │ │ └── Resource
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ └── shopping_cart.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── shopping_cart-1.png
│ │ │ │ └── shopping_cart.png
│ │ │ ├── Audio
│ │ │ └── Audio.txt
│ │ │ └── Video
│ │ │ └── Video.txt
│ └── Shop
│ │ ├── Shop.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── yangke.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ ├── Shop
│ │ ├── Feature
│ │ │ ├── ShopDetail
│ │ │ │ ├── ShopDetailViewController.h
│ │ │ │ └── ShopDetailViewController.m
│ │ │ └── ShopManager
│ │ │ │ ├── ShopManager.h
│ │ │ │ └── ShopManager.m
│ │ └── Module
│ │ │ ├── ShopBundle.h
│ │ │ ├── ShopBundle.m
│ │ │ ├── ShopModule.h
│ │ │ └── ShopModule.m
│ │ └── ShopBundle
│ │ ├── Info.plist
│ │ └── Resource
│ │ └── image.xcassets
│ │ ├── Contents.json
│ │ └── shop_logo.imageset
│ │ ├── Contents.json
│ │ ├── icon_store@2x.png
│ │ └── icon_store@3x.png
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Headers
│ ├── Private
│ │ ├── Bifrost
│ │ │ ├── Bifrost+Router.h
│ │ │ ├── Bifrost.h
│ │ │ ├── BifrostHeader.h
│ │ │ └── BifrostProtocol.h
│ │ ├── SigmaTableViewModel
│ │ │ ├── YZSTableViewCellModel.h
│ │ │ ├── YZSTableViewModel.h
│ │ │ └── YZSTableViewSectionModel.h
│ │ └── YYModel
│ │ │ ├── NSObject+YYModel.h
│ │ │ ├── YYClassInfo.h
│ │ │ └── YYModel.h
│ └── Public
│ │ ├── Bifrost
│ │ ├── Bifrost+Router.h
│ │ ├── Bifrost.h
│ │ ├── BifrostHeader.h
│ │ └── BifrostProtocol.h
│ │ ├── SigmaTableViewModel
│ │ ├── YZSTableViewCellModel.h
│ │ ├── YZSTableViewModel.h
│ │ └── YZSTableViewSectionModel.h
│ │ └── YYModel
│ │ ├── NSObject+YYModel.h
│ │ ├── YYClassInfo.h
│ │ └── YYModel.h
│ ├── Local Podspecs
│ └── Bifrost.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── yangke.xcuserdatad
│ │ └── xcschemes
│ │ ├── Bifrost.xcscheme
│ │ ├── Pods-BifrostDemo-Common.xcscheme
│ │ ├── Pods-BifrostDemo-Mediator.xcscheme
│ │ ├── Pods-BifrostDemo.xcscheme
│ │ ├── SigmaTableViewModel.xcscheme
│ │ ├── YYModel.xcscheme
│ │ └── xcschememanagement.plist
│ ├── SigmaTableViewModel
│ ├── LICENSE
│ ├── Lib
│ │ ├── YZSTableViewCellModel.h
│ │ ├── YZSTableViewCellModel.m
│ │ ├── YZSTableViewModel.h
│ │ ├── YZSTableViewModel.m
│ │ ├── YZSTableViewSectionModel.h
│ │ └── YZSTableViewSectionModel.m
│ └── README.md
│ ├── Target Support Files
│ ├── Bifrost
│ │ ├── Bifrost-dummy.m
│ │ ├── Bifrost-prefix.pch
│ │ └── Bifrost.xcconfig
│ ├── Pods-BifrostDemo-Common
│ │ ├── Pods-BifrostDemo-Common-acknowledgements.markdown
│ │ ├── Pods-BifrostDemo-Common-acknowledgements.plist
│ │ ├── Pods-BifrostDemo-Common-dummy.m
│ │ ├── Pods-BifrostDemo-Common-resources.sh
│ │ ├── Pods-BifrostDemo-Common.debug.xcconfig
│ │ └── Pods-BifrostDemo-Common.release.xcconfig
│ ├── Pods-BifrostDemo-Mediator
│ │ ├── Pods-BifrostDemo-Mediator-acknowledgements.markdown
│ │ ├── Pods-BifrostDemo-Mediator-acknowledgements.plist
│ │ ├── Pods-BifrostDemo-Mediator-dummy.m
│ │ ├── Pods-BifrostDemo-Mediator-resources.sh
│ │ ├── Pods-BifrostDemo-Mediator.debug.xcconfig
│ │ └── Pods-BifrostDemo-Mediator.release.xcconfig
│ ├── Pods-BifrostDemo
│ │ ├── Pods-BifrostDemo-acknowledgements.markdown
│ │ ├── Pods-BifrostDemo-acknowledgements.plist
│ │ ├── Pods-BifrostDemo-dummy.m
│ │ ├── Pods-BifrostDemo-frameworks.sh
│ │ ├── Pods-BifrostDemo-resources.sh
│ │ ├── Pods-BifrostDemo.debug.xcconfig
│ │ └── Pods-BifrostDemo.release.xcconfig
│ ├── SigmaTableViewModel
│ │ ├── SigmaTableViewModel-dummy.m
│ │ ├── SigmaTableViewModel-prefix.pch
│ │ └── SigmaTableViewModel.xcconfig
│ └── YYModel
│ │ ├── YYModel-dummy.m
│ │ ├── YYModel-prefix.pch
│ │ └── YYModel.xcconfig
│ └── YYModel
│ ├── LICENSE
│ ├── README.md
│ └── YYModel
│ ├── NSObject+YYModel.h
│ ├── NSObject+YYModel.m
│ ├── YYClassInfo.h
│ ├── YYClassInfo.m
│ └── YYModel.h
├── LICENSE
├── README.md
├── Resource
├── Bifrost.jpg
├── arch-with-bma.png
├── arch-without-bma.png
├── demo-arch.png
└── targets.png
└── Script
├── TemplateModule
├── Template.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ │ └── yangke.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── Template
│ ├── Common
│ │ ├── Definition
│ │ │ └── TemplateModule-Definition.h
│ │ └── Kits
│ │ │ └── Kits.txt
│ ├── Feature
│ │ └── SampleFeature
│ │ │ ├── Controller
│ │ │ └── Controller.txt
│ │ │ ├── Model
│ │ │ └── Model.txt
│ │ │ ├── Service
│ │ │ └── Service.txt
│ │ │ └── View
│ │ │ └── View.txt
│ └── Module
│ │ ├── TemplateBundle.h
│ │ ├── TemplateBundle.m
│ │ ├── TemplateModule.h
│ │ └── TemplateModule.m
└── TemplateBundle
│ ├── Info.plist
│ └── Resource
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Audio
│ └── Audio.txt
│ └── Video
│ └── Video.txt
├── createModule.sh
└── module_check.swift
/Bifrost.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "Bifrost"
3 | s.version = "1.0.0"
4 | s.summary = "Bifrost"
5 | s.description = <<-DESC
6 | A delightful library for app business modular architecture.
7 | DESC
8 | s.homepage = "https://github.com/youzan/Bifrost/wikis/home"
9 | s.license = 'MIT'
10 | s.author = { "JackieYang" => "yangke@youzan.com" }
11 | s.source = { :git => "https://github.com/youzan/Bifrost.git", :tag => s.version.to_s }
12 | s.source_files = 'Bifrost/Lib/*.{h,m}'
13 | s.framework = 'UIKit'
14 | s.requires_arc = true
15 | s.ios.deployment_target = "7.0"
16 | end
17 |
--------------------------------------------------------------------------------
/Bifrost/Bifrost.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Bifrost/Bifrost.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Bifrost/Bifrost.xcodeproj/xcshareddata/xcschemes/Bifrost.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Bifrost/Lib/Bifrost+Router.h:
--------------------------------------------------------------------------------
1 | //
2 | // Bifrost+Router.h
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/9/15.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "Bifrost.h"
10 |
11 | #define BFComplete(Params, Result) [Bifrost completeWithParameters:Params result:Result]
12 |
13 | // default keys in the parameters of BifrostRouteHandler
14 | extern NSString * _Nonnull const kBifrostRouteURL; //the key for the raw url
15 | extern NSString * _Nonnull const kBifrostRouteCompletion; //the key for the completion block.
16 |
17 | /**
18 | The handler for a binded url
19 |
20 | @param parameters containers above 2 keys and parameters from the query string and complexParams
21 | @return the obj returned by the handler
22 | */
23 | typedef _Nullable id (^BifrostRouteHandler)( NSDictionary * _Nullable parameters);
24 |
25 | /**
26 | The completion block to be invoked at the end of the router handler block
27 |
28 | @param result completion result. defaultly it is the returned object of the BifrostRouteHandler.
29 | */
30 | typedef void (^BifrostRouteCompletion)(_Nullable id result);
31 |
32 | @interface Bifrost (Router)
33 |
34 | /**
35 | The method to bind a URL to handler
36 |
37 | @param urlStr The URL string. Only scheme, host and api path will be used here.
38 | Its query string will be ignore here.
39 | @param handler the handler block.
40 | The BifrostRouteCompletion should be invoked at the end of the block
41 | */
42 | + (void)bindURL:(nonnull NSString *)urlStr toHandler:(nonnull BifrostRouteHandler)handler;
43 |
44 | /**
45 | The method to unbind a URL
46 |
47 | @param urlStr The URL string. Only scheme, host and api path will be used here.
48 | Its query string will be ignore here.
49 | */
50 | + (void)unbindURL:(nonnull NSString *)urlStr;
51 |
52 | /**
53 | Method to unbind all URLs
54 | */
55 | + (void)unbindAllURLs;
56 |
57 | /**
58 | The method to check whether a url can be handled
59 |
60 | @param urlStr The URL string. Only scheme, host and api path will be used here.
61 | Its query string will be ignore here.
62 | */
63 | + (BOOL)canHandleURL:(nonnull NSString *)urlStr;
64 |
65 | /**
66 | Method to handle the URL
67 |
68 | @param urlStr URL string
69 | @return the returned object of the url's BifrostRouteHandler
70 | */
71 | + (nullable id)handleURL:(nonnull NSString *)urlStr;
72 |
73 | /**
74 | Method to handle the url with completion block
75 |
76 | @param urlStr URL string
77 | @param completion The completion block
78 | @return the returned object of the url's BifrostRouteHandler
79 | */
80 | + (nullable id)handleURL:(nonnull NSString *)urlStr
81 | completion:(nullable BifrostRouteCompletion)completion;
82 |
83 | /**
84 | The method to handle URL with complex parameters and completion block
85 |
86 | @param urlStr URL string
87 | @param complexParams complex parameters that can't be put in the url query strings
88 | @param completion The completion block
89 | @return the returned object of the url's BifrostRouteHandler
90 | */
91 | + (nullable id)handleURL:(nonnull NSString *)urlStr
92 | complexParams:(nullable NSDictionary*)complexParams
93 | completion:(nullable BifrostRouteCompletion)completion;
94 |
95 | /**
96 | Invoke the completion block in the parameters of BifrostRouteHandler.
97 | Recommend to use macro BFComplete for convenient.
98 |
99 | @param params parameters of BifrostRouteHandler
100 | @param result the result for the BifrostRouteCompletion
101 | */
102 | + (void)completeWithParameters:(nullable NSDictionary*)params result:(_Nullable id)result;
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/Bifrost/Lib/Bifrost+Router.m:
--------------------------------------------------------------------------------
1 | //
2 | // Bifrost+Router.m
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/9/15.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "Bifrost+Router.h"
10 |
11 | #define BFLog(msg) NSLog(@"[Bifrost] %@", (msg))
12 | #define BFKey(URL) [Bifrost keyForURL:URL]
13 |
14 | NSString *const kBifrostRouteURL = @"kBifrostRouteURL";
15 | NSString *const kBifrostRouteCompletion = @"kBifrostRouteCompletion";
16 |
17 | @implementation Bifrost (Router)
18 |
19 | + (nonnull NSString*)keyForURL:(nonnull NSString*)urlStr {
20 | NSURL *URL = [NSURL URLWithString:urlStr];
21 | NSString *key = [NSString stringWithFormat:@"%@%@", URL.host, URL.path];
22 | return key;
23 | }
24 |
25 | + (nullable NSDictionary*)parametersInURL:(nonnull NSString*)urlStr {
26 | NSURL *URL = [NSURL URLWithString:urlStr];
27 | NSMutableDictionary *params = nil;
28 | NSString *query = URL.query;
29 | if(query.length > 0) {
30 | params = [NSMutableDictionary dictionary];
31 | NSArray *list = [query componentsSeparatedByString:@"&"];
32 | for (NSString *param in list) {
33 | NSArray *elts = [param componentsSeparatedByString:@"="];
34 | if([elts count] < 2) continue;
35 | NSString *decodedStr = [[elts lastObject] stringByRemovingPercentEncoding];
36 | [params setObject:decodedStr forKey:[elts firstObject]];
37 | }
38 | }
39 | return params;
40 | }
41 |
42 | + (NSMutableDictionary*)routes {
43 | @synchronized (self) {
44 | static NSMutableDictionary *_routes = nil;
45 | if (!_routes) {
46 | _routes = [NSMutableDictionary dictionary];
47 | }
48 | return _routes;
49 | }
50 | }
51 |
52 | + (void)bindURL:(nonnull NSString *)urlStr toHandler:(nonnull BifrostRouteHandler)handler {
53 | [self.routes setObject:handler forKey:BFKey(urlStr)];
54 | }
55 |
56 | + (void)unbindURL:(nonnull NSString *)urlStr {
57 | [self.routes removeObjectForKey:BFKey(urlStr)];
58 | }
59 |
60 | + (void)unbindAllURLs {
61 | [self.routes removeAllObjects];
62 | }
63 |
64 | + (nullable BifrostRouteHandler)handlerForURL:(nonnull NSString *)urlStr {
65 | return [self.routes objectForKey:BFKey(urlStr)];
66 | }
67 |
68 | + (BOOL)canHandleURL:(nonnull NSString *)urlStr {
69 | if (urlStr.length == 0) {
70 | return NO;
71 | }
72 | if ([self handlerForURL:urlStr]) {
73 | return YES;
74 | } else {
75 | return NO;
76 | }
77 | }
78 |
79 | + (nullable id)handleURL:(nonnull NSString *)urlStr {
80 | return [self handleURL:urlStr complexParams:nil completion:nil];
81 | }
82 |
83 | + (nullable id)handleURL:(nonnull NSString *)urlStr
84 | completion:(nullable BifrostRouteCompletion)completion {
85 | return [self handleURL:urlStr complexParams:nil completion:completion];
86 | }
87 |
88 | + (nullable id)handleURL:(nonnull NSString *)urlStr
89 | complexParams:(nullable NSDictionary*)complexParams
90 | completion:(nullable BifrostRouteCompletion)completion {
91 | id obj = nil;
92 | @try {
93 | BifrostRouteHandler handler = [self handlerForURL:urlStr];
94 | NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:complexParams];
95 | [params addEntriesFromDictionary:[self.class parametersInURL:urlStr]];
96 | [params setObject:urlStr forKey:kBifrostRouteURL];
97 | if (completion) {
98 | [params setObject:completion forKey:kBifrostRouteCompletion];
99 | }
100 | if (!handler) {
101 | NSString *reason = [NSString stringWithFormat:@"Cannot find handler for route url %@", urlStr];
102 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
103 | [userInfo setValue:@(BFExceptionUrlHandlerNotFound) forKey:kBifrostExceptionCode];
104 | [userInfo setValue:urlStr forKey:kBifrostExceptionURLStr];
105 | [userInfo setValue:params forKey:kBifrostExceptionURLParams];
106 | NSException *exception = [[NSException alloc] initWithName:BifrostExceptionName
107 | reason:reason
108 | userInfo:userInfo];
109 | BifrostExceptionHandler handler = [self getExceptionHandler];
110 | if (handler) {
111 | obj = handler(exception);
112 | }
113 | BFLog(reason);
114 | } else {
115 | obj = handler(params);
116 | }
117 | } @catch (NSException *exception) {
118 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:exception.userInfo];
119 | [userInfo setValue:@(BFExceptionDefaultCode) forKey:kBifrostExceptionCode];
120 | [userInfo setValue:urlStr forKey:kBifrostExceptionURLStr];
121 | [userInfo setValue:complexParams forKey:kBifrostExceptionURLParams];
122 | NSException *ex = [[NSException alloc] initWithName:exception.name
123 | reason:exception.reason
124 | userInfo:userInfo];
125 | BifrostExceptionHandler handler = [self getExceptionHandler];
126 | if (handler) {
127 | obj = handler(ex);
128 | }
129 | BFLog(exception.reason);
130 | } @finally {
131 | return obj;
132 | }
133 | }
134 |
135 | + (void)completeWithParameters:(nullable NSDictionary*)params result:(_Nullable id)result {
136 | BifrostRouteCompletion completion = params[kBifrostRouteCompletion];
137 | if (completion) {
138 | completion(result);
139 | }
140 | }
141 |
142 | @end
143 |
--------------------------------------------------------------------------------
/Bifrost/Lib/Bifrost.h:
--------------------------------------------------------------------------------
1 | //
2 | // Bifrost.h
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/9/15.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BifrostProtocol.h"
11 |
12 | #define BFRegister(service_protocol) [Bifrost registerService:@protocol(service_protocol) withModule:self.class];
13 | #define BFModule(service_protocol) ((id)[Bifrost moduleByService:@protocol(service_protocol)])
14 | #define BFStr(fmt, ...) [NSString stringWithFormat:fmt, ##__VA_ARGS__]
15 |
16 | typedef NS_ENUM(NSInteger, BifrostExceptionCode)
17 | {
18 | BFExceptionDefaultCode = -20001,
19 | BFExceptionUrlHandlerNotFound = -20002,
20 | BFExceptionModuleNotFoundException = -20003,
21 | BFExceptionAPINotFoundException = -20004,
22 | BFExceptionFailedToRegisterModule = -20005,
23 | BFExceptionFailedToSetupModule = -20006,
24 | BFExceptionFailedToFindModuleByService = -20007,
25 |
26 | };
27 | // BifrostException exception name
28 | extern NSExceptionName _Nonnull BifrostExceptionName;
29 | // Bifrost Exception userInfo keys
30 | extern NSString *const _Nonnull kBifrostExceptionCode;
31 | extern NSString *const _Nonnull kBifrostExceptionURLStr;
32 | extern NSString *const _Nonnull kBifrostExceptionURLParams;
33 | extern NSString *const _Nonnull kBifrostExceptionServiceProtocolStr;
34 | extern NSString *const _Nonnull kBifrostExceptionModuleClassStr;
35 | extern NSString *const _Nonnull kBifrostExceptionAPIStr;
36 | extern NSString *const _Nonnull kBifrostExceptionAPIArguments;
37 |
38 | @interface NSException (Bifrost)
39 | - (BifrostExceptionCode)bf_exceptionCode;
40 | @end
41 |
42 | /**
43 | The handler for exceptions, like url not found, api not support, ...
44 |
45 | @param exception exceptions when handling route URLs or module APIs
46 | @return The substitute return object
47 | */
48 | typedef _Nullable id (^BifrostExceptionHandler)(NSException * _Nonnull exception);
49 |
50 | @interface Bifrost : NSObject
51 |
52 | /**
53 | Method to set exception handler
54 |
55 | @param handler the handler block
56 | */
57 | + (void)setExceptionHandler:(BifrostExceptionHandler _Nullable )handler;
58 |
59 | + (BifrostExceptionHandler _Nullable )getExceptionHandler;
60 |
61 | /**
62 | Method to register the module srevice with module class.
63 | Each Module do the registeration before app launch event, like in the +load method.
64 |
65 | @param serviceProtocol the protocol for the module's service
66 | @param moduleClass The class of the module
67 | */
68 | + (void)registerService:(Protocol*_Nonnull)serviceProtocol
69 | withModule:(Class _Nonnull)moduleClass;
70 |
71 | /**
72 | Method to unregister service
73 |
74 | @param serviceProtocol the protocol for the module's service
75 | */
76 | + (void)unregisterService:(Protocol*_Nonnull)serviceProtocol;
77 |
78 | /**
79 | Method to setup all registered modules.
80 | It's recommended to invoke this method in AppDelegate's willFinishLaunchingWithOptions method.
81 | */
82 | + (void)setupAllModules;
83 |
84 | /**
85 | Get module instance by service protocol.
86 | It's recomended to use macro BFModule for convenient
87 |
88 | @param serviceProtocol the service protocol used to register the module
89 | @return module instance
90 | */
91 | + (id _Nullable)moduleByService:(Protocol*_Nonnull)serviceProtocol;
92 |
93 | //+ (NSArray*_Nonnull)allRegisteredServices;
94 | //
95 |
96 | /**
97 | Method to get all registered module classes, sorted by module priority.
98 |
99 | @return module class array, not module instances
100 | */
101 | + (NSArray>*_Nonnull)allRegisteredModules;
102 |
103 | /**
104 | Method to enumarate all modules for methods in UIApplicationDelegate.
105 |
106 | @param selector app delegate selector
107 | @param arguments argument array
108 | @return the return value of the method implementation in those modules
109 | */
110 | + (BOOL)checkAllModulesWithSelector:(nonnull SEL)selector
111 | arguments:(nullable NSArray*)arguments;
112 |
113 | @end
114 |
--------------------------------------------------------------------------------
/Bifrost/Lib/BifrostHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // BifrostHeader.h
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/9/15.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef BifrostHeader_h
10 | #define BifrostHeader_h
11 |
12 | #import "Bifrost.h"
13 | #import "Bifrost+Router.h"
14 | #import "BifrostProtocol.h"
15 |
16 | #endif /* BifrostHeader_h */
17 |
--------------------------------------------------------------------------------
/Bifrost/Lib/BifrostProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // BifrostProtocol.h
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/9/15.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef BifrostModuleProtocol_h
10 | #define BifrostModuleProtocol_h
11 |
12 | #import
13 |
14 | #define BifrostModuleDefaultPriority 100
15 |
16 | @protocol BifrostModuleProtocol
17 |
18 | @required
19 | /**
20 | Each module should be a singleton class
21 |
22 | @return module instance
23 | */
24 | + (instancetype)sharedInstance;
25 |
26 | /**
27 | module setup method, will be invoked by module manager when app is launched or module is loaded.
28 | It's invoked in main thread synchronourly.
29 | It's strong recommended to run its content in background thread asynchronously to save launch time.
30 | */
31 | - (void)setup;
32 |
33 | @optional
34 |
35 | /**
36 | The priority of the module to be setup. 0 is the lowest priority;
37 | If not provided, the default priority is BifrostModuleDefaultPriority;
38 |
39 | @return the priority
40 | */
41 | + (NSUInteger)priority;
42 |
43 |
44 | /**
45 | Whether to setup the module synchronously in main thread.
46 | If it's not implemeted, default value is NO, module will be sutup asyhchronously in backgorud thread.
47 |
48 | @return whether synchronously
49 | */
50 | + (BOOL)setupModuleSynchronously;
51 |
52 | @end
53 |
54 | //@protocol BifrostServcieProtocol
55 | //
56 | //@end
57 |
58 | #endif /* BifrostModuleProtocol_h */
59 |
--------------------------------------------------------------------------------
/Demo/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/App/App.xcodeproj/xcshareddata/xcschemes/BifrostDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
69 |
70 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Demo/App/App.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | BifrostDemo.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 6
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 87E163DF1F6CBDD900EAB464
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Demo/App/App/AppDelegate/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/3/8.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/Demo/App/App/AppDelegate/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Bifrost
4 | //
5 | // Created by yangke on 2017/3/8.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "BifrostHeader.h"
11 |
12 | #define Safe(obj) obj ? obj : [NSNull null]
13 |
14 | @interface AppDelegate ()
15 |
16 | @end
17 |
18 | @implementation AppDelegate
19 |
20 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
21 | [Bifrost setupAllModules];
22 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(launchOptions)]];
23 | return YES;
24 | }
25 |
26 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
27 |
28 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(launchOptions)]];
29 | return YES;
30 | }
31 |
32 | - (void)applicationWillEnterForeground:(UIApplication *)application {
33 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application)]];
34 | }
35 |
36 | - (void)applicationDidEnterBackground:(UIApplication *)application{
37 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application)]];
38 | }
39 |
40 | - (void)applicationDidBecomeActive:(UIApplication *)application {
41 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application)]];
42 | }
43 |
44 | - (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options {
45 | return [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application),Safe(url),Safe(options)]];
46 | }
47 |
48 | #pragma mark - delegate
49 |
50 | #pragma mark - Push Remote Notification
51 |
52 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
53 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(userInfo), completionHandler]];
54 | }
55 |
56 | - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
57 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(notificationSettings)]];
58 | }
59 |
60 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
61 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application),Safe(userInfo)]];
62 | }
63 |
64 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
65 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(deviceToken)]];
66 | }
67 |
68 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
69 | [Bifrost checkAllModulesWithSelector:_cmd arguments:@[Safe(application), Safe(error)]];
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/Demo/App/App/AppDelegate/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 |
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 |
61 |
--------------------------------------------------------------------------------
/Demo/App/App/AppDelegate/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // App
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. 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/App/App/Definition/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 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationPortraitUpsideDown
35 |
36 | UISupportedInterfaceOrientations~ipad
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationPortraitUpsideDown
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "idiom" : "ipad",
53 | "size" : "20x20",
54 | "scale" : "1x"
55 | },
56 | {
57 | "idiom" : "ipad",
58 | "size" : "20x20",
59 | "scale" : "2x"
60 | },
61 | {
62 | "idiom" : "ipad",
63 | "size" : "29x29",
64 | "scale" : "1x"
65 | },
66 | {
67 | "idiom" : "ipad",
68 | "size" : "29x29",
69 | "scale" : "2x"
70 | },
71 | {
72 | "idiom" : "ipad",
73 | "size" : "40x40",
74 | "scale" : "1x"
75 | },
76 | {
77 | "idiom" : "ipad",
78 | "size" : "40x40",
79 | "scale" : "2x"
80 | },
81 | {
82 | "idiom" : "ipad",
83 | "size" : "76x76",
84 | "scale" : "1x"
85 | },
86 | {
87 | "idiom" : "ipad",
88 | "size" : "76x76",
89 | "scale" : "2x"
90 | },
91 | {
92 | "idiom" : "ipad",
93 | "size" : "83.5x83.5",
94 | "scale" : "2x"
95 | },
96 | {
97 | "size" : "1024x1024",
98 | "idiom" : "ios-marketing",
99 | "filename" : "bifrost.png",
100 | "scale" : "1x"
101 | }
102 | ],
103 | "info" : {
104 | "version" : 1,
105 | "author" : "xcode"
106 | }
107 | }
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/bifrost.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/AppIcon.appiconset/bifrost.png
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Icon-512.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Demo/App/App/Resource/Asset.xcassets/logo.imageset/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/App/App/Resource/Asset.xcassets/logo.imageset/Icon-512.png
--------------------------------------------------------------------------------
/Demo/BifrostDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Demo/BifrostDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Common.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 15
11 |
12 | CommonBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 16
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Definition/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 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Definition/YZWeakDefine.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZWeakDefine.h
3 | // Koudaitong
4 | //
5 | // Created by 邱灿清 on 15/12/2.
6 | // Copyright © 2015年 qima. All rights reserved.
7 | //
8 |
9 | /** 使用示例
10 | YZWeak(self);
11 | self.block = ^(NSString *test){
12 | YZStrong(self);
13 | self.model = 1;
14 | void (^inBlock)(void) = ^(){
15 | YZStrong(self);
16 | self.model = 3;
17 | };
18 | inBlock();
19 | };
20 |
21 | Demo *model = [[Demo alloc] init];
22 | YZWeak(model);
23 | self.modelBlock = ^(NSString *modelStr){
24 | YZStrong(model);
25 | YZStrong(self);
26 | [model modelWithViewController:self];
27 | };
28 |
29 | self.block(@"sds");
30 | */
31 |
32 |
33 | #ifndef YZWeakDefine_h
34 | #define YZWeakDefine_h
35 |
36 | #ifndef weakifyObject
37 | #if __has_feature(objc_arc)
38 | #define weakifyObject(object) \
39 | ext_keywordify \
40 | __weak __typeof__(object) weak##_##object = object;
41 | #else
42 | #define weakifyObject(object) \
43 | ext_keywordify \
44 | __block __typeof__(object) block##_##object = object;
45 | #endif
46 | #endif
47 |
48 | #ifndef strongifyObject
49 | #if __has_feature(objc_arc)
50 | #define strongifyObject(object) \
51 | ext_keywordify \
52 | __strong __typeof__(object) object = weak##_##object;
53 | #else
54 | #define strongifyObject(object) \
55 | ext_keywordify \
56 | __strong __typeof__(object) object = block##_##object;
57 | #endif
58 | #endif
59 |
60 | #undef YZWeak
61 | #define YZWeak(...) @weakifyObject(__VA_ARGS__)
62 |
63 | #undef YZStrong
64 | #define YZStrong(...) @strongifyObject(__VA_ARGS__)
65 |
66 | #if DEBUG
67 | #define ext_keywordify autoreleasepool {}
68 | #else
69 | #define ext_keywordify try {} @catch (...) {}
70 | #endif
71 |
72 | #endif
73 |
74 | #ifdef DEBUG
75 | #define NSLog(fmt, ...) NSLog((@"[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
76 | #else
77 | #define NSLog(...)
78 | #endif
79 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Kits/ToolKits/Utils.h:
--------------------------------------------------------------------------------
1 | //
2 | // Utils.h
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Utils : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Kits/ToolKits/Utils.m:
--------------------------------------------------------------------------------
1 | //
2 | // Utils.m
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "Utils.h"
10 |
11 | @implementation Utils
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Kits/UIKits/UIKits.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Common/Common/Kits/UIKits/UIKits.txt
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Service/BaseService.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseService.h
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | /**
13 | Base service class. All other services should be it's subclasses.
14 | */
15 | @interface BaseService : NSObject
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/Common/Service/BaseService.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseService.m
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "BaseService.h"
10 |
11 | @implementation BaseService
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/CommonBundle/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2017年 jackie@youzan. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Demo/Modules/Common/image.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "minimum-system-version" : "7.0",
7 | "scale" : "2x"
8 | },
9 | {
10 | "orientation" : "portrait",
11 | "idiom" : "iphone",
12 | "minimum-system-version" : "7.0",
13 | "subtype" : "retina4",
14 | "scale" : "2x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Goods.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 13
11 |
12 | GoodsBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 14
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Common/GoodsModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsModel.h
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GoodsModuleService.h"
11 |
12 | @interface GoodsModel : NSObject
13 |
14 | @property(nonatomic, strong) NSString *goodsId;
15 | @property(nonatomic, strong) NSString *name;
16 | @property(nonatomic, assign) CGFloat price;
17 | @property(nonatomic, assign) NSInteger inventory;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Common/GoodsModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsModel.m
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsModel.h"
10 |
11 | @implementation GoodsModel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsDetail/GoodsDetailsViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsDetailsViewController.h
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface GoodsDetailsViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsDetail/GoodsDetailsViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsDetailsViewController.m
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsDetailsViewController.h"
10 | #import "GoodsModuleService.h"
11 | #import "SaleModuleService.h"
12 | #import "GoodsModule.h"
13 | #import "GoodsModel.h"
14 |
15 | @interface GoodsDetailsViewController ()
16 |
17 | @property (nonatomic, strong) NSString *goodsId;
18 |
19 | @end
20 |
21 | @implementation GoodsDetailsViewController
22 |
23 | + (void)load {
24 | [Bifrost bindURL:kRouteGoodsDetail toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
25 | GoodsDetailsViewController *vc = [[self alloc] init];
26 | vc.goodsId = parameters[kRouteGoodsDetailParamId];
27 | return vc;
28 | }];
29 | for (NSInteger i=0; i<10000; i++) {
30 | NSString *url = BFStr(@"//test/test_%ld", i);
31 | [Bifrost bindURL:url toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
32 | GoodsDetailsViewController *vc = [[self alloc] init];
33 | vc.goodsId = parameters[kRouteGoodsDetailParamId];
34 | return vc;
35 | }];
36 | }
37 | }
38 |
39 | - (void)viewDidLoad {
40 | [super viewDidLoad];
41 | self.title = @"Goods Detail";
42 | self.navigationItem.backBarButtonItem.title = @"";
43 | GoodsModel *goods = [[GoodsModule sharedInstance] goodsById:self.goodsId];
44 | if (goods) {
45 | self.title = goods.name;
46 | }
47 | self.view.backgroundColor = [UIColor whiteColor];
48 | //buy button
49 | UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
50 | [button setTitle:@"加入购物车" forState:UIControlStateNormal];
51 | button.frame = CGRectMake(100, 400, self.view.frame.size.width - 200, 100);
52 | [button addTarget:self
53 | action:@selector(addToShoppingCart)
54 | forControlEvents:UIControlEventTouchUpInside];
55 | [self.view addSubview:button];
56 | }
57 |
58 | - (void)viewWillAppear:(BOOL)animated {
59 | [super viewWillAppear:animated];
60 | [self updateShoppingCartBarButtonItem];
61 | }
62 |
63 | - (void)updateShoppingCartBarButtonItem {
64 | NSString *title = BFStr(@"购物车(%lu)", BFModule(SaleModuleService).shoppinCartGoodsNum);
65 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:nil action:nil];
66 | [item setTarget:self];
67 | [item setAction:@selector(goToShoppingCart)];
68 | self.navigationItem.rightBarButtonItem = item;
69 | }
70 |
71 | - (void)addToShoppingCart {
72 | [BFModule(SaleModuleService) addShoppingCartGoods:self.goodsId];
73 | [self updateShoppingCartBarButtonItem];
74 | }
75 |
76 | - (void)goToShoppingCart {
77 | UIViewController *vc = [Bifrost handleURL:kRouteSaleShoppingCart];
78 | if (vc) {
79 | [self.navigationController pushViewController:vc animated:YES];
80 | }
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsList/Controller/GoodsListViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsListViewController.h
3 | // Goods
4 | //
5 | // Created by yangke on 2019/3/3.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface GoodsListViewController : UITableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsList/Controller/GoodsListViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsListViewController.m
3 | // Goods
4 | //
5 | // Created by yangke on 2019/3/3.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsListViewController.h"
10 | #import "GoodsModuleService.h"
11 | #import "SaleModuleService.h"
12 |
13 | @interface GoodsListViewController ()
14 | @property (nonatomic, strong) NSArray *goodsList;
15 | @end
16 |
17 | @implementation GoodsListViewController
18 |
19 | + (void)load {
20 | [Bifrost bindURL:kRouteAllGoodsList toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
21 | GoodsListViewController *vc = [[self alloc] initWithStyle:UITableViewStylePlain];
22 | return vc;
23 | }];
24 | }
25 |
26 | - (void)viewDidLoad {
27 | [super viewDidLoad];
28 | self.title = @"All Goods List";
29 | self.navigationItem.backBarButtonItem.title = @"";
30 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
31 | self.goodsList = BFModule(GoodsModuleService).allGoodsList;
32 | [self.tableView reloadData];
33 | }
34 |
35 | - (void)viewWillAppear:(BOOL)animated {
36 | [super viewWillAppear:animated];
37 | [self updateShoppingCartBarButtonItem];
38 | }
39 |
40 | - (void)updateShoppingCartBarButtonItem {
41 | NSString *title = BFStr(@"购物车(%lu)", BFModule(SaleModuleService).shoppinCartGoodsNum);
42 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:nil action:nil];
43 | [item setTarget:self];
44 | [item setAction:@selector(goToShoppingCart)];
45 | self.navigationItem.rightBarButtonItem = item;
46 | }
47 |
48 | - (void)goToShoppingCart {
49 | UIViewController *vc = [Bifrost handleURL:kRouteSaleShoppingCart];
50 | if (vc) {
51 | [self.navigationController pushViewController:vc animated:YES];
52 | }
53 | }
54 |
55 | #pragma mark - Table view data source
56 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
57 | return 1;
58 | }
59 |
60 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
61 | return self.goodsList.count;
62 | }
63 |
64 |
65 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
66 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"
67 | forIndexPath:indexPath];
68 | id goods = self.goodsList[indexPath.row];
69 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
70 | cell.selectionStyle = UITableViewCellSelectionStyleDefault;
71 | NSString *text = BFStr(@"%@ : ¥%.2f", goods.name, goods.price);
72 | cell.textLabel.text = text;
73 | return cell;
74 | }
75 |
76 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
77 | [tableView deselectRowAtIndexPath:indexPath animated:YES];
78 | id goods = self.goodsList[indexPath.row];
79 | NSString *routeURL = BFStr(@"%@?%@=%@", kRouteGoodsDetail, kRouteGoodsDetailParamId, goods.goodsId);
80 | UIViewController *vc = [Bifrost handleURL:routeURL];
81 | if (vc) {
82 | [self.navigationController pushViewController:vc animated:YES];
83 | }
84 | }
85 |
86 | @end
87 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsManager/GoodsManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsManager.h
3 | // Goods
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface GoodsManager : NSObject
14 |
15 | + (instancetype)sharedInstance;
16 | - (void)setup;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Feature/GoodsManager/GoodsManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsManager.m
3 | // Goods
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsManager.h"
10 | #import "HomeModuleService.h"
11 |
12 | @implementation GoodsManager
13 |
14 | + (instancetype)sharedInstance {
15 | static GoodsManager *instance = nil;
16 | static dispatch_once_t onceToken;
17 | dispatch_once(&onceToken, ^{
18 | instance = [[self alloc] init];
19 | });
20 | return instance;
21 | }
22 |
23 | - (void)setup {
24 | //observe Home Page Did Appear event to preload data
25 | [[NSNotificationCenter defaultCenter] addObserver:self
26 | selector:@selector(updateGoodsData)
27 | name:kNotificationHomePageDidAppear
28 | object:nil];
29 | }
30 |
31 | - (void)updateGoodsData {
32 | NSLog(@"Start to update goods data...");
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Module/GoodsBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsBundle.h
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 |
11 | @interface GoodsBundle : ModuleBundle
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Module/GoodsBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsBundle.m
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsBundle.h"
10 |
11 | @implementation GoodsBundle
12 |
13 | + (NSBundle *)bundle{
14 | return [self.class bundleWithName:NSStringFromClass(self.class)];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Module/GoodsModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsModule.h
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GoodsModuleService.h"
11 |
12 | @interface GoodsModule : NSObject
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Demo/Modules/Goods/Goods/Module/GoodsModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsModule.m
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "GoodsModule.h"
10 | #import "GoodsModel.h"
11 | #import "GoodsManager.h"
12 |
13 | @implementation GoodsModule
14 |
15 | + (void)load {
16 | BFRegister(GoodsModuleService);
17 | }
18 |
19 | #pragma mark - BifrostModuleProtocol methods
20 |
21 | + (instancetype)sharedInstance {
22 | static GoodsModule *instance = nil;
23 | static dispatch_once_t onceToken;
24 | dispatch_once(&onceToken, ^{
25 | instance = [[self alloc] init];
26 | });
27 | return instance;
28 | }
29 |
30 | - (void)setup {
31 | [[GoodsManager sharedInstance] setup];
32 | }
33 |
34 | #pragma mark - GoodsModuleService
35 | - (NSInteger)totalInventory {
36 | NSArray *list = [self allGoodsList];
37 | NSInteger count = 0;
38 | for (GoodsModel *goods in list) {
39 | count += goods.inventory;
40 | }
41 | return count;
42 | }
43 |
44 | - (id)goodsById:(NSString*)goodsId {
45 | GoodsModel *goods = [[GoodsModel alloc] init];
46 | goods.goodsId = goodsId;
47 | goods.name = BFStr(@"GoodsName_%@", goodsId);
48 | goods.price = [goodsId integerValue];
49 | goods.inventory = 66;
50 | return goods;
51 | }
52 |
53 | - (nonnull NSArray> *)allGoodsList {
54 | NSMutableArray *list = [NSMutableArray array];
55 | NSInteger count = 20;
56 | for (NSInteger i=1; i> *)popularGoodsList {
69 | NSMutableArray *list = [NSMutableArray array];
70 | NSInteger count = 10;
71 | for (NSInteger i=1; i
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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2017年 jackie@youzan. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Home.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 7
11 |
12 | HomeBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 8
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Feature/HomePage/HomeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // HomeViewController.h
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface HomeViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Feature/HomePage/home.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 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Module/HomeBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // HomeBundle.h
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ModuleBundle.h"
11 |
12 | @interface HomeBundle : ModuleBundle
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Module/HomeBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // HomeBundle.m
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "HomeBundle.h"
10 |
11 | @implementation HomeBundle
12 |
13 | + (NSBundle *)bundle{
14 | return [self.class bundleWithName:NSStringFromClass(self.class)];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Module/HomeModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // HomeModule.h
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BifrostHeader.h"
11 | #import "HomeModuleService.h"
12 |
13 | @interface HomeModule : NSObject
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/Home/Module/HomeModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // HomeModule.m
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "HomeModule.h"
10 | #import "HomeViewController.h"
11 |
12 | @implementation HomeModule
13 |
14 | + (void)load {
15 | BFRegister(HomeModuleService);
16 | }
17 |
18 | #pragma mark - BifrostModuleProtocol
19 | + (instancetype)sharedInstance {
20 | static HomeModule *instance = nil;
21 | static dispatch_once_t onceToken;
22 | dispatch_once(&onceToken, ^{
23 | instance = [[self alloc] init];
24 | });
25 | return instance;
26 | }
27 |
28 | - (void)setup {
29 |
30 | }
31 |
32 | + (NSUInteger)priority {
33 | return BifrostModuleDefaultPriority+100; //higher priority than other modules
34 | }
35 |
36 | + (BOOL)setupModuleSynchronously {
37 | return YES;
38 | }
39 |
40 | #pragma mark - UIApplicationDelegate
41 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
42 | UIWindow *window = application.delegate.window;
43 | UIViewController *homeVC = [Bifrost handleURL:kRouteHomePage];
44 | UINavigationController *rootNavContoller = [[UINavigationController alloc] initWithRootViewController:homeVC];
45 | rootNavContoller.navigationItem.backBarButtonItem.title = @"";
46 | window.rootViewController = rootNavContoller;
47 | [window makeKeyAndVisible];
48 | return YES;
49 | }
50 |
51 | #pragma mark - HomeModuleService
52 |
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/Demo/Modules/Home/HomeBundle/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2017年 jackie@youzan. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Mediator.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 17
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleHelper/ModuleBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleBundle.h
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface ModuleBundle : NSObject
13 |
14 | /*
15 | * 根据bundle的名称获取bundle
16 | */
17 | + (NSBundle *)bundleWithName:(NSString *)bundleName;
18 |
19 | //获取bundle 每次只要重写这个方法就可以在指定的bundle中获取对应资源
20 | + (NSBundle *)bundle;
21 |
22 | //根据xib文件名称获取xib文件
23 | + (__kindof UIView *)viewWithXibFileName:(NSString *)fileName;
24 |
25 | //根据图片名称获取图片
26 | + (UIImage *)imageNamed:(NSString *)imageName;
27 |
28 | //根据sb文件名称获取对应sb文件
29 | + (UIStoryboard *)storyboardWithName:(NSString *)storyboardName;
30 |
31 | //获取nib文件
32 | + (UINib *)nibWithName:(NSString *)nibName;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleHelper/ModuleBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleBundle.m
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 |
11 | @implementation ModuleBundle
12 |
13 | + (NSBundle *)bundleWithName:(NSString *)bundleName {
14 | if(bundleName.length == 0) {
15 | return nil;
16 | }
17 | NSString *path = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle"];
18 | NSAssert([NSBundle bundleWithPath:path], @"not found bundle");
19 | return [NSBundle bundleWithPath:path];
20 | }
21 |
22 | + (NSBundle *)bundle {
23 | // NSAssert([NSBundle mainBundle], @"not found bundle");
24 | return [NSBundle mainBundle];
25 | }
26 |
27 | + (UIView *)viewWithXibFileName:(NSString *)fileName {
28 | NSAssert([self viewWithXibFileName:fileName inBundle:[self.class bundle]], @"not found view");
29 | return [self viewWithXibFileName:fileName inBundle:[self.class bundle]];
30 | }
31 |
32 | + (UIImage *)imageNamed:(NSString *)imageName {
33 | NSAssert([self imageNamed:imageName inBundle:[self.class bundle]], @"not found image");
34 | return [self imageNamed:imageName inBundle:[self.class bundle]];
35 | }
36 |
37 | + (UIStoryboard *)storyboardWithName:(NSString *)storyboardName {
38 | NSAssert([self storyboardWithName:storyboardName inBundle:[self.class bundle]], @"not found storyboard");
39 | return [self storyboardWithName:storyboardName inBundle:[self.class bundle]];
40 | }
41 |
42 | + (UINib *)nibWithName:(NSString *)nibName {
43 | NSAssert([self nibWithNibName:nibName inBundle:[self.class bundle]], @"not found nib");
44 | return [self nibWithNibName:nibName inBundle:[self.class bundle]];
45 | }
46 |
47 | #pragma mark - private
48 | + (UIImage *)imageNamed:(NSString *)imageName inBundle:(NSBundle *)bundle {
49 | if(imageName.length == 0 || !bundle) {
50 | return nil;
51 | }
52 | return [UIImage imageNamed:imageName inBundle:bundle compatibleWithTraitCollection:nil];
53 | }
54 |
55 | + (UIImage *)imageNamed:(NSString *)imageName bundleName:(NSString *)bundleName {
56 | return [self imageNamed:imageName inBundle:[self bundleWithName:bundleName]];
57 | }
58 |
59 | + (UIView *)viewWithXibFileName:(NSString *)fileName inBundle:(NSBundle *)bundle {
60 | if(fileName.length == 0 || !bundle) {
61 | return nil;
62 | }
63 | //如果没有国际化,则直接去相应内容下的文件
64 | UIView *xibView = [[bundle loadNibNamed:fileName owner:nil options:nil] lastObject];
65 | if(!xibView) {
66 | //文件国际化之后,所有的bundle的文件资源都在base的目录下
67 | xibView = [[[NSBundle bundleWithPath:[bundle pathForResource:@"Base" ofType:@"lproj"]] loadNibNamed:fileName owner:nil options:nil] lastObject];
68 | }
69 | return xibView;
70 | }
71 |
72 | + (UIView *)viewWithXibFileName:(NSString *)fileName bundleName:(NSString *)bundleName {
73 | return [self viewWithXibFileName:fileName inBundle:[self bundleWithName:bundleName]];
74 | }
75 |
76 | + (UIStoryboard *)storyboardWithName:(NSString *)storyboardName inBundle:(NSBundle *)bundle {
77 | if(storyboardName.length == 0 || !bundle) {
78 | return nil;
79 | }
80 | return [UIStoryboard storyboardWithName:storyboardName bundle:bundle];
81 | }
82 |
83 | + (UIStoryboard *)storyboardWithName:(NSString *)storyboardName bundleName:(NSString *)bundleName {
84 | return [self storyboardWithName:storyboardName inBundle:[self bundleWithName:bundleName]];
85 | }
86 |
87 | + (UINib *)nibWithNibName:(NSString *)nibName inBundle:(NSBundle *)bundle {
88 | if(nibName.length == 0 || !bundle ) {
89 | return nil;
90 | }
91 | return [UINib nibWithNibName:nibName bundle:bundle];
92 | }
93 |
94 |
95 | @end
96 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleHelper/ModuleExceptionHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleExceptionHandler.h
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ModuleExceptionHandler : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleHelper/ModuleExceptionHandler.m:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleExceptionHandler.m
3 | // Common
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleExceptionHandler.h"
10 | #import "BifrostHeader.h"
11 |
12 | @implementation ModuleExceptionHandler
13 |
14 | + (void)load {
15 | [Bifrost setExceptionHandler:^id _Nullable(NSException * _Nonnull exception) {
16 | //record the error
17 | NSLog(@"[Module] Exception:%@", exception);
18 | //handle excpeitons
19 | switch (exception.bf_exceptionCode) {
20 | case BFExceptionUrlHandlerNotFound:
21 | //you can provide the default error VC for the route url here
22 | // ErrorViewController *errorVC = [[ErrorViewController alloc] init];
23 | // return errorVC;
24 | break;
25 | case BFExceptionModuleNotFoundException:
26 | break;
27 | case BFExceptionAPINotFoundException:
28 | break;
29 | case BFExceptionFailedToRegisterModule:
30 | break;
31 | default:
32 | break;
33 | }
34 | #ifdef DEBUG
35 | @throw exception; //debug模式下抛出异常crash,以便及时处理问题
36 | #endif
37 | return nil;
38 | }];
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleService/GoodsModuleService.h:
--------------------------------------------------------------------------------
1 | //
2 | // GoodsModuleService.h
3 | // Goods
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef GoodsModuleService_h
10 | #define GoodsModuleService_h
11 |
12 | ///
13 | /**
14 | service protocol头文件版本号基于Semantic Versioning
15 | x(major).y(minor)
16 | major - 公共API改动或者删减
17 | minor - 新添加了公共API
18 | 小于1.0的版本(如0.6),视为未稳定版本,不做上述限制。
19 | */
20 |
21 | #import "BifrostHeader.h"
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | #pragma mark - Notifications
26 | //static NSNotificationName kNotification*** = @"kNotification***";
27 |
28 | #pragma mark - URL routers
29 | static NSString *const kRouteAllGoodsList = @"//goods/all_goods_list";
30 | static NSString *const kRouteGoodsDetail = @"//goods/detail";
31 | static NSString *const kRouteGoodsDetailParamId = @"id";
32 |
33 | #pragma mark - Model Protocols
34 | @protocol GoodsProtocol
35 | - (NSString*)goodsId;
36 | - (NSString*)name;
37 | - (CGFloat)price;
38 | - (NSInteger)inventory;
39 | @end
40 |
41 | #pragma mark - Module Protocol
42 | /**
43 | The services provided by goods module to other modules
44 | */
45 | @protocol GoodsModuleService
46 |
47 | - (NSInteger)totalInventory;
48 | - (NSArray>*)popularGoodsList; //热卖商品
49 | - (NSArray>*)allGoodsList; //所有商品
50 | - (id)goodsById:(nonnull NSString*)goodsId;
51 |
52 | @end
53 |
54 | NS_ASSUME_NONNULL_END
55 |
56 | #endif /* GoodsModuleService_h */
57 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleService/HomeModuleService.h:
--------------------------------------------------------------------------------
1 | //
2 | // HomeModuleService.h
3 | // Home
4 | //
5 | // Created by yangke on 2017/9/16.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef HomeModuleService_h
10 | #define HomeModuleService_h
11 |
12 | ///
13 | /**
14 | service protocol头文件版本号基于Semantic Versioning
15 | x(major).y(minor)
16 | major - 公共API改动或者删减
17 | minor - 新添加了公共API
18 | 小于1.0的版本(如0.6),视为未稳定版本,不做上述限制。
19 | */
20 |
21 | #import "BifrostHeader.h"
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | #pragma mark - Notifications
26 | static NSNotificationName kNotificationHomePageDidAppear = @"kNotificationHomePageDidAppear";
27 |
28 | #pragma mark - URL routers
29 | static NSString *const kRouteHomePage = @"//home/home_page";
30 |
31 |
32 | #pragma mark - Model Protocols
33 |
34 |
35 | #pragma mark - Module Protocol
36 | /**
37 | The services provided by home module to other modules
38 | */
39 | @protocol HomeModuleService
40 |
41 | @end
42 |
43 | NS_ASSUME_NONNULL_END
44 | #endif /* HomeModuleService_h */
45 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleService/LaunchModuleService.h:
--------------------------------------------------------------------------------
1 | //
2 | // LaunchModuleService.h
3 | // Launch
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef LaunchModuleService_h
10 | #define LaunchModuleService_h
11 |
12 | ///
13 | /**
14 | service protocol头文件版本号基于Semantic Versioning
15 | x(major).y(minor)
16 | major - 公共API改动或者删减
17 | minor - 新添加了公共API
18 | 小于1.0的版本(如0.6),视为未稳定版本,不做上述限制。
19 | */
20 |
21 | #import "BifrostHeader.h"
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | #pragma mark - Notifications
26 | //static NSNotificationName kNotification*** = @"kNotification***";
27 |
28 | #pragma mark - URL routers
29 | //static NSString *const kRouteLaunch*** = @"//launch/***";
30 |
31 |
32 | #pragma mark - Model Protocols
33 |
34 |
35 | #pragma mark - Module Protocol
36 | /**
37 | The services provided by Launch module to other modules
38 | */
39 | @protocol LaunchModuleService
40 |
41 |
42 | @end
43 |
44 | NS_ASSUME_NONNULL_END
45 | #endif /* LaunchModuleService_h */
46 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleService/SaleModuleService.h:
--------------------------------------------------------------------------------
1 | //
2 | // SaleModuleService.h
3 | // Sale
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef SaleModuleService_h
10 | #define SaleModuleService_h
11 |
12 | ///
13 | /**
14 | service protocol头文件版本号基于Semantic Versioning
15 | x(major).y(minor)
16 | major - 公共API改动或者删减
17 | minor - 新添加了公共API
18 | 小于1.0的版本(如0.6),视为未稳定版本,不做上述限制。
19 | */
20 |
21 | #import "BifrostHeader.h"
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | #pragma mark - Notifications
26 | //static NSNotificationName kNotification*** = @"kNotification***";
27 |
28 | #pragma mark - URL routers
29 | static NSString *const kRouteSaleShoppingCart = @"//sale/shopping_chart";
30 |
31 |
32 | #pragma mark - Model Protocols
33 |
34 |
35 | #pragma mark - Module Protocol
36 | /**
37 | The services provided by Sale module to other modules
38 | */
39 | @protocol SaleModuleService
40 |
41 | //add goods to shopping cart
42 | - (void)addShoppingCartGoods:(NSString*)goodsId;
43 | - (NSUInteger)shoppinCartGoodsNum;
44 |
45 | @end
46 |
47 | NS_ASSUME_NONNULL_END
48 | #endif /* SaleModuleService_h */
49 |
--------------------------------------------------------------------------------
/Demo/Modules/Mediator/Mediator/ModuleService/ShopModuleService.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShopModuleService.h
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #ifndef ShopModuleService_h
10 | #define ShopModuleService_h
11 | ///
12 | /**
13 | service protocol头文件版本号基于Semantic Versioning
14 | x(major).y(minor)
15 | major - 公共API改动或者删减
16 | minor - 新添加了公共API
17 | 小于1.0的版本(如0.6),视为未稳定版本,不做上述限制。
18 | */
19 |
20 | #import "BifrostHeader.h"
21 |
22 | NS_ASSUME_NONNULL_BEGIN
23 |
24 | #pragma mark - Notifications
25 | //static NSNotificationName kNotification*** = @"kNotification***";
26 |
27 | #pragma mark - URL routers
28 | static NSString *const kRouteShopDetail = @"//shop/detail";
29 |
30 |
31 | #pragma mark - Model Protocols
32 |
33 |
34 | #pragma mark - Module Protocol
35 | /**
36 | The services provided by shop module to other modules
37 | */
38 | @protocol ShopModuleService
39 |
40 | - (NSString*)shopName;
41 | - (UIImage*)shopLogo;
42 | - (CGFloat)shopRevenue;
43 |
44 | @end
45 |
46 | NS_ASSUME_NONNULL_END
47 | #endif /* ShopModuleService_h */
48 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Sale.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 11
11 |
12 | SaleBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 12
16 |
17 | SaleModule.xcscheme_^#shared#^_
18 |
19 | orderHint
20 | 0
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Common/Definition/SaleModule-Definition.h:
--------------------------------------------------------------------------------
1 | //
2 | // SaleModule-Definition.h
3 | // SaleModule
4 | //
5 | // Created by chengfei xiao on 2018/3/29.
6 | //
7 |
8 | #ifndef SaleModule_Definition_h
9 | #define SaleModule_Definition_h
10 |
11 |
12 | #endif /* SaleModule_Definition_h */
13 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Common/Kits/Kits.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Sale/Sale/Common/Kits/Kits.txt
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/SaleManager/SaleManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // SaleManager.h
3 | // Sale
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface SaleManager : NSObject
14 |
15 | + (instancetype)sharedInstance;
16 | - (void)setup;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/SaleManager/SaleManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // SaleManager.m
3 | // Sale
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import "SaleManager.h"
10 | #import "HomeModuleService.h"
11 |
12 | @implementation SaleManager
13 |
14 | + (instancetype)sharedInstance {
15 | static SaleManager *instance = nil;
16 | static dispatch_once_t onceToken;
17 | dispatch_once(&onceToken, ^{
18 | instance = [[self alloc] init];
19 | });
20 | return instance;
21 | }
22 |
23 | - (void)setup {
24 | //observe Home Page Did Appear event to preload data
25 | [[NSNotificationCenter defaultCenter] addObserver:self
26 | selector:@selector(updateSaleSettings)
27 | name:kNotificationHomePageDidAppear
28 | object:nil];
29 | }
30 |
31 | - (void)updateSaleSettings {
32 | NSLog(@"Start to update sale settings...");
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/ShoppingCart/Controller/ShoppingCartManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShoppingCartManager.h
3 | // Sale
4 | //
5 | // Created by yangke on 2019/2/28.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface ShoppingCartManager : NSObject
15 |
16 | @property (nonatomic, readonly) NSMutableDictionary* cartItemDict;
17 |
18 | + (instancetype)sharedInstance;
19 |
20 | - (void)addGoods:(nonnull NSString*)goodsId withNum:(NSUInteger)num;
21 | - (NSUInteger)shoppinCartGoodsNum;
22 |
23 | @end
24 |
25 | @interface ShoppingCartItem : NSObject
26 | @property (nonatomic, strong) NSString *goodsId;
27 | @property (nonatomic, assign) NSUInteger num;
28 | @end
29 |
30 | NS_ASSUME_NONNULL_END
31 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/ShoppingCart/Controller/ShoppingCartManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShoppingCartManager.m
3 | // Sale
4 | //
5 | // Created by yangke on 2019/2/28.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import "ShoppingCartManager.h"
10 | #import "SaleBundle.h"
11 |
12 | @interface ShoppingCartManager()
13 | @property (nonatomic, strong) NSMutableDictionary* cartItemDict;
14 | @end
15 | @implementation ShoppingCartManager
16 |
17 | + (instancetype)sharedInstance {
18 | static ShoppingCartManager *instance = nil;
19 | static dispatch_once_t onceToken;
20 | dispatch_once(&onceToken, ^{
21 | instance = [[self.class alloc] init];
22 | instance.cartItemDict = [NSMutableDictionary dictionary];
23 | });
24 | return instance;
25 | }
26 |
27 | - (void)addGoods:(nonnull NSString*)goodsId
28 | withNum:(NSUInteger)num {
29 | ShoppingCartItem *item = [self.cartItemDict objectForKey:goodsId];
30 | if (!item) {
31 | item = [[ShoppingCartItem alloc] init];
32 | item.goodsId = goodsId;
33 | [self.cartItemDict setObject:item forKey:goodsId];
34 | }
35 | item.num += num;
36 | }
37 |
38 | - (NSUInteger)shoppinCartGoodsNum {
39 | NSUInteger sum = 0;
40 | for (ShoppingCartItem *item in self.cartItemDict.allValues) {
41 | sum += item.num;
42 | }
43 | return sum;
44 | }
45 |
46 | @end
47 |
48 | @implementation ShoppingCartItem
49 | @end
50 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/ShoppingCart/Controller/ShoppingCartViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShoppingCartViewController.h
3 | // Sale
4 | //
5 | // Created by yangke on 2019/2/28.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface ShoppingCartViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Feature/ShoppingCart/Controller/ShoppingCartViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShoppingCartViewController.m
3 | // Sale
4 | //
5 | // Created by yangke on 2019/2/28.
6 | // Copyright © 2019 yangke. All rights reserved.
7 | //
8 |
9 | #import "ShoppingCartViewController.h"
10 | #import "ShoppingCartManager.h"
11 | #import "SaleModuleService.h"
12 | #import "YZSTableViewModel.h"
13 | #import "YZWeakDefine.h"
14 | #import "GoodsModuleService.h"
15 |
16 | @interface ShoppingCartViewController ()
17 | @property (nonatomic, strong) UITableView *tableView;
18 | @property (nonatomic, strong) YZSTableViewModel *viewModel;
19 | @property (nonatomic, strong) NSArray *shoppingCartItemList;
20 | @end
21 |
22 | @implementation ShoppingCartViewController
23 |
24 | +(void)load {
25 | [Bifrost bindURL:kRouteSaleShoppingCart toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
26 | ShoppingCartViewController *vc = [[self alloc] init];
27 | return vc;
28 | }];
29 | }
30 |
31 | - (void)viewDidLoad {
32 | [super viewDidLoad];
33 | self.title = @"Shopping Cart";
34 | self.navigationItem.backBarButtonItem.title = @"";
35 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds
36 | style:UITableViewStylePlain];
37 | [self.view addSubview:self.tableView];
38 | self.shoppingCartItemList = [[[ShoppingCartManager sharedInstance] cartItemDict] allValues];
39 | [self reloadViewModel];
40 | }
41 |
42 | - (YZSTableViewModel*)viewModel {
43 | if(!_viewModel) {
44 | _viewModel = [[YZSTableViewModel alloc] init];
45 | self.tableView.dataSource = _viewModel;
46 | self.tableView.delegate = _viewModel;
47 | _viewModel.delegate = self;
48 | }
49 | return _viewModel;
50 | }
51 |
52 | - (void)reloadViewModel {
53 | [self.viewModel.sectionModelArray removeAllObjects];
54 | //goods info section
55 | {
56 | YZSTableViewSectionModel *sectionModel = [[YZSTableViewSectionModel alloc] init];
57 | [self.viewModel.sectionModelArray addObject:sectionModel];
58 | static NSString *CellIdentifier = @"GoodsCell";
59 | YZWeak(self);
60 | //popular goods list
61 | for (ShoppingCartItem *item in [ShoppingCartManager sharedInstance].cartItemDict.allValues) {
62 | YZSTableViewCellModel *cellModel = [[YZSTableViewCellModel alloc] init];
63 | [sectionModel.cellModelArray addObject:cellModel];
64 | cellModel.height = 44;
65 | id goods = [BFModule(GoodsModuleService) goodsById:item.goodsId];
66 | YZWeak(item)
67 | cellModel.renderBlock = ^UITableViewCell * _Nonnull(NSIndexPath * _Nonnull indexPath, UITableView * _Nonnull tableView) {
68 | YZStrong(self)
69 | YZStrong(item)
70 | UITableViewCell *cell = [self reusableCellWithId:CellIdentifier inView:tableView];
71 | NSString *text = BFStr(@"%@ : ¥%.2f x %lu", goods.name, goods.price, item.num);
72 | cell.textLabel.text = text;
73 | return cell;
74 | };
75 | }
76 | //Total Price
77 | YZSTableViewCellModel *cellModel = [[YZSTableViewCellModel alloc] init];
78 | [sectionModel.cellModelArray addObject:cellModel];
79 | cellModel.height = 44;
80 | cellModel.renderBlock = ^UITableViewCell * _Nonnull(NSIndexPath * _Nonnull indexPath, UITableView * _Nonnull tableView) {
81 | YZStrong(self)
82 | UITableViewCell *cell = [self reusableCellWithId:CellIdentifier inView:tableView];
83 | cell.textLabel.text = BFStr(@"Total Price : ¥%.2f", [self totalPrice]);
84 | return cell;
85 | };
86 | }
87 | [self.tableView reloadData];
88 | }
89 |
90 | - (CGFloat)totalPrice {
91 | CGFloat totalPrice = 0;
92 | for (ShoppingCartItem *item in self.shoppingCartItemList) {
93 | id goods = [BFModule(GoodsModuleService) goodsById:item.goodsId];
94 | totalPrice += goods.price * item.num;
95 | }
96 | return totalPrice;
97 | }
98 |
99 | - (UITableViewCell*)reusableCellWithId:(NSString*)identifier
100 | inView:(UITableView*)tableView {
101 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
102 | if (!cell) {
103 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
104 | reuseIdentifier:identifier];
105 | cell.selectionStyle = UITableViewCellSelectionStyleNone;
106 | cell.accessoryType = UITableViewCellAccessoryNone;
107 | }
108 | return cell;
109 | }
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Module/SaleBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZSaleBundle.h
3 | // SaleModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 |
11 | @interface SaleBundle : ModuleBundle
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Module/SaleBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // SaleBundle.m
3 | // SaleModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "SaleBundle.h"
10 |
11 | @implementation SaleBundle
12 |
13 | + (NSBundle *)bundle{
14 | return [self.class bundleWithName:NSStringFromClass(self.class)];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Module/SaleModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // SaleModule.h
3 | // SaleModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "SaleModuleService.h"
10 |
11 | @interface SaleModule : NSObject
12 |
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/Sale/Module/SaleModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // SaleModule.m
3 | // SaleModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "SaleModule.h"
11 | #import "ShoppingCartManager.h"
12 | #import "SaleManager.h"
13 |
14 | @interface SaleModule()
15 |
16 | @end
17 |
18 | @implementation SaleModule
19 |
20 | + (void)load {
21 | BFRegister(SaleModuleService);
22 | }
23 |
24 | #pragma mark - BifrostModuleProtocol methods
25 |
26 | + (instancetype)sharedInstance {
27 | static SaleModule *instance = nil;
28 | static dispatch_once_t onceToken;
29 | dispatch_once(&onceToken, ^{
30 | instance = [[self alloc] init];
31 | });
32 | return instance;
33 | }
34 |
35 | - (void)setup {
36 | [[SaleManager sharedInstance] setup];
37 | }
38 |
39 | #pragma mark - SaleModuleService
40 |
41 | - (void)addGoods:(NSString*)goodsId withNum:(NSUInteger)num {
42 | [[ShoppingCartManager sharedInstance] addGoods:goodsId withNum:num];
43 | }
44 |
45 | - (void)addShoppingCartGoods:(NSString*)goodsId {
46 | [[ShoppingCartManager sharedInstance] addGoods:goodsId withNum:1];
47 | }
48 | - (NSUInteger)shoppinCartGoodsNum {
49 | return [[ShoppingCartManager sharedInstance] shoppinCartGoodsNum];
50 | }
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2019 yangke. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/shopping_cart.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "shopping_cart.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "shopping_cart-1.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/shopping_cart.imageset/shopping_cart-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/shopping_cart.imageset/shopping_cart-1.png
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/shopping_cart.imageset/shopping_cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Sale/SaleBundle/Resource/Assets.xcassets/shopping_cart.imageset/shopping_cart.png
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Audio/Audio.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Sale/SaleBundle/Resource/Audio/Audio.txt
--------------------------------------------------------------------------------
/Demo/Modules/Sale/SaleBundle/Resource/Video/Video.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Sale/SaleBundle/Resource/Video/Video.txt
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Shop.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 9
11 |
12 | ShopBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 10
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Feature/ShopDetail/ShopDetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShopDetailViewController.h
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ShopDetailViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Feature/ShopDetail/ShopDetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShopDetailViewController.m
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ShopDetailViewController.h"
10 | #import "ShopModuleService.h"
11 | #import "SaleModuleService.h"
12 | #import "ShopModule.h"
13 |
14 | @interface ShopDetailViewController ()
15 |
16 | @end
17 |
18 | @implementation ShopDetailViewController
19 |
20 | + (void)load {
21 | [Bifrost bindURL:kRouteShopDetail toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
22 | ShopDetailViewController *vc = [[self alloc] init];
23 | return vc;
24 | }];
25 | }
26 |
27 |
28 | - (void)viewDidLoad {
29 | [super viewDidLoad];
30 | self.title = [ShopModule sharedInstance].shopName;
31 | self.navigationItem.backBarButtonItem.title = @"";
32 | self.view.backgroundColor = [UIColor whiteColor];
33 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200)];
34 | label.text = @"This is the page for shop details";
35 | label.textAlignment = NSTextAlignmentCenter;
36 | [self.view addSubview:label];
37 | [self updateShoppingCartBarButtonItem];
38 | }
39 |
40 | - (void)updateShoppingCartBarButtonItem {
41 | NSString *title = BFStr(@"购物车(%lu)", BFModule(SaleModuleService).shoppinCartGoodsNum);
42 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:nil action:nil];
43 | [item setTarget:self];
44 | [item setAction:@selector(goToShoppingCart)];
45 | self.navigationItem.rightBarButtonItem = item;
46 | }
47 |
48 | - (void)goToShoppingCart {
49 | UIViewController *vc = [Bifrost handleURL:kRouteSaleShoppingCart];
50 | if (vc) {
51 | [self.navigationController pushViewController:vc animated:YES];
52 | }
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Feature/ShopManager/ShopManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShopManager.h
3 | // Shop
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface ShopManager : NSObject
14 |
15 | + (instancetype)sharedInstance;
16 | - (void)setup;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Feature/ShopManager/ShopManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShopManager.m
3 | // Shop
4 | //
5 | // Created by yangke on 2019/3/5.
6 | // Copyright © 2019 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ShopManager.h"
10 | #import "HomeModuleService.h"
11 |
12 | @implementation ShopManager
13 |
14 | + (instancetype)sharedInstance {
15 | static ShopManager *instance = nil;
16 | static dispatch_once_t onceToken;
17 | dispatch_once(&onceToken, ^{
18 | instance = [[self alloc] init];
19 | });
20 | return instance;
21 | }
22 |
23 | - (void)setup {
24 | //observe Home Page Did Appear event to preload data
25 | [[NSNotificationCenter defaultCenter] addObserver:self
26 | selector:@selector(updateShopData)
27 | name:kNotificationHomePageDidAppear
28 | object:nil];
29 | }
30 |
31 | - (void)updateShopData {
32 | NSLog(@"Start to update shop data...");
33 | }
34 |
35 |
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Module/ShopBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShopBundle.h
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 |
11 | @interface ShopBundle : ModuleBundle
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Module/ShopBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShopBundle.m
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ShopBundle.h"
10 |
11 | @implementation ShopBundle
12 |
13 | + (NSBundle *)bundle{
14 | return [self.class bundleWithName:NSStringFromClass(self.class)];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Module/ShopModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShopModule.h
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 | #import "BifrostHeader.h"
11 | #import "ShopModuleService.h"
12 |
13 | @interface ShopModule : ModuleBundle
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/Shop/Module/ShopModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // ShopModule.m
3 | // Shop
4 | //
5 | // Created by yangke on 2017/9/17.
6 | // Copyright © 2017年 jackie@youzan. All rights reserved.
7 | //
8 |
9 | #import "ShopModule.h"
10 | #import "ShopBundle.h"
11 | #import "ShopManager.h"
12 |
13 | @implementation ShopModule
14 |
15 | + (void)load {
16 | BFRegister(ShopModuleService);
17 | for(NSInteger i=0; i<100; i++) {
18 | BFRegister(ShopModuleService);
19 | }
20 | }
21 |
22 | #pragma mark - BifrostModuleProtocol methods
23 |
24 | + (instancetype)sharedInstance {
25 | static ShopModule *instance = nil;
26 | static dispatch_once_t onceToken;
27 | dispatch_once(&onceToken, ^{
28 | instance = [[self alloc] init];
29 | });
30 | return instance;
31 |
32 | }
33 |
34 | - (void)setup {
35 | [[ShopManager sharedInstance] setup];
36 | }
37 |
38 | - (void)preLoadGoodsInfo {
39 | //some preload work here. it will take long time
40 | sleep(10);
41 | }
42 |
43 | #pragma mark - ShopModuleService
44 | - (NSString*)shopName {
45 | return @"零售特工队";
46 | }
47 |
48 | - (UIImage*)shopLogo {
49 | return [ShopBundle imageNamed:@"shop_logo"];
50 | }
51 |
52 | - (CGFloat)shopRevenue {
53 | return 666666.66;
54 | }
55 |
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/ShopBundle/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2017年 jackie@youzan. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/shop_logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "icon_store@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "icon_store@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/shop_logo.imageset/icon_store@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/shop_logo.imageset/icon_store@2x.png
--------------------------------------------------------------------------------
/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/shop_logo.imageset/icon_store@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Demo/Modules/Shop/ShopBundle/Resource/image.xcassets/shop_logo.imageset/icon_store@3x.png
--------------------------------------------------------------------------------
/Demo/Podfile:
--------------------------------------------------------------------------------
1 | source 'http://gitlab.qima-inc.com/AppLib/RenRenPodspecs.git'
2 | source 'http://gitlab.qima-inc.com/AppLib/CocoaPodsSpecs.git'
3 |
4 |
5 | # ignore all warnings from all pods
6 | inhibit_all_warnings!
7 | platform :ios, '8.0'
8 |
9 | #disable some warnings
10 | post_install do |installer|
11 | installer.pods_project.targets.each do |target|
12 | target.build_configurations.each do |config|
13 | #disable some warnings of Pods
14 | config.build_settings['CLANG_WARN_DOCUMENTATION_COMMENTS'] = 'NO'
15 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
16 | end
17 | end
18 | end
19 |
20 | def commonPods()
21 | #some 3rd party pods for demo
22 | # pod 'AFNetworking'
23 | pod 'YYModel'
24 | pod 'SigmaTableViewModel'
25 | end
26 |
27 | def mediatorPods()
28 | pod 'Bifrost', :path => '../'
29 | end
30 |
31 | workspace "BifrostDemo"
32 | target "BifrostDemo" do
33 | project 'App/App.xcodeproj'
34 | # commonPods()
35 | # mediatorPods()
36 | target "Common" do
37 | project 'Modules/Common/Common.xcodeproj'
38 | commonPods()
39 | end
40 | target "Mediator" do
41 | project 'Modules/Mediator/Mediator.xcodeproj'
42 | mediatorPods()
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/Demo/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Bifrost (1.0.3)
3 | - SigmaTableViewModel (1.2.1)
4 | - YYModel (1.0.4)
5 |
6 | DEPENDENCIES:
7 | - Bifrost (from `../`)
8 | - SigmaTableViewModel
9 | - YYModel
10 |
11 | SPEC REPOS:
12 | http://gitlab.qima-inc.com/AppLib/CocoaPodsSpecs.git:
13 | - YYModel
14 | http://gitlab.qima-inc.com/AppLib/RenRenPodspecs.git:
15 | - SigmaTableViewModel
16 |
17 | EXTERNAL SOURCES:
18 | Bifrost:
19 | :path: "../"
20 |
21 | SPEC CHECKSUMS:
22 | Bifrost: 20eddac040acd033fc55172f774708a882863240
23 | SigmaTableViewModel: 0fab448014024fc788b8451758ff77c3979a665e
24 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
25 |
26 | PODFILE CHECKSUM: a931ffe0e7e431130da17cf723d80a7c8a665fd8
27 |
28 | COCOAPODS: 1.5.3
29 |
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/Bifrost/Bifrost+Router.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/Bifrost+Router.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/Bifrost/Bifrost.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/Bifrost.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/Bifrost/BifrostHeader.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/BifrostHeader.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/Bifrost/BifrostProtocol.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/BifrostProtocol.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/SigmaTableViewModel/YZSTableViewCellModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewCellModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/SigmaTableViewModel/YZSTableViewModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/SigmaTableViewModel/YZSTableViewSectionModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewSectionModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/YYModel/NSObject+YYModel.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/NSObject+YYModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/YYModel/YYClassInfo.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/YYClassInfo.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Private/YYModel/YYModel.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/YYModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/Bifrost/Bifrost+Router.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/Bifrost+Router.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/Bifrost/Bifrost.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/Bifrost.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/Bifrost/BifrostHeader.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/BifrostHeader.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/Bifrost/BifrostProtocol.h:
--------------------------------------------------------------------------------
1 | ../../../../../Bifrost/Lib/BifrostProtocol.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/SigmaTableViewModel/YZSTableViewCellModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewCellModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/SigmaTableViewModel/YZSTableViewModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/SigmaTableViewModel/YZSTableViewSectionModel.h:
--------------------------------------------------------------------------------
1 | ../../../SigmaTableViewModel/Lib/YZSTableViewSectionModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/YYModel/NSObject+YYModel.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/NSObject+YYModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/YYModel/YYClassInfo.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/YYClassInfo.h
--------------------------------------------------------------------------------
/Demo/Pods/Headers/Public/YYModel/YYModel.h:
--------------------------------------------------------------------------------
1 | ../../../YYModel/YYModel/YYModel.h
--------------------------------------------------------------------------------
/Demo/Pods/Local Podspecs/Bifrost.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Bifrost",
3 | "version": "1.0.3",
4 | "summary": "Bifrost",
5 | "description": "URL router and module management framework.",
6 | "homepage": "http://gitlab.qima-inc.com/AppLib/BifrostIOS/wikis/home",
7 | "license": "MIT",
8 | "authors": {
9 | "JackieYang": "yangke@youzan.com"
10 | },
11 | "source": {
12 | "git": "http://gitlab.qima-inc.com/AppLib/BifrostIOS.git",
13 | "tag": "1.0.3"
14 | },
15 | "source_files": "Bifrost/Lib/*.{h,m}",
16 | "frameworks": "UIKit",
17 | "requires_arc": true,
18 | "platforms": {
19 | "ios": "7.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Demo/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Bifrost (1.0.3)
3 | - SigmaTableViewModel (1.2.1)
4 | - YYModel (1.0.4)
5 |
6 | DEPENDENCIES:
7 | - Bifrost (from `../`)
8 | - SigmaTableViewModel
9 | - YYModel
10 |
11 | SPEC REPOS:
12 | http://gitlab.qima-inc.com/AppLib/CocoaPodsSpecs.git:
13 | - YYModel
14 | http://gitlab.qima-inc.com/AppLib/RenRenPodspecs.git:
15 | - SigmaTableViewModel
16 |
17 | EXTERNAL SOURCES:
18 | Bifrost:
19 | :path: "../"
20 |
21 | SPEC CHECKSUMS:
22 | Bifrost: 20eddac040acd033fc55172f774708a882863240
23 | SigmaTableViewModel: 0fab448014024fc788b8451758ff77c3979a665e
24 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
25 |
26 | PODFILE CHECKSUM: a931ffe0e7e431130da17cf723d80a7c8a665fd8
27 |
28 | COCOAPODS: 1.5.3
29 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/Bifrost.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/Pods-BifrostDemo-Common.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/Pods-BifrostDemo-Mediator.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/Pods-BifrostDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/SigmaTableViewModel.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/YYModel.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Pods.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Bifrost.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 0
13 |
14 | Pods-BifrostDemo-Common.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 2
20 |
21 | Pods-BifrostDemo-Mediator.xcscheme
22 |
23 | isShown
24 |
25 | orderHint
26 | 3
27 |
28 | Pods-BifrostDemo.xcscheme
29 |
30 | isShown
31 |
32 | orderHint
33 | 1
34 |
35 | SigmaTableViewModel.xcscheme
36 |
37 | isShown
38 |
39 | orderHint
40 | 4
41 |
42 | YYModel.xcscheme
43 |
44 | isShown
45 |
46 | orderHint
47 | 5
48 |
49 |
50 | SuppressBuildableAutocreation
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 有赞
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 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/Lib/YZSTableViewCellModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZSTableViewCellModel.h
3 | // SmartTableView
4 | //
5 | // Created by yangke on 8/25/15.
6 | // Copyright (c) 2015 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | typedef CGFloat (^YZSCellHeightBlock)(NSIndexPath *_Nonnull indexPath,
13 | UITableView *_Nonnull tableView);
14 | typedef void (^YZSCellVoidBlock)(NSIndexPath *_Nonnull indexPath,
15 | UITableView *_Nonnull tableView);
16 | typedef BOOL (^YZSCellBoolBlock)(NSIndexPath *_Nonnull indexPath,
17 | UITableView *_Nonnull tableView);
18 | typedef UITableViewCell *_Nonnull (^YZSCellRenderBlock)(NSIndexPath *_Nonnull indexPath,
19 | UITableView *_Nonnull tableView);
20 | typedef void (^YZSCellDisplayBlock)(UITableViewCell *_Nonnull cell, NSIndexPath *_Nonnull indexPath,
21 | UITableView *_Nonnull tableView);
22 | typedef void (^YZSCellEditingStyleBlock)(NSIndexPath *_Nonnull indexPath, UITableView *_Nonnull tableView,
23 | UITableViewCellEditingStyle editingStyle);
24 | typedef NSIndexPath *_Nullable (^YZSCellIndexPathBlock)(NSIndexPath *_Nonnull indexPath,
25 | UITableView *_Nonnull tableView);
26 | /** Table view's row model */
27 | @interface YZSTableViewCellModel : NSObject
28 |
29 | @property (nonatomic, copy, nonnull) YZSCellRenderBlock renderBlock; // required
30 | @property (nonatomic, copy, nullable) YZSCellDisplayBlock willDisplayBlock; // optional
31 | @property (nonatomic, copy, nullable) YZSCellDisplayBlock didEndDisplayBlock; // optional
32 | @property (nonatomic, copy, nullable) YZSCellIndexPathBlock willSelectBlock; // optional
33 | @property (nonatomic, copy, nullable) YZSCellIndexPathBlock willDeselectBlock; // optional
34 | @property (nonatomic, copy, nullable) YZSCellVoidBlock selectionBlock; // optional
35 | @property (nonatomic, copy, nullable) YZSCellVoidBlock deselectionBlock; // optional
36 | @property (nonatomic, copy, nullable) YZSCellEditingStyleBlock commitEditBlock; // optional
37 | @property (nonatomic, copy, nullable) YZSCellBoolBlock shouldHighlightBlock; // optional
38 | @property (nonatomic, copy, nullable) YZSCellVoidBlock didHighlightBlock; // optional
39 | @property (nonatomic, copy, nullable) YZSCellVoidBlock didUnhighlightBlock; // optional
40 | @property (nonatomic, copy, nullable) YZSCellVoidBlock willBeginEditingBlock; // optional
41 | @property (nonatomic, copy, nullable) YZSCellVoidBlock didEndEditingBlock; // optional
42 | @property (nonatomic, copy, nullable) YZSCellVoidBlock accessoryButtonTappedBlock; // optional
43 | /**
44 | if not specified, will use UITableViewAutomaticDimension as default value.
45 | if height and cellHeightBlock are both provided, cellHeightBlock will be used
46 | */
47 | @property (nonatomic, assign) CGFloat height; // optional
48 | @property (nonatomic, copy) YZSCellHeightBlock _Nullable cellHeightBlock; // optional
49 | /** used by tableView:canEditRowAtIndexPath: */
50 | @property (nonatomic, assign) BOOL canEdit; // default NO
51 | /** used by tableView:shouldHighlightForRowAtIndexPath: */
52 | @property (nonatomic, assign) BOOL shouldHighlight; //default is YES, shouldHighlightBlock has higher priority
53 | /** used by tableView:shouldIndentWhileEditingRowAtIndexPath: */
54 | @property (nonatomic, assign) BOOL shouldIndentWhileEditing; //default is YES
55 | /** used by tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: */
56 | @property (nonatomic, strong, nullable) NSString *deleteConfirmationButtonTitle; // delete confirmation title
57 | /** used by tableView:editActionsForRowAtIndexPath: */
58 | @property (nonatomic, strong, nullable) NSArray *editActions; //supersedes deleteConfirmationButtonTitle
59 | /** used by tableView:shouldIndentWhileEditingRowAtIndexPath: */
60 | @property (nonatomic, assign) BOOL shouldShowMenu; // optional, default NO.
61 | /** used by tableView:editingStyleForRowAtIndexPath: */
62 | @property (nonatomic, assign) UITableViewCellEditingStyle editingStyle; // default value UITableViewCellEditingStyleDelete
63 | @property (nonatomic, strong, nullable) NSString *key; // optional, used to identify the model
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/Lib/YZSTableViewCellModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // YZSTableViewCellModel.m
3 | // SmartTableView
4 | //
5 | // Created by yangke on 8/25/15.
6 | // Copyright (c) 2015 yangke. All rights reserved.
7 | //
8 |
9 | #import "YZSTableViewCellModel.h"
10 |
11 | @implementation YZSTableViewCellModel
12 |
13 | - (instancetype)init {
14 | self = [super init];
15 | if (self) {
16 | self.height = UITableViewAutomaticDimension;
17 | self.shouldIndentWhileEditing = YES;
18 | self.shouldHighlight = YES;
19 | self.editingStyle = UITableViewCellEditingStyleDelete;
20 | }
21 | return self;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/Lib/YZSTableViewModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZSTableViewModel.h
3 | // SmartTableView
4 | //
5 | // Created by yangke on 8/25/15.
6 | // Copyright (c) 2015 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "YZSTableViewSectionModel.h"
12 |
13 | /**
14 | 用于补充未实现的UITableViewDataSource和UITableViewDelegate的方法
15 | 为了避免没有添加required的方法出现警告所以没有直接继承他们。
16 | 本protocol的对象所实现的所有UITableViewDataSource和UITableViewDelegate方法都会被YZSTableViewModel优先使用
17 | (类似子类override的作用)
18 | */
19 | @protocol YZSTableViewModelDelegate
20 | @end
21 |
22 | /**
23 | * YZSTableViewModel implements some methods in UITableViewDelegate & UITableViewDataSource.
24 | * it can be used as the delegate & dataSource of a tableView.
25 | * For those methods it doesn't implement, you can implement them in its subclass.
26 | */
27 | @interface YZSTableViewModel : NSObject
28 | /** table view's section model array */
29 | @property (nonatomic, strong) NSMutableArray *sectionModelArray;
30 | /**
31 | 用于补充更多的UITableViewDataSource/UITableViewDelegate实现。
32 | 如果delegate有相应实现,YZSTableViewModel会优先使用delegate的实现(类似override的效果)。
33 | 注:请在设置tableview的dataSource和delegat之前设置好delegate!
34 | 因为它们的setter方法会触发responseToSelector系列检查。 如果设置本delegate较晚,则tableview会认为有些方法没有实现。
35 | */
36 | @property (nonatomic, weak) id delegate; //optional
37 |
38 | /**
39 | @param tableView required
40 | @param delegate optional, can be nil
41 | @return view model instance
42 | */
43 | - (instancetype)initWithTableView:(UITableView*)tableView
44 | andDelegate:(id)delegate;
45 |
46 | // Methods to get view model by key
47 | - (YZSTableViewSectionModel *)sectionModelForKey:(NSString *)sectionKey;
48 | - (YZSTableViewCellModel *)cellModelForKey:(NSString *)rowKey;
49 |
50 | // Methods to manage section models directly, and to support row animation
51 | // Following methods are NOT thread safe!!! Don't invoke them in different threads at the same time.
52 | - (void)insertSectionModels:(NSArray *)sectionModels
53 | before:(BOOL)before
54 | sectionKeys:(NSArray *)keys
55 | inTableView:(UITableView *)tableView
56 | withRowAnimation:(UITableViewRowAnimation)animation;
57 | - (void)reloadSectionModels:(NSArray *)sectionModels
58 | forSectionKeys:(NSArray *)keys
59 | inTableView:(UITableView *)tableView
60 | withRowAnimation:(UITableViewRowAnimation)animation;
61 | - (void)deleteSectionModelsWithKeys:(NSArray *)sectionKeys
62 | inTableView:(UITableView *)tableView
63 | withRowAnimation:(UITableViewRowAnimation)animation;
64 |
65 | // Methods to manage cell models directly, and to support row animation
66 | // Following methods are not thread safe!!! Don't invoke them in different threads at the same time.
67 | - (void)insertCellModels:(NSArray *)cellModels
68 | before:(BOOL)before
69 | cellKeys:(NSArray *)keys
70 | inTableView:(UITableView *)tableView
71 | withRowAnimation:(UITableViewRowAnimation)animation;
72 | - (void)reloadCellModels:(NSArray *)cellModels
73 | forCellKeys:(NSArray *)keys
74 | inTableView:(UITableView *)tableView
75 | withRowAnimation:(UITableViewRowAnimation)animation;
76 | - (void)deleteCellModelsWithKeys:(NSArray *)cellKeys
77 | inTableView:(UITableView *)tableView
78 | withRowAnimation:(UITableViewRowAnimation)animation;
79 |
80 | @end
81 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/Lib/YZSTableViewSectionModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZSTableViewSectionModel.h
3 | // SmartTableView
4 | //
5 | // Created by yangke on 8/25/15.
6 | // Copyright (c) 2015 yangke. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "YZSTableViewCellModel.h"
12 |
13 | typedef UIView * (^YZSViewRenderBlock)(NSInteger section, UITableView *tableView);
14 |
15 | /** Table view's section model */
16 | @interface YZSTableViewSectionModel : NSObject
17 |
18 | @property (nonatomic, strong) NSMutableArray *cellModelArray;
19 | @property (nonatomic, strong) NSString *headerTitle; // optional
20 | @property (nonatomic, strong) NSString *footerTitle; // optional
21 | // if not specified, will use UITableViewAutomaticDimension as default value
22 | @property (nonatomic, assign) CGFloat headerHeight; // optional
23 | @property (nonatomic, assign) CGFloat footerHeight; // optional
24 |
25 | // view render blocks' priority is higher then view property.
26 | // e.g. if headerViewRenderBlock and headerView are both provided, headerViewRenderBlock will be
27 | // used
28 | @property (nonatomic, copy) YZSViewRenderBlock headerViewRenderBlock; // block to render header
29 | // view
30 | @property (nonatomic, copy) YZSViewRenderBlock footerViewRenderBlock; // block to render footer
31 | // view
32 | @property (nonatomic, strong) UIView *headerView; // section header view
33 | @property (nonatomic, strong) UIView *footerView; // section footer view
34 | @property (nonatomic, strong) NSString *key; // optional, used to identify the model
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/Lib/YZSTableViewSectionModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // YZSTableViewSectionModel.m
3 | // SmartTableView
4 | //
5 | // Created by yangke on 8/25/15.
6 | // Copyright (c) 2015 yangke. All rights reserved.
7 | //
8 |
9 | #import "YZSTableViewSectionModel.h"
10 |
11 | @implementation YZSTableViewSectionModel
12 |
13 | - (instancetype)init {
14 | self = [super init];
15 | if (self) {
16 | self.headerHeight = UITableViewAutomaticDimension;
17 | self.footerHeight = UITableViewAutomaticDimension;
18 | self.cellModelArray = [NSMutableArray array];
19 | }
20 | return self;
21 | }
22 |
23 | - (void)setHeaderHeight:(CGFloat)headerHeight {
24 | if (headerHeight == 0) {
25 | // tableview will use default value if height is 0, so set it as the min float
26 | headerHeight = CGFLOAT_MIN;
27 | }
28 | _headerHeight = headerHeight;
29 | }
30 |
31 | - (void)setFooterHeight:(CGFloat)footerHeight {
32 | if (footerHeight == 0) {
33 | // tableview will use default value if height is 0, so set it as the min float
34 | footerHeight = CGFLOAT_MIN;
35 | }
36 | _footerHeight = footerHeight;
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/Demo/Pods/SigmaTableViewModel/README.md:
--------------------------------------------------------------------------------
1 | # 让TableView就像做加法一样简单。
2 |
3 | 使用文档参考 http://doc.qima-inc.com/pages/viewpage.action?pageId=3773147
4 | 或 https://github.com/youzan/SigmaTableViewModel
5 |
6 | 注:SigmaTableViewModel封装了常用的UITableViewDataSource和delegate方法,如果遇到一些没有封装的,可以subclass或通过YZSTableViewModelDelegate对象来补充。
7 |
8 | 集成方式:
9 | Podfile中加入
10 | ```
11 | source 'http://gitlab.qima-inc.com/AppLib/RenRenPodspecs.git'
12 | pod 'SigmaTableViewModel'
13 | ```
14 |
15 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Bifrost/Bifrost-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Bifrost : NSObject
3 | @end
4 | @implementation PodsDummy_Bifrost
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Bifrost/Bifrost-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Bifrost/Bifrost.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Bifrost
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Bifrost" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost"
4 | OTHER_LDFLAGS = -framework "UIKit"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SigmaTableViewModel
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2016 有赞
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 |
29 | ## YYModel
30 |
31 | The MIT License (MIT)
32 |
33 | Copyright (c) 2015 ibireme
34 |
35 | Permission is hereby granted, free of charge, to any person obtaining a copy
36 | of this software and associated documentation files (the "Software"), to deal
37 | in the Software without restriction, including without limitation the rights
38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 | copies of the Software, and to permit persons to whom the Software is
40 | furnished to do so, subject to the following conditions:
41 |
42 | The above copyright notice and this permission notice shall be included in all
43 | copies or substantial portions of the Software.
44 |
45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51 | SOFTWARE.
52 |
53 |
54 | Generated by CocoaPods - https://cocoapods.org
55 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2016 有赞
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 | License
40 | MIT
41 | Title
42 | SigmaTableViewModel
43 | Type
44 | PSGroupSpecifier
45 |
46 |
47 | FooterText
48 | The MIT License (MIT)
49 |
50 | Copyright (c) 2015 ibireme <ibireme@gmail.com>
51 |
52 | Permission is hereby granted, free of charge, to any person obtaining a copy
53 | of this software and associated documentation files (the "Software"), to deal
54 | in the Software without restriction, including without limitation the rights
55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 | copies of the Software, and to permit persons to whom the Software is
57 | furnished to do so, subject to the following conditions:
58 |
59 | The above copyright notice and this permission notice shall be included in all
60 | copies or substantial portions of the Software.
61 |
62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68 | SOFTWARE.
69 |
70 |
71 | License
72 | MIT
73 | Title
74 | YYModel
75 | Type
76 | PSGroupSpecifier
77 |
78 |
79 | FooterText
80 | Generated by CocoaPods - https://cocoapods.org
81 | Title
82 |
83 | Type
84 | PSGroupSpecifier
85 |
86 |
87 | StringsTable
88 | Acknowledgements
89 | Title
90 | Acknowledgements
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_BifrostDemo_Common : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_BifrostDemo_Common
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SigmaTableViewModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SigmaTableViewModel" -l"YYModel" -framework "CoreFoundation" -framework "Foundation"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../..
9 | PODS_ROOT = ${SRCROOT}/../../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Common/Pods-BifrostDemo-Common.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SigmaTableViewModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SigmaTableViewModel" -l"YYModel" -framework "CoreFoundation" -framework "Foundation"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../..
9 | PODS_ROOT = ${SRCROOT}/../../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Mediator/Pods-BifrostDemo-Mediator-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## Bifrost
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2016 有赞
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 | Generated by CocoaPods - https://cocoapods.org
29 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Mediator/Pods-BifrostDemo-Mediator-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2016 有赞
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 | License
40 | MIT
41 | Title
42 | Bifrost
43 | Type
44 | PSGroupSpecifier
45 |
46 |
47 | FooterText
48 | Generated by CocoaPods - https://cocoapods.org
49 | Title
50 |
51 | Type
52 | PSGroupSpecifier
53 |
54 |
55 | StringsTable
56 | Acknowledgements
57 | Title
58 | Acknowledgements
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Mediator/Pods-BifrostDemo-Mediator-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_BifrostDemo_Mediator : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_BifrostDemo_Mediator
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Mediator/Pods-BifrostDemo-Mediator.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Bifrost"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Bifrost" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../..
9 | PODS_ROOT = ${SRCROOT}/../../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo-Mediator/Pods-BifrostDemo-Mediator.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Bifrost"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Bifrost" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../..
9 | PODS_ROOT = ${SRCROOT}/../../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SigmaTableViewModel
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2016 有赞
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 |
29 | ## YYModel
30 |
31 | The MIT License (MIT)
32 |
33 | Copyright (c) 2015 ibireme
34 |
35 | Permission is hereby granted, free of charge, to any person obtaining a copy
36 | of this software and associated documentation files (the "Software"), to deal
37 | in the Software without restriction, including without limitation the rights
38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 | copies of the Software, and to permit persons to whom the Software is
40 | furnished to do so, subject to the following conditions:
41 |
42 | The above copyright notice and this permission notice shall be included in all
43 | copies or substantial portions of the Software.
44 |
45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51 | SOFTWARE.
52 |
53 |
54 |
55 | ## Bifrost
56 |
57 | The MIT License (MIT)
58 |
59 | Copyright (c) 2016 有赞
60 |
61 | Permission is hereby granted, free of charge, to any person obtaining a copy
62 | of this software and associated documentation files (the "Software"), to deal
63 | in the Software without restriction, including without limitation the rights
64 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
65 | copies of the Software, and to permit persons to whom the Software is
66 | furnished to do so, subject to the following conditions:
67 |
68 | The above copyright notice and this permission notice shall be included in all
69 | copies or substantial portions of the Software.
70 |
71 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
77 | SOFTWARE.
78 |
79 | Generated by CocoaPods - https://cocoapods.org
80 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2016 有赞
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 | License
40 | MIT
41 | Title
42 | SigmaTableViewModel
43 | Type
44 | PSGroupSpecifier
45 |
46 |
47 | FooterText
48 | The MIT License (MIT)
49 |
50 | Copyright (c) 2015 ibireme <ibireme@gmail.com>
51 |
52 | Permission is hereby granted, free of charge, to any person obtaining a copy
53 | of this software and associated documentation files (the "Software"), to deal
54 | in the Software without restriction, including without limitation the rights
55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 | copies of the Software, and to permit persons to whom the Software is
57 | furnished to do so, subject to the following conditions:
58 |
59 | The above copyright notice and this permission notice shall be included in all
60 | copies or substantial portions of the Software.
61 |
62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68 | SOFTWARE.
69 |
70 |
71 | License
72 | MIT
73 | Title
74 | YYModel
75 | Type
76 | PSGroupSpecifier
77 |
78 |
79 | FooterText
80 | The MIT License (MIT)
81 |
82 | Copyright (c) 2016 有赞
83 |
84 | Permission is hereby granted, free of charge, to any person obtaining a copy
85 | of this software and associated documentation files (the "Software"), to deal
86 | in the Software without restriction, including without limitation the rights
87 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88 | copies of the Software, and to permit persons to whom the Software is
89 | furnished to do so, subject to the following conditions:
90 |
91 | The above copyright notice and this permission notice shall be included in all
92 | copies or substantial portions of the Software.
93 |
94 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
95 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
97 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
99 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
100 | SOFTWARE.
101 |
102 | License
103 | MIT
104 | Title
105 | Bifrost
106 | Type
107 | PSGroupSpecifier
108 |
109 |
110 | FooterText
111 | Generated by CocoaPods - https://cocoapods.org
112 | Title
113 |
114 | Type
115 | PSGroupSpecifier
116 |
117 |
118 | StringsTable
119 | Acknowledgements
120 | Title
121 | Acknowledgements
122 |
123 |
124 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_BifrostDemo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_BifrostDemo
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Bifrost" "${PODS_CONFIGURATION_BUILD_DIR}/SigmaTableViewModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Bifrost" -l"SigmaTableViewModel" -l"YYModel" -framework "CoreFoundation" -framework "Foundation" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
9 | PODS_ROOT = ${SRCROOT}/../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/Pods-BifrostDemo/Pods-BifrostDemo.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Bifrost" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public/YYModel"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Bifrost" "${PODS_CONFIGURATION_BUILD_DIR}/SigmaTableViewModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Bifrost" -isystem "${PODS_ROOT}/Headers/Public/SigmaTableViewModel" -isystem "${PODS_ROOT}/Headers/Public/YYModel"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Bifrost" -l"SigmaTableViewModel" -l"YYModel" -framework "CoreFoundation" -framework "Foundation" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
9 | PODS_ROOT = ${SRCROOT}/../Pods
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/SigmaTableViewModel/SigmaTableViewModel-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SigmaTableViewModel : NSObject
3 | @end
4 | @implementation PodsDummy_SigmaTableViewModel
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/SigmaTableViewModel/SigmaTableViewModel-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/SigmaTableViewModel/SigmaTableViewModel.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SigmaTableViewModel
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SigmaTableViewModel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SigmaTableViewModel"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SigmaTableViewModel
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/YYModel/YYModel-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_YYModel : NSObject
3 | @end
4 | @implementation PodsDummy_YYModel
5 | @end
6 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/YYModel/YYModel-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Demo/Pods/Target Support Files/YYModel/YYModel.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYModel
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYModel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YYModel"
4 | OTHER_LDFLAGS = -framework "CoreFoundation" -framework "Foundation"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYModel
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Demo/Pods/YYModel/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 ibireme
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/Pods/YYModel/YYModel/YYModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYModel.h
3 | // YYModel
4 | //
5 | // Created by ibireme on 15/5/10.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | FOUNDATION_EXPORT double YYModelVersionNumber;
16 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[];
17 | #import
18 | #import
19 | #else
20 | #import "NSObject+YYModel.h"
21 | #import "YYClassInfo.h"
22 | #endif
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 有赞
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 |
--------------------------------------------------------------------------------
/Resource/Bifrost.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Resource/Bifrost.jpg
--------------------------------------------------------------------------------
/Resource/arch-with-bma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Resource/arch-with-bma.png
--------------------------------------------------------------------------------
/Resource/arch-without-bma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Resource/arch-without-bma.png
--------------------------------------------------------------------------------
/Resource/demo-arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Resource/demo-arch.png
--------------------------------------------------------------------------------
/Resource/targets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Resource/targets.png
--------------------------------------------------------------------------------
/Script/TemplateModule/Template.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template.xcodeproj/xcuserdata/yangke.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Template.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 | TemplateBundle.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 1
16 |
17 | TemplateModule.xcscheme_^#shared#^_
18 |
19 | orderHint
20 | 0
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Common/Definition/TemplateModule-Definition.h:
--------------------------------------------------------------------------------
1 | //
2 | // TemplateModule-Definition.h
3 | // TemplateModule
4 | //
5 | // Created by chengfei xiao on 2018/3/29.
6 | //
7 |
8 | #ifndef TemplateModule_Definition_h
9 | #define TemplateModule_Definition_h
10 |
11 |
12 | #endif /* TemplateModule_Definition_h */
13 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Common/Kits/Kits.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/Template/Common/Kits/Kits.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Feature/SampleFeature/Controller/Controller.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/Template/Feature/SampleFeature/Controller/Controller.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Feature/SampleFeature/Model/Model.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/Template/Feature/SampleFeature/Model/Model.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Feature/SampleFeature/Service/Service.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/Template/Feature/SampleFeature/Service/Service.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Feature/SampleFeature/View/View.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/Template/Feature/SampleFeature/View/View.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Module/TemplateBundle.h:
--------------------------------------------------------------------------------
1 | //
2 | // YZTemplateBundle.h
3 | // TemplateModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "ModuleBundle.h"
10 |
11 | @interface TemplateBundle : ModuleBundle
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Module/TemplateBundle.m:
--------------------------------------------------------------------------------
1 | //
2 | // TemplateBundle.m
3 | // TemplateModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "TemplateBundle.h"
10 |
11 | @implementation TemplateBundle
12 |
13 | + (NSBundle *)bundle{
14 | return [self.class bundleWithName:@"TemplateBundle"];
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Module/TemplateModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // TemplateModule.h
3 | // TemplateModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import "TemplateModuleService.h"
10 |
11 | @interface TemplateModule : NSObject
12 |
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Script/TemplateModule/Template/Module/TemplateModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // TemplateModule.m
3 | // TemplateModule
4 | //
5 | // Created by youzan on 2017/2/28.
6 | // Copyright (c) 2017年 youzan. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "TemplateModule.h"
11 |
12 | @interface TemplateModule()
13 |
14 | @end
15 |
16 | @implementation TemplateModule
17 |
18 | + (void)load {
19 | //如果只使用TemplateModule,而没有相应的phoneModule或者padModule的话,需要在基类里注册模块,需要把下面的注释放开,否则因为phoneModule或者padModule已经注册了模块,所以基类无须再注册
20 | // BFRegister(TemplateModuleService);
21 | }
22 |
23 | #pragma mark - BifrostModuleProtocol methods
24 |
25 | + (instancetype)sharedInstance {
26 | static TemplateModule *instance = nil;
27 | static dispatch_once_t onceToken;
28 | dispatch_once(&onceToken, ^{
29 | instance = [[self alloc] init];
30 | });
31 | return instance;
32 | }
33 |
34 | - (void)setup {
35 |
36 | }
37 |
38 | #pragma mark - TemplateModuleService
39 |
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/Script/TemplateModule/TemplateBundle/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2019 yangke. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Script/TemplateModule/TemplateBundle/Resource/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/Script/TemplateModule/TemplateBundle/Resource/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Script/TemplateModule/TemplateBundle/Resource/Audio/Audio.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/TemplateBundle/Resource/Audio/Audio.txt
--------------------------------------------------------------------------------
/Script/TemplateModule/TemplateBundle/Resource/Video/Video.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/youzan/Bifrost/a1af5b0ecb5909d289a8e4641ccf3c8b23b175fe/Script/TemplateModule/TemplateBundle/Resource/Video/Video.txt
--------------------------------------------------------------------------------
/Script/createModule.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Cashier="Cashier"
4 | # templateName="SampleModule"
5 | # Common="Common"
6 | # Phone="Phone"
7 | # Pad="Pad"
8 |
9 | # Template
10 |
11 | ModuleName=$1
12 |
13 | if [[ "$ModuleName"x == "x" ]]; then
14 | echo "Please provide ModuleName!!!"
15 | exit
16 | fi
17 |
18 | # git clone "git@gitlab.qima-inc.com:normandy-ios/ZanXcodeTemplates.git"
19 |
20 | # cd ./ZanXcodeTemplates/Samples
21 |
22 | rm -rf $ModuleName
23 | cp -r TemplateModule $ModuleName
24 | cd $ModuleName
25 |
26 | echo ""
27 | echo "Replacing placeholders in all files..."
28 | sed -i "" "s/Template/$ModuleName/g" `grep Template -rl "./Template"`
29 | sed -i "" "s/Template/$ModuleName/g" `grep Template -rl "./Template.xcodeproj"`
30 |
31 | echo ""
32 | echo "Renaming folders and files..."
33 | IFS=$'\n'
34 | for ((i=0; i<1;))
35 | do
36 | i=1
37 | for file in `find . -name "*Template*"`
38 | do
39 | i=0
40 | newFile=${file//Template/$ModuleName}
41 | mv "$file" "$newFile"
42 | echo "Renamed $file to $newFile"
43 | break
44 | done
45 | done
46 |
47 | echo "Done! Now you have your $ModuleName project."
48 | open .
49 |
--------------------------------------------------------------------------------