├── JSDRouterGuide.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcuserdata
│ └── Jersey.xcuserdatad
│ └── xcschemes
│ └── xcschememanagement.plist
├── JSDRouterGuide.xcworkspace
├── contents.xcworkspacedata
├── xcshareddata
│ └── IDEWorkspaceChecks.plist
└── xcuserdata
│ └── Jersey.xcuserdatad
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
├── JSDRouterGuide
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── App Store-1024.png
│ │ ├── CarPlay-60@2x.png
│ │ ├── CarPlay-60@3x.png
│ │ ├── Contents.json
│ │ ├── iPad App-76.png
│ │ ├── iPad App-76@2x.png
│ │ ├── iPad Notifications-20.png
│ │ ├── iPad Notifications-20@2x.png
│ │ ├── iPad Pro App-83.5@2x.png
│ │ ├── iPad Settings-29.png
│ │ ├── iPad Settings-29@2x.png
│ │ ├── iPad Spotlight-40.png
│ │ ├── iPad Spotlight-40@2x.png
│ │ ├── iPhone App-60@2x.png
│ │ ├── iPhone App-60@3x.png
│ │ ├── iPhone Notification-20@2x.png
│ │ ├── iPhone Notification-20@3x.png
│ │ ├── iPhone Settings-29@2x.png
│ │ ├── iPhone Settings-29@3x.png
│ │ ├── iPhone Spotlight-40@2x.png
│ │ └── iPhone Spotlight-40@3x.png
│ ├── Contents.json
│ ├── tab_coffee.imageset
│ │ ├── Contents.json
│ │ ├── tab_coffee@2x.png
│ │ └── tab_coffee@3x.png
│ ├── tab_coffee_pre.imageset
│ │ ├── Contents.json
│ │ ├── tab_coffee_pre@2x.png
│ │ └── tab_coffee_pre@3x.png
│ ├── tab_discover.imageset
│ │ ├── Contents.json
│ │ ├── tab_discover@2x.png
│ │ └── tab_discover@3x.png
│ ├── tab_discover_pre.imageset
│ │ ├── Contents.json
│ │ ├── tab_discover_pre@2x.png
│ │ └── tab_discover_pre@3x.png
│ ├── tab_home.imageset
│ │ ├── Contents.json
│ │ ├── tab_home@2x.png
│ │ └── tab_home@3x.png
│ ├── tab_home_pre.imageset
│ │ ├── Contents.json
│ │ ├── tab_home_pre@2x.png
│ │ └── tab_home_pre@3x.png
│ ├── tab_me.imageset
│ │ ├── Contents.json
│ │ ├── tab_me@2x.png
│ │ └── tab_me@3x.png
│ └── tab_me_pre.imageset
│ │ ├── Contents.json
│ │ ├── tab_me_pre@2x.png
│ │ └── tab_me_pre@3x.png
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Base
│ ├── JSDBaseNavigationController.h
│ ├── JSDBaseNavigationController.m
│ ├── JSDBaseViewController.h
│ ├── JSDBaseViewController.m
│ ├── JSDRootTabBarController.h
│ └── JSDRootTabBarController.m
├── Category
│ ├── UIViewController+JSDTool.h
│ └── UIViewController+JSDTool.m
├── Info.plist
├── JSDPrefixHeader.pch
├── Moudles
│ ├── Cafe
│ │ ├── JSDCafeVC.h
│ │ └── JSDCafeVC.m
│ ├── Coffee
│ │ ├── JSDCoffeeVC.h
│ │ └── JSDCoffeeVC.m
│ ├── Home
│ │ ├── JSDHomeVC.h
│ │ └── JSDHomeVC.m
│ ├── MyCenter
│ │ ├── JSDMyCenterVC.h
│ │ └── JSDMyCenterVC.m
│ └── TestRouterSkip
│ │ ├── Appear
│ │ ├── JSDAppearNotNeedLogInVC.h
│ │ ├── JSDAppearNotNeedLogInVC.m
│ │ ├── JSDAppearVC.h
│ │ └── JSDAppearVC.m
│ │ ├── Login
│ │ ├── JSDLoginVC.h
│ │ └── JSDLoginVC.m
│ │ ├── Register
│ │ ├── JSDRegisterVC.h
│ │ └── JSDRegisterVC.m
│ │ └── Web
│ │ ├── JSDWebViewVC.h
│ │ └── JSDWebViewVC.m
├── Router
│ ├── JSDVCRouter+Handle.h
│ ├── JSDVCRouter+Handle.m
│ ├── JSDVCRouter.h
│ ├── JSDVCRouter.m
│ ├── JSDVCRouterConfig.h
│ └── JSDVCRouterConfig.m
└── main.m
├── Podfile
├── Podfile.lock
├── Pods
├── JLRoutes
│ ├── JLRoutes
│ │ ├── JLRoutes.h
│ │ └── JLRoutes.m
│ ├── LICENSE
│ └── README.md
├── Manifest.lock
├── Masonry
│ ├── LICENSE
│ ├── Masonry
│ │ ├── MASCompositeConstraint.h
│ │ ├── MASCompositeConstraint.m
│ │ ├── MASConstraint+Private.h
│ │ ├── MASConstraint.h
│ │ ├── MASConstraint.m
│ │ ├── MASConstraintMaker.h
│ │ ├── MASConstraintMaker.m
│ │ ├── MASLayoutConstraint.h
│ │ ├── MASLayoutConstraint.m
│ │ ├── MASUtilities.h
│ │ ├── MASViewAttribute.h
│ │ ├── MASViewAttribute.m
│ │ ├── MASViewConstraint.h
│ │ ├── MASViewConstraint.m
│ │ ├── Masonry.h
│ │ ├── NSArray+MASAdditions.h
│ │ ├── NSArray+MASAdditions.m
│ │ ├── NSArray+MASShorthandAdditions.h
│ │ ├── NSLayoutConstraint+MASDebugAdditions.h
│ │ ├── NSLayoutConstraint+MASDebugAdditions.m
│ │ ├── View+MASAdditions.h
│ │ ├── View+MASAdditions.m
│ │ ├── View+MASShorthandAdditions.h
│ │ ├── ViewController+MASAdditions.h
│ │ └── ViewController+MASAdditions.m
│ └── README.md
├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── Jersey.xcuserdatad
│ │ └── xcschemes
│ │ ├── JLRoutes.xcscheme
│ │ ├── Masonry.xcscheme
│ │ ├── Pods-JSDRouterGuide.xcscheme
│ │ └── xcschememanagement.plist
└── Target Support Files
│ ├── JLRoutes
│ ├── JLRoutes-Info.plist
│ ├── JLRoutes-dummy.m
│ ├── JLRoutes-prefix.pch
│ ├── JLRoutes-umbrella.h
│ ├── JLRoutes.modulemap
│ └── JLRoutes.xcconfig
│ ├── Masonry
│ ├── Masonry-Info.plist
│ ├── Masonry-dummy.m
│ ├── Masonry-prefix.pch
│ ├── Masonry-umbrella.h
│ ├── Masonry.modulemap
│ └── Masonry.xcconfig
│ └── Pods-JSDRouterGuide
│ ├── Pods-JSDRouterGuide-Info.plist
│ ├── Pods-JSDRouterGuide-acknowledgements.markdown
│ ├── Pods-JSDRouterGuide-acknowledgements.plist
│ ├── Pods-JSDRouterGuide-dummy.m
│ ├── Pods-JSDRouterGuide-frameworks-Debug-input-files.xcfilelist
│ ├── Pods-JSDRouterGuide-frameworks-Debug-output-files.xcfilelist
│ ├── Pods-JSDRouterGuide-frameworks-Release-input-files.xcfilelist
│ ├── Pods-JSDRouterGuide-frameworks-Release-output-files.xcfilelist
│ ├── Pods-JSDRouterGuide-frameworks.sh
│ ├── Pods-JSDRouterGuide-umbrella.h
│ ├── Pods-JSDRouterGuide.debug.xcconfig
│ ├── Pods-JSDRouterGuide.modulemap
│ └── Pods-JSDRouterGuide.release.xcconfig
└── README.md
/JSDRouterGuide.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/JSDRouterGuide.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/JSDRouterGuide.xcodeproj/xcuserdata/Jersey.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | JSDRouterGuide.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 3
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/JSDRouterGuide.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/JSDRouterGuide.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/JSDRouterGuide.xcworkspace/xcuserdata/Jersey.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/JSDRouterGuide/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow * window;
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/JSDRouterGuide/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "JSDRootTabBarController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
22 | self.window.rootViewController = [[JSDRootTabBarController alloc] init];
23 | [self.window makeKeyAndVisible];
24 |
25 | return YES;
26 | }
27 |
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/App Store-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/App Store-1024.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/CarPlay-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/CarPlay-60@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/CarPlay-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/CarPlay-60@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"size":"20x20","idiom":"iphone","filename":"iPhone Notification-20@2x.png","appearances":null,"scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"iPhone Notification-20@3x.png","appearances":null,"scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"iPhone Settings-29@2x.png","appearances":null,"scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"iPhone Settings-29@3x.png","appearances":null,"scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"iPhone Spotlight-40@2x.png","appearances":null,"scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"iPhone Spotlight-40@3x.png","appearances":null,"scale":"3x"},{"size":"60x60","idiom":"iphone","filename":"iPhone App-60@2x.png","appearances":null,"scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"iPhone App-60@3x.png","appearances":null,"scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"iPad Notifications-20.png","appearances":null,"scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"iPad Notifications-20@2x.png","appearances":null,"scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"iPad Settings-29.png","appearances":null,"scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"iPad Settings-29@2x.png","appearances":null,"scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"iPad Spotlight-40.png","appearances":null,"scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"iPad Spotlight-40@2x.png","appearances":null,"scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"iPad App-76.png","appearances":null,"scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"iPad App-76@2x.png","appearances":null,"scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"iPad Pro App-83.5@2x.png","appearances":null,"scale":"2x"},{"size":"60x60","idiom":"car","filename":"CarPlay-60@2x.png","appearances":null,"scale":"2x"},{"size":"60x60","idiom":"car","filename":"CarPlay-60@3x.png","appearances":null,"scale":"3x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"App Store-1024.png","appearances":null,"scale":"1x"}],"info":{"version":1,"author":"xcode"}}
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad App-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad App-76.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad App-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad App-76@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Notifications-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Notifications-20.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Notifications-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Notifications-20@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Pro App-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Pro App-83.5@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Settings-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Settings-29.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Settings-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Settings-29@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Spotlight-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Spotlight-40.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Spotlight-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPad Spotlight-40@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone App-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone App-60@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone App-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone App-60@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Notification-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Notification-20@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Notification-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Notification-20@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Settings-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Settings-29@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Settings-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Settings-29@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight-40@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight-40@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_coffee@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_coffee@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee.imageset/tab_coffee@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_coffee.imageset/tab_coffee@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee.imageset/tab_coffee@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_coffee.imageset/tab_coffee@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee_pre.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_coffee_pre@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_coffee_pre@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee_pre.imageset/tab_coffee_pre@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_coffee_pre.imageset/tab_coffee_pre@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_coffee_pre.imageset/tab_coffee_pre@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_coffee_pre.imageset/tab_coffee_pre@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_discover@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_discover@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover.imageset/tab_discover@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_discover.imageset/tab_discover@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover.imageset/tab_discover@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_discover.imageset/tab_discover@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover_pre.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_discover_pre@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_discover_pre@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover_pre.imageset/tab_discover_pre@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_discover_pre.imageset/tab_discover_pre@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_discover_pre.imageset/tab_discover_pre@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_discover_pre.imageset/tab_discover_pre@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_home@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_home@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home.imageset/tab_home@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_home.imageset/tab_home@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home.imageset/tab_home@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_home.imageset/tab_home@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home_pre.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_home_pre@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_home_pre@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home_pre.imageset/tab_home_pre@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_home_pre.imageset/tab_home_pre@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_home_pre.imageset/tab_home_pre@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_home_pre.imageset/tab_home_pre@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_me@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_me@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me.imageset/tab_me@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_me.imageset/tab_me@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me.imageset/tab_me@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_me.imageset/tab_me@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me_pre.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_me_pre@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tab_me_pre@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me_pre.imageset/tab_me_pre@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_me_pre.imageset/tab_me_pre@2x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Assets.xcassets/tab_me_pre.imageset/tab_me_pre@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JerseyCoffee/JSDRouterGuide/c40d160c193cdc6a02e347c97a835d5452bc8128/JSDRouterGuide/Assets.xcassets/tab_me_pre.imageset/tab_me_pre@3x.png
--------------------------------------------------------------------------------
/JSDRouterGuide/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDBaseNavigationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDBaseNavigationController.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDBaseNavigationController : UINavigationController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDBaseNavigationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDBaseNavigationController.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseNavigationController.h"
10 |
11 | @interface JSDBaseNavigationController ()
12 |
13 | @end
14 |
15 | @implementation JSDBaseNavigationController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | - (void)viewWillAppear:(BOOL)animated {
23 |
24 | [super viewWillAppear:animated];
25 | }
26 |
27 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
28 | {
29 | NSInteger count = self.viewControllers.count;
30 | if (count > 0) {
31 | //push后隐藏tabBar
32 | viewController.hidesBottomBarWhenPushed = YES;
33 | }
34 | [super pushViewController:viewController animated:animated];
35 | }
36 |
37 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated
38 | {
39 | NSInteger count = viewControllers.count;
40 | if (count > 1) {
41 | //push后隐藏tabBar
42 | viewControllers.lastObject.hidesBottomBarWhenPushed = YES;
43 | }
44 | [super setViewControllers:viewControllers animated:animated];
45 | }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDBaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDBaseViewController.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDBaseViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDBaseViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDBaseViewController.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | @interface JSDBaseViewController ()
12 |
13 | @end
14 |
15 | @implementation JSDBaseViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | self.view.backgroundColor = [UIColor whiteColor];
21 | }
22 |
23 | - (void)viewWillAppear:(BOOL)animated {
24 |
25 | [super viewWillAppear:animated];
26 | }
27 |
28 | - (void)viewWillDisappear:(BOOL)animated {
29 |
30 | [super viewWillDisappear:animated];
31 | }
32 |
33 | /*
34 | #pragma mark - Navigation
35 |
36 | // In a storyboard-based application, you will often want to do a little preparation before navigation
37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
38 | // Get the new view controller using [segue destinationViewController].
39 | // Pass the selected object to the new view controller.
40 | }
41 | */
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDRootTabBarController.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDRootTabBarController.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDRootTabBarController : UITabBarController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Base/JSDRootTabBarController.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDRootTabBarController.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDRootTabBarController.h"
10 | #import "JSDCoffeeVC.h"
11 | #import "JSDLoginVC.h"
12 | #import "JSDCafeVC.h"
13 | #import "JSDMyCenterVC.h"
14 | #import "JSDHomeVC.h"
15 | #import "JSDBaseNavigationController.h"
16 |
17 | @interface JSDRootTabBarController ()
18 |
19 | @end
20 |
21 | @implementation JSDRootTabBarController
22 |
23 | - (instancetype)init {
24 |
25 | if (self = [super init]) {
26 |
27 |
28 | }
29 | return self;
30 | }
31 |
32 | - (void)viewDidLoad {
33 | [super viewDidLoad];
34 | // Do any additional setup after loading the view.
35 |
36 | [self setupVC];
37 |
38 | }
39 |
40 | - (void)setupVC {
41 |
42 | NSArray* vcArray = @[@"JSDHomeVC",@"JSDCafeVC",@"JSDCoffeeVC",@"JSDMyCenterVC"];
43 | NSArray* titleArray = @[@"Home",@"Cafe",@"Coffee",@"My"];
44 | NSMutableArray* tempArray = NSMutableArray.new;
45 |
46 | for (NSInteger i = 0; i < vcArray.count; i++) {
47 | UIViewController* vc = [NSClassFromString(vcArray[i]) alloc];
48 | UINavigationController* navigationVC = [[JSDBaseNavigationController alloc] initWithRootViewController:vc];
49 | vc.navigationItem.title = navigationVC.tabBarItem.title = titleArray[i];
50 | [tempArray addObject:navigationVC];
51 |
52 | }
53 | [self setViewControllers:tempArray.copy];
54 |
55 | NSArray* imageArray = @[@"tab_home",@"tab_discover",@"tab_coffee",@"tab_me"];
56 | NSArray* selectedImageArray = @[@"tab_home_pre",@"tab_discover_pre",@"tab_coffee_pre",@"tab_me_pre"];
57 | for (int i=0; i < self.tabBar.items.count; i++) {
58 | UITabBarItem *tabBarItem = [self.tabBar.items objectAtIndex:i];
59 | tabBarItem.image = [UIImage imageNamed:imageArray[i]];
60 | tabBarItem.selectedImage = [UIImage imageNamed:selectedImageArray[i]];
61 | }
62 | }
63 |
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Category/UIViewController+JSDTool.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+JSDTool.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 13/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIViewController (JSDTool)
14 |
15 | + (UIViewController* )jsd_rootViewController;
16 | + (UIViewController* )jsd_findVisibleViewController;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Category/UIViewController+JSDTool.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+JSDTool.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 13/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "UIViewController+JSDTool.h"
10 |
11 |
12 | @implementation UIViewController (JSDTool)
13 |
14 | + (UIViewController *)jsd_rootViewController {
15 |
16 | return [UIApplication sharedApplication].delegate.window.rootViewController;
17 | }
18 |
19 | + (UIViewController *)jsd_findVisibleViewController {
20 |
21 | UIViewController* currentViewController = [self jsd_rootViewController];
22 |
23 | BOOL runLoopFind = YES;
24 | while (runLoopFind) {
25 | if (currentViewController.presentedViewController) {
26 | currentViewController = currentViewController.presentedViewController;
27 | } else {
28 | if ([currentViewController isKindOfClass:[UINavigationController class]]) {
29 | currentViewController = ((UINavigationController *)currentViewController).visibleViewController;
30 | } else if ([currentViewController isKindOfClass:[UITabBarController class]]) {
31 | currentViewController = ((UITabBarController* )currentViewController).selectedViewController;
32 | } else {
33 | break;
34 | }
35 | }
36 | }
37 |
38 | return currentViewController;
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/JSDRouterGuide/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
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 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/JSDRouterGuide/JSDPrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // JSDPrefixHeader.pch
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #ifndef JSDPrefixHeader_pch
10 | #define JSDPrefixHeader_pch
11 |
12 | // Include any system framework and library headers here that should be included in all compilation units.
13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
14 | #import
15 | #import "JSDVCRouter.h"
16 |
17 |
18 | #endif /* JSDPrefixHeader_pch */
19 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Cafe/JSDCafeVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDCafeVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDCafeVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Cafe/JSDCafeVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDCafeVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDCafeVC.h"
10 |
11 | @interface JSDCafeVC ()
12 |
13 | @property(nonatomic, strong) NSString *routerName;
14 |
15 | @end
16 |
17 | @implementation JSDCafeVC
18 |
19 | #pragma mark - View Controller Life Cycle
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | // Do any additional setup after loading the view.
23 |
24 | //1.设置导航栏
25 | [self setupNavBar];
26 | //2.设置view
27 | [self setupView];
28 | //3.请求数据
29 | [self setupData];
30 | //5.解析数据
31 | [self setupAnalyticalData];
32 | //6.设置通知
33 | [self setupNotification];
34 | //7.private
35 | [self setupPrivateMethod];
36 | }
37 |
38 | #pragma mark - 2 SettingView and Style
39 |
40 | -(void)setupNavBar {
41 |
42 | }
43 |
44 | - (void)setupView {
45 |
46 | self.routerName ? NSLog(@"%@", self.routerName): NULL;
47 | }
48 |
49 | - (void)reloadingView {
50 |
51 |
52 | }
53 |
54 | #pragma mark - 3 Request Data
55 |
56 | - (void)setupData {
57 |
58 |
59 | }
60 |
61 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
62 | #pragma mark - 5 Event Response
63 |
64 |
65 | - (void)setupAnalyticalData {
66 |
67 |
68 | }
69 | #pragma mark - 6 Private Methods
70 |
71 | - (void)setupNotification {
72 |
73 | }
74 |
75 | - (void)setupPrivateMethod {
76 |
77 |
78 | }
79 |
80 | #pragma mark - 7 GET & SET
81 |
82 |
83 |
84 |
85 | /*
86 | #pragma mark - Navigation
87 |
88 | // In a storyboard-based application, you will often want to do a little preparation before navigation
89 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
90 | // Get the new view controller using [segue destinationViewController].
91 | // Pass the selected object to the new view controller.
92 | }
93 | */
94 |
95 | @end
96 |
97 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Coffee/JSDCoffeeVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDCoffeeVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDCoffeeVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Coffee/JSDCoffeeVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDCoffeeVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDCoffeeVC.h"
10 |
11 | @interface JSDCoffeeVC ()
12 |
13 | @property(nonatomic, strong) NSString *router;
14 |
15 | @end
16 |
17 | @implementation JSDCoffeeVC
18 |
19 | #pragma mark - View Controller Life Cycle
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | // Do any additional setup after loading the view.
23 |
24 | //1.设置导航栏
25 | [self setupNavBar];
26 | //2.设置view
27 | [self setupView];
28 | //3.请求数据
29 | [self setupData];
30 | //5.解析数据
31 | [self setupAnalyticalData];
32 | //6.设置通知
33 | [self setupNotification];
34 | //7.private
35 | [self setupPrivateMethod];
36 | }
37 |
38 | #pragma mark - 2 SettingView and Style
39 |
40 | -(void)setupNavBar {
41 |
42 |
43 |
44 | }
45 |
46 | - (void)setupView {
47 |
48 | if (self.router) {
49 | NSLog(@"%@", self.router);
50 | }
51 | }
52 |
53 | - (void)reloadingView {
54 |
55 |
56 | }
57 |
58 | #pragma mark - 3 Request Data
59 |
60 | - (void)setupData {
61 |
62 |
63 | }
64 |
65 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
66 |
67 | #pragma mark - 5 Event Response
68 |
69 | - (void)setupAnalyticalData {
70 |
71 |
72 | }
73 | #pragma mark - 6 Private Methods
74 |
75 | - (void)setupNotification {
76 |
77 | }
78 |
79 | - (void)setupPrivateMethod {
80 |
81 |
82 | }
83 |
84 | #pragma mark - 7 GET & SET
85 |
86 |
87 |
88 |
89 | /*
90 | #pragma mark - Navigation
91 |
92 | // In a storyboard-based application, you will often want to do a little preparation before navigation
93 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
94 | // Get the new view controller using [segue destinationViewController].
95 | // Pass the selected object to the new view controller.
96 | }
97 | */
98 |
99 | @end
100 |
101 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Home/JSDHomeVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDHomeVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 |
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @interface JSDHomeVC : JSDBaseViewController
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/Home/JSDHomeVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDHomeVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDHomeVC.h"
10 |
11 | @interface JSDHomeVC ()
12 |
13 | @property(nonatomic, strong) UIStackView *stackView;
14 | @property(nonatomic, strong) UILabel *loginStatuLabel;
15 | @property(nonatomic, strong) UISwitch *loginSwitch;
16 |
17 | @end
18 |
19 | @implementation JSDHomeVC
20 | {
21 | NSArray* _titleArray;
22 | }
23 |
24 | #pragma mark - View Controller Life Cycle
25 | - (void)viewDidLoad {
26 | [super viewDidLoad];
27 | // Do any additional setup after loading the view.
28 |
29 | //1.设置导航栏
30 | [self setupNavBar];
31 | //2.设置view
32 | [self setupView];
33 | //3.请求数据
34 | [self setupData];
35 | //5.解析数据
36 | [self setupAnalyticalData];
37 | //6.设置通知
38 | [self setupNotification];
39 | //7.private
40 | [self setupPrivateMethod];
41 | }
42 |
43 | - (void)viewWillAppear:(BOOL)animated {
44 |
45 | self.loginSwitch.on = userIsLogin;
46 | if (userIsLogin) {
47 | self.loginStatuLabel.text = @"当前用户状态:已登录";
48 | } else {
49 | self.loginStatuLabel.text = @"当前用户状态:未登录";
50 | }
51 |
52 | [super viewWillAppear:animated];
53 | }
54 |
55 | #pragma mark - 2 SettingView and Style
56 |
57 | -(void)setupNavBar {
58 |
59 | }
60 |
61 | - (void)setupView {
62 |
63 | [self.view addSubview:self.loginStatuLabel];
64 | [self.view addSubview:self.loginSwitch];
65 | //left
66 | [self.loginStatuLabel mas_makeConstraints:^(MASConstraintMaker *make) {
67 | make.centerX.mas_equalTo(-15);
68 | make.top.mas_equalTo(20);
69 | }];
70 |
71 | [self.loginSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
72 | make.centerY.mas_equalTo(self.loginStatuLabel);
73 | make.left.mas_equalTo(self.loginStatuLabel.mas_right).mas_offset(20);
74 | }];
75 |
76 | //push, modal, pop, pop index, dismiss, 传参, callback, newNavigation;
77 | [self.view addSubview:self.stackView];
78 | [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
79 | make.top.mas_equalTo(self.loginStatuLabel.mas_bottom).mas_offset(20);
80 | make.left.mas_equalTo(15);
81 | make.trailing.mas_equalTo(-15);
82 | }];
83 |
84 | _titleArray = @[@"Push 到 JSDAppearVC",@"Modal 到 JSDAppearVC",@"切换 TabBar Index 到 Cafe",@"切换 TabBar Index 到 Coffee",@"Push 到 JSDAppearVC 带参数 name",@"Modal 到 JSDAppearVC 带参数 name",@"Modal 并且让呈现的VC带导航栏",@"callback + 参数", @"Push 到 JSDAppearVC 不要求登陆页", @"Modal 到 JSDAppearVC 不要求登陆页",@"Modal 到 JSDAppearVC 不要求登陆页, 并指定其导航栏"];
85 | for (NSString* title in _titleArray) {
86 | UIButton* btn = [UIButton buttonWithType:UIButtonTypeSystem];
87 | [btn setTitle:title forState:UIControlStateNormal];
88 | btn.tag = [_titleArray indexOfObject:title];
89 | [btn addTarget:self action:@selector(onTouchRoute:) forControlEvents:UIControlEventTouchUpInside];
90 | btn.titleLabel.numberOfLines = 0;
91 | btn.titleLabel.textAlignment = NSTextAlignmentCenter;
92 | [self.stackView addArrangedSubview:btn];
93 | }
94 | }
95 |
96 | - (void)reloadingView {
97 |
98 |
99 | }
100 |
101 | #pragma mark - 3 Request Data
102 |
103 | - (void)setupData {
104 |
105 |
106 | }
107 |
108 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
109 |
110 | #pragma mark - 5 Event Response
111 |
112 | - (void)setupAnalyticalData {
113 |
114 |
115 | }
116 |
117 | - (void)onTouchRoute:(UIButton *)sender {
118 | //Push",@"Modal",@"Pop",@"Dismiss",@"Push 带参数",@"Modal 带参数",@"Modal 并且让呈现的VC带导航栏",@"callback"
119 | switch (sender.tag) {
120 | case 0:{ //Push
121 | [JSDVCRouter openURL:JSDVCRouteAppear];
122 | }
123 | break;
124 | case 1:{ //Modal
125 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal}];
126 | }
127 | break;
128 | case 2:{ //切换 TabBar Index 到 Cafe
129 | [JSDVCRouter openURL:JSDVCRouteCafeTab parameters:@{@"routerName": @"JSDRouter"}];
130 | }
131 | break;
132 | case 3:{ //切换 TabBar Index 到 Coffee
133 | [JSDVCRouter openURL:JSDVCRouteCoffeeTab parameters:@{@"router": @"JLRouter"}];
134 | }
135 | break;
136 | case 4:{ //Push 带参数
137 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{@"name": @"Jersey"}];
138 | }
139 | break;
140 | case 5:{ //Modal 带参数
141 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal,@"name": @"Jersey"}];
142 | }
143 | break;
144 | case 6:{ //Modal 并且让呈现的VC带导航栏
145 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal, kJSDVCRouteSegueNeedNavigation: @(YES)}];
146 | }
147 | break;
148 | case 7:{ //callback + 参数
149 | void (^callback)(void) = ^{
150 | NSLog(@"执行回调函数");
151 | };
152 | void (^callback2)(NSString *) = ^(NSString *name) {
153 | NSLog(@"执行回调函数2, 我是%@", name);
154 | };
155 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{@"name": @"Jersey", @"callback": callback, @"callback2": callback2}];
156 | }
157 | break;
158 | case 8:{ //Push 到 JSDAppearVC 不要求登陆页
159 | [JSDVCRouter openURL:JSDVCRouteAppearNotNeedLogin parameters:@{kJSDVCRouteSegue: kJSDVCRouteSeguePush}];
160 | }
161 | break;
162 | case 9:{ //Modal 到 JSDAppearVC 不要求登陆页
163 | [JSDVCRouter openURL:JSDVCRouteAppearNotNeedLogin parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal}];
164 | }
165 | break;
166 | case 10:{ //Modal 到 JSDAppearVC 不要求登陆页, 并指定其导航栏
167 | [JSDVCRouter openURL:JSDVCRouteAppearNotNeedLogin parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal, kJSDVCRouteSegueNeedNavigation: @(YES)}];
168 | }
169 | default:
170 | break;
171 | }
172 | }
173 |
174 | - (void)onTouchLogin:(UISwitch *)sender {
175 |
176 | userIsLogin = sender.on;
177 | if (userIsLogin) {
178 | self.loginStatuLabel.text = @"当前用户状态:已登录";
179 | } else {
180 | self.loginStatuLabel.text = @"当前用户状态:未登录";
181 | }
182 | }
183 |
184 | #pragma mark - 6 Private Methods
185 |
186 | - (void)setupNotification {
187 |
188 | }
189 |
190 | - (void)setupPrivateMethod {
191 |
192 |
193 | }
194 |
195 | #pragma mark - 7 GET & SET
196 |
197 | - (UIStackView *)stackView {
198 |
199 | if (!_stackView) {
200 | _stackView = [[UIStackView alloc] init];
201 | [_stackView setAxis:UILayoutConstraintAxisVertical];
202 | [_stackView setSpacing:3];
203 | }
204 | return _stackView;
205 | }
206 |
207 | - (UILabel *)loginStatuLabel {
208 |
209 | if (!_loginStatuLabel) {
210 | _loginStatuLabel = [[UILabel alloc] init];
211 | _loginStatuLabel.text = @"当前用户状态:未登录";
212 | }
213 | return _loginStatuLabel;
214 | }
215 |
216 | - (UISwitch *)loginSwitch {
217 |
218 | if (!_loginSwitch) {
219 | _loginSwitch = [[UISwitch alloc] init];
220 | _loginSwitch.on = NO;
221 | [_loginSwitch addTarget:self action:@selector(onTouchLogin:) forControlEvents:UIControlEventTouchUpInside];
222 | }
223 | return _loginSwitch;
224 | }
225 |
226 | @end
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/MyCenter/JSDMyCenterVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDMyCenterVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDMyCenterVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/MyCenter/JSDMyCenterVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDMyCenterVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDMyCenterVC.h"
10 |
11 | @interface JSDMyCenterVC ()
12 |
13 | @end
14 |
15 | @implementation JSDMyCenterVC
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | /*
23 | #pragma mark - Navigation
24 |
25 | // In a storyboard-based application, you will often want to do a little preparation before navigation
26 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
27 | // Get the new view controller using [segue destinationViewController].
28 | // Pass the selected object to the new view controller.
29 | }
30 | */
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Appear/JSDAppearNotNeedLogInVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDAppearNotNeedLogInVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 15/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDAppearNotNeedLogInVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Appear/JSDAppearNotNeedLogInVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDAppearNotNeedLogInVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 15/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDAppearNotNeedLogInVC.h"
10 |
11 | @interface JSDAppearNotNeedLogInVC ()
12 |
13 | @end
14 |
15 | @implementation JSDAppearNotNeedLogInVC
16 |
17 | #pragma mark - View Controller Life Cycle
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view.
21 |
22 | //1.设置导航栏
23 | [self setupNavBar];
24 | //2.设置view
25 | [self setupView];
26 | //3.请求数据
27 | [self setupData];
28 | //5.解析数据
29 | [self setupAnalyticalData];
30 | //6.设置通知
31 | [self setupNotification];
32 | //7.private
33 | [self setupPrivateMethod];
34 | }
35 |
36 | #pragma mark - 2 SettingView and Style
37 |
38 | -(void)setupNavBar {
39 |
40 | self.navigationItem.title = @"测试 Router 跳转,AppearVC 不需登陆";
41 | }
42 |
43 | - (void)setupView {
44 |
45 |
46 | }
47 |
48 | - (void)reloadingView {
49 |
50 |
51 | }
52 |
53 | #pragma mark - 3 Request Data
54 |
55 | - (void)setupData {
56 |
57 |
58 | }
59 |
60 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
61 | #pragma mark - 5 Event Response
62 |
63 |
64 | - (void)setupAnalyticalData {
65 |
66 |
67 | }
68 | #pragma mark - 6 Private Methods
69 |
70 | - (void)setupNotification {
71 |
72 | }
73 |
74 | - (void)setupPrivateMethod {
75 |
76 |
77 | }
78 |
79 | #pragma mark - 7 GET & SET
80 |
81 |
82 |
83 |
84 | /*
85 | #pragma mark - Navigation
86 |
87 | // In a storyboard-based application, you will often want to do a little preparation before navigation
88 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
89 | // Get the new view controller using [segue destinationViewController].
90 | // Pass the selected object to the new view controller.
91 | }
92 | */
93 |
94 | @end
95 |
96 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Appear/JSDAppearVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDAppearVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 15/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDAppearVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Appear/JSDAppearVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDAppearVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 15/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDAppearVC.h"
10 |
11 | @interface JSDAppearVC ()
12 |
13 | @property(nonatomic, strong) NSString *name;
14 | @property(nonatomic, strong) void(^callback)(void);
15 | @property(nonatomic, strong) void(^callback2)(NSString * name);
16 | @property(nonatomic, strong) UILabel *textLabel;
17 | @property(nonatomic, strong) UIButton *btn;
18 | @property(nonatomic, strong) UIButton *btn2;
19 | @property(nonatomic, strong) UIButton *btn3;
20 | @property(nonatomic, strong) UIButton *btn4;
21 | @property(nonatomic, strong) UILabel *handlerResultLabel;
22 | @property(nonatomic, strong) UILabel *testPushPopIndex;
23 | @property(nonatomic, strong) UIButton *pushButton;
24 | @property(nonatomic, strong) UIButton *popButton;
25 |
26 | @end
27 |
28 | @implementation JSDAppearVC
29 |
30 | #pragma mark - View Controller Life Cycle
31 | - (void)viewDidLoad {
32 | [super viewDidLoad];
33 | // Do any additional setup after loading the view.
34 |
35 | //1.设置导航栏
36 | [self setupNavBar];
37 | //2.设置view
38 | [self setupView];
39 | //3.请求数据
40 | [self setupData];
41 | //5.解析数据
42 | [self setupAnalyticalData];
43 | //6.设置通知
44 | [self setupNotification];
45 | //7.private
46 | [self setupPrivateMethod];
47 | }
48 |
49 | #pragma mark - 2 SettingView and Style
50 |
51 | -(void)setupNavBar {
52 |
53 | self.navigationItem.title = @"测试 Router 跳转,AppearVC 需登陆";
54 | }
55 |
56 | - (void)setupView {
57 |
58 | [self.view addSubview:self.textLabel];
59 | [self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
60 | make.centerX.mas_equalTo(0);
61 | make.top.mas_equalTo(100);
62 | }];
63 |
64 | [self.view addSubview:self.btn];
65 | [self.btn mas_makeConstraints:^(MASConstraintMaker *make) {
66 | make.centerX.mas_equalTo(0);
67 | make.top.mas_equalTo(self.textLabel.mas_bottom).mas_equalTo(25);
68 | }];
69 | [self.view addSubview:self.btn2];
70 | [self.btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
71 | make.centerX.mas_equalTo(0);
72 | make.top.mas_equalTo(self.btn.mas_bottom).mas_equalTo(25);
73 | }];
74 |
75 | [self.view addSubview:self.handlerResultLabel];
76 | [self.handlerResultLabel mas_makeConstraints:^(MASConstraintMaker *make) {
77 | make.centerX.mas_equalTo(0);
78 | make.top.mas_equalTo(self.btn2.mas_bottom).mas_equalTo(50);
79 | }];
80 |
81 | [self.view addSubview:self.btn3];
82 | [self.btn3 mas_makeConstraints:^(MASConstraintMaker *make) {
83 | make.centerX.mas_equalTo(0);
84 | make.top.mas_equalTo(self.handlerResultLabel.mas_bottom).mas_equalTo(25);
85 | }];
86 |
87 | [self.view addSubview:self.btn4];
88 | [self.btn4 mas_makeConstraints:^(MASConstraintMaker *make) {
89 | make.centerX.mas_equalTo(0);
90 | make.top.mas_equalTo(self.btn3.mas_bottom).mas_equalTo(25);
91 | }];
92 |
93 | [self reloadingView];
94 | }
95 |
96 | - (void)reloadingView {
97 |
98 | if (self.name) {
99 | self.textLabel.text = [NSString stringWithFormat:@"接收到的参数: name--%@", self.name];
100 | NSLog(@"%s, 接收到参数 Name: %@",__func__ ,self.name);
101 | } else {
102 | self.textLabel.text = @"无参数";
103 | }
104 | }
105 |
106 | #pragma mark - 3 Request Data
107 |
108 | - (void)setupData {
109 |
110 |
111 | }
112 |
113 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
114 | #pragma mark - 5 Event Response
115 |
116 | - (void)onTouchHandle:(UIButton*)sender {
117 |
118 | if (sender.tag == 0) {
119 | if (self.callback) {
120 | self.callback();
121 | self.handlerResultLabel.text = @"已执行回调1";
122 | } else {
123 | self.handlerResultLabel.text = @"未接收到回调函数";
124 | }
125 | } else if (sender.tag == 1) {
126 | if (self.callback2) {
127 | self.callback2(self.name);
128 | self.handlerResultLabel.text = @"已执行回调2";
129 | } else {
130 | self.handlerResultLabel.text = @"未接收到回调函数";
131 | }
132 | } else if (sender.tag == 2) {
133 | [JSDVCRouter openURL:JSDVCRouteAppear];
134 | } else if (sender.tag == 3) {
135 | [JSDVCRouter openURL:JSDVCRouteAppear parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal}];
136 | }
137 | }
138 |
139 | - (void)setupAnalyticalData {
140 |
141 |
142 | }
143 | #pragma mark - 6 Private Methods
144 |
145 | - (void)setupNotification {
146 |
147 | }
148 |
149 | - (void)setupPrivateMethod {
150 |
151 |
152 | }
153 |
154 | #pragma mark - 7 GET & SET
155 |
156 | - (UILabel *)textLabel {
157 |
158 | if (!_textLabel) {
159 | _textLabel = [[UILabel alloc] init];
160 | }
161 | return _textLabel;
162 | }
163 |
164 | - (UIButton *)btn {
165 |
166 | if (!_btn) {
167 | _btn = [UIButton buttonWithType:UIButtonTypeSystem];
168 | [_btn setTitle:@"执行回调1" forState:UIControlStateNormal];
169 | _btn.tag = 0;
170 | [_btn addTarget:self action:@selector(onTouchHandle:) forControlEvents:UIControlEventTouchUpInside];
171 | }
172 | return _btn;
173 | }
174 |
175 | - (UIButton *)btn2 {
176 |
177 | if (!_btn2) {
178 | _btn2 = [UIButton buttonWithType:UIButtonTypeSystem];
179 | [_btn2 setTitle:@"执行回调2" forState:UIControlStateNormal];
180 | _btn2.tag = 1;
181 | [_btn2 addTarget:self action:@selector(onTouchHandle:) forControlEvents:UIControlEventTouchUpInside];
182 | }
183 | return _btn2;
184 | }
185 |
186 | - (UIButton *)btn3 {
187 |
188 | if (!_btn3) {
189 | _btn3 = [UIButton buttonWithType:UIButtonTypeSystem];
190 | [_btn3 setTitle:@"Push到下一个 AppearVC" forState:UIControlStateNormal];
191 | _btn3.tag = 2;
192 | [_btn3 addTarget:self action:@selector(onTouchHandle:) forControlEvents:UIControlEventTouchUpInside];
193 | }
194 | return _btn3;
195 | }
196 |
197 | - (UIButton *)btn4 {
198 |
199 | if (!_btn4) {
200 | _btn4 = [UIButton buttonWithType:UIButtonTypeSystem];
201 | [_btn4 setTitle:@"Modal到下一个 AppearVC" forState:UIControlStateNormal];
202 | _btn4.tag = 3;
203 | [_btn4 addTarget:self action:@selector(onTouchHandle:) forControlEvents:UIControlEventTouchUpInside];
204 | }
205 | return _btn4;
206 | }
207 |
208 | - (UILabel *)handlerResultLabel {
209 |
210 | if (!_handlerResultLabel) {
211 | _handlerResultLabel = [[UILabel alloc] init];
212 |
213 | }
214 | return _handlerResultLabel;
215 | }
216 |
217 | - (UIButton *)pushButton {
218 |
219 |
220 | return nil;
221 | }
222 |
223 | /*
224 | #pragma mark - Navigation
225 |
226 | // In a storyboard-based application, you will often want to do a little preparation before navigation
227 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
228 | // Get the new view controller using [segue destinationViewController].
229 | // Pass the selected object to the new view controller.
230 | }
231 | */
232 |
233 | @end
234 |
235 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Login/JSDLoginVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDLoginVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDLoginVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Login/JSDLoginVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDLoginVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDLoginVC.h"
10 |
11 | @interface JSDLoginVC ()
12 |
13 | @property(nonatomic, strong) UILabel *guideLabel;
14 | @property(nonatomic, strong) UIButton *loginButton;
15 | @property(nonatomic, strong) UIButton *registerButton;
16 | @property(nonatomic, strong) UIButton *modalRegisterButton;
17 | @property(nonatomic, strong) UIButton *gobackButton;
18 | @property(nonatomic, strong) UIStackView *stackView;
19 |
20 | @end
21 |
22 | @implementation JSDLoginVC
23 |
24 | #pragma mark - View Controller Life Cycle
25 | - (void)viewDidLoad {
26 | [super viewDidLoad];
27 | // Do any additional setup after loading the view.
28 |
29 | //1.设置导航栏
30 | [self setupNavBar];
31 | //2.设置view
32 | [self setupView];
33 | //3.请求数据
34 | [self setupData];
35 | //5.解析数据
36 | [self setupAnalyticalData];
37 | //6.设置通知
38 | [self setupNotification];
39 | //7.private
40 | [self setupPrivateMethod];
41 | }
42 |
43 | #pragma mark - 2 SettingView and Style
44 |
45 | -(void)setupNavBar {
46 |
47 | self.navigationItem.title = @"登陆";
48 | }
49 |
50 | - (void)setupView {
51 |
52 | [self.view addSubview:self.stackView];
53 | [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
54 | make.top.mas_offset(100);
55 | make.left.mas_offset(30);
56 | make.right.mas_offset(-30);
57 | }];
58 |
59 | [self.stackView addArrangedSubview:self.guideLabel];
60 | [self.stackView addArrangedSubview:self.loginButton];
61 | [self.stackView addArrangedSubview:self.registerButton];
62 | [self.stackView addArrangedSubview:self.modalRegisterButton];
63 | [self.stackView addArrangedSubview:self.gobackButton];
64 | }
65 |
66 | - (void)reloadingView {
67 |
68 |
69 | }
70 |
71 | #pragma mark - 3 Request Data
72 |
73 | - (void)setupData {
74 |
75 |
76 | }
77 |
78 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
79 | #pragma mark - 5 Event Response
80 |
81 | - (void)onTouchLogin:(UIButton* )sender {
82 |
83 | userIsLogin = YES;
84 | }
85 |
86 | - (void)onTouchPushRegister:(UIButton *)sender {
87 |
88 | [JSDVCRouter openURL:JSDVCRouteRegister];
89 | }
90 |
91 | - (void)onTouchModalRegister:(UIButton *)sender {
92 |
93 | [JSDVCRouter openURL:JSDVCRouteRegister parameters:@{kJSDVCRouteSegue: kJSDVCRouteSegueModal}];
94 | }
95 |
96 | - (void)onTouchGoback:(UIButton *)sender {
97 |
98 | [JSDVCRouter openURL:kJSDVCRouteBackIndex];
99 | }
100 |
101 | - (void)setupAnalyticalData {
102 |
103 |
104 | }
105 | #pragma mark - 6 Private Methods
106 |
107 | - (void)setupNotification {
108 |
109 | }
110 |
111 | - (void)setupPrivateMethod {
112 |
113 |
114 | }
115 |
116 | #pragma mark - 7 GET & SET
117 |
118 | - (UILabel *)guideLabel {
119 |
120 | if (!_guideLabel) {
121 | _guideLabel = [[UILabel alloc] init];
122 | _guideLabel.text = @"由于当前状态为未登录状态, 我们手动配置 RouteMap 映射 kJSDVCRouteClassNeedLogin 值为 1 时,会在跳转过程拦截自动跳转到登陆页";
123 | _guideLabel.numberOfLines = 0;
124 | }
125 | return _guideLabel;
126 | }
127 |
128 | - (UIButton *)loginButton {
129 |
130 | if (!_loginButton) {
131 | _loginButton = [UIButton buttonWithType:UIButtonTypeSystem];
132 | [_loginButton setTitle:@"点击模拟登陆" forState:UIControlStateNormal];
133 | [_loginButton addTarget:self action:@selector(onTouchLogin:) forControlEvents:UIControlEventTouchUpInside];
134 | }
135 | return _loginButton;
136 | }
137 |
138 | - (UIButton *)registerButton {
139 |
140 | if (!_registerButton) {
141 | _registerButton = [UIButton buttonWithType:UIButtonTypeSystem];
142 | [_registerButton setTitle:@"Push到注册页" forState:UIControlStateNormal];
143 | [_registerButton addTarget:self action:@selector(onTouchPushRegister:) forControlEvents:UIControlEventTouchUpInside];
144 | }
145 | return _registerButton;
146 | }
147 |
148 | - (UIButton *)modalRegisterButton {
149 |
150 | if (!_modalRegisterButton) {
151 | _modalRegisterButton = [UIButton buttonWithType:UIButtonTypeSystem];
152 | [_modalRegisterButton setTitle:@"Modal到注册页" forState:UIControlStateNormal];
153 | [_modalRegisterButton addTarget:self action:@selector(onTouchModalRegister:) forControlEvents:UIControlEventTouchUpInside];
154 | }
155 | return _modalRegisterButton;
156 | }
157 |
158 | - (UIButton *)gobackButton {
159 |
160 | if (!_gobackButton) {
161 | _gobackButton = [UIButton buttonWithType:UIButtonTypeSystem];
162 | [_gobackButton setTitle:@"OpenRouer:/back" forState:UIControlStateNormal];
163 | [_gobackButton addTarget:self action:@selector(onTouchGoback:) forControlEvents:UIControlEventTouchUpInside];
164 | }
165 | return _gobackButton;
166 | }
167 |
168 | - (UIStackView *)stackView {
169 |
170 | if (!_stackView) {
171 | _stackView = [[UIStackView alloc] init];
172 | [_stackView setAxis:UILayoutConstraintAxisVertical];
173 | [_stackView setSpacing:3];
174 | }
175 | return _stackView;
176 | }
177 |
178 | @end
179 |
180 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Register/JSDRegisterVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDRegisterVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDRegisterVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Register/JSDRegisterVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDRegisterVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDRegisterVC.h"
10 |
11 | @interface JSDRegisterVC ()
12 |
13 | @property(nonatomic, strong) UIStackView *stackView;
14 | @property(nonatomic, strong) UIButton *gobackButton;
15 | @property(nonatomic, strong) UIButton *gobackIndexButton;
16 | @property(nonatomic, strong) UIButton *gobackPageButton;
17 | @property(nonatomic, strong) UIButton *gobackPageOffsetButton;
18 |
19 | @end
20 |
21 | @implementation JSDRegisterVC
22 |
23 | #pragma mark - View Controller Life Cycle
24 | - (void)viewDidLoad {
25 | [super viewDidLoad];
26 | // Do any additional setup after loading the view.
27 |
28 | //1.设置导航栏
29 | [self setupNavBar];
30 | //2.设置view
31 | [self setupView];
32 | //3.请求数据
33 | [self setupData];
34 | //5.解析数据
35 | [self setupAnalyticalData];
36 | //6.设置通知
37 | [self setupNotification];
38 | //7.private
39 | [self setupPrivateMethod];
40 | }
41 |
42 | #pragma mark - 2 SettingView and Style
43 |
44 | -(void)setupNavBar {
45 |
46 | self.navigationItem.title = @"注册: [测试OpenURL:Back]";
47 | }
48 |
49 | - (void)setupView {
50 |
51 | [self.view addSubview:self.stackView];
52 | [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
53 | make.top.mas_equalTo(100);
54 | make.left.mas_equalTo(15);
55 | make.trailing.mas_equalTo(-15);
56 | }];
57 |
58 | [self.stackView addArrangedSubview:self.gobackButton];
59 | [self.stackView addArrangedSubview:self.gobackIndexButton];
60 | [self.stackView addArrangedSubview:self.gobackPageButton];
61 | [self.stackView addArrangedSubview:self.gobackPageOffsetButton];
62 | }
63 |
64 | - (void)reloadingView {
65 |
66 |
67 | }
68 |
69 | #pragma mark - 3 Request Data
70 |
71 | - (void)setupData {
72 |
73 |
74 | }
75 |
76 | #pragma mark - 4 UITableViewDataSource and UITableViewDelegate
77 | #pragma mark - 5 Event Response
78 |
79 | - (void)onTouchGoback:(UIButton *)sender {
80 |
81 | [JSDVCRouter openURL:kJSDVCRouteSegueBack];
82 | }
83 |
84 | - (void)onTouchGobackIndex:(UIButton *)sender {
85 |
86 | [JSDVCRouter openURL:kJSDVCRouteSegueBack parameters:@{kJSDVCRouteBackIndex: @(2)}];
87 | }
88 |
89 | - (void)onTouchGobackPage:(UIButton *)sender {
90 |
91 | [JSDVCRouter openURL:kJSDVCRouteSegueBack parameters:@{kJSDVCRouteBackPage: @"JSDHomeVC"}];
92 | }
93 |
94 | - (void)onTouchGobackPageOffset:(UIButton *)sender {
95 |
96 | [JSDVCRouter openURL:kJSDVCRouteSegueBack parameters:@{kJSDVCRouteBackPage: @"JSDLoginVC", kJSDVCRouteBackPageOffset:@(1)}];
97 | }
98 |
99 | - (void)setupAnalyticalData {
100 |
101 |
102 | }
103 | #pragma mark - 6 Private Methods
104 |
105 | - (void)setupNotification {
106 |
107 | }
108 |
109 | - (void)setupPrivateMethod {
110 |
111 |
112 | }
113 |
114 | #pragma mark - 7 GET & SET
115 |
116 | - (UIStackView *)stackView {
117 |
118 | if (!_stackView) {
119 | _stackView = [[UIStackView alloc] init];
120 | [_stackView setAxis:UILayoutConstraintAxisVertical];
121 | [_stackView setSpacing:3];
122 | }
123 | return _stackView;
124 | }
125 |
126 | - (UIButton *)gobackButton {
127 |
128 | if (!_gobackButton) {
129 | _gobackButton = [UIButton buttonWithType:UIButtonTypeSystem];
130 | [_gobackButton setTitle:@"goback,返回上一个页面" forState:UIControlStateNormal];
131 | [_gobackButton addTarget:self action:@selector(onTouchGoback:) forControlEvents:UIControlEventTouchUpInside];
132 | }
133 | return _gobackButton;
134 | }
135 |
136 | - (UIButton *)gobackIndexButton {
137 |
138 | if (!_gobackIndexButton) {
139 | _gobackIndexButton = [UIButton buttonWithType:UIButtonTypeSystem];
140 | [_gobackIndexButton setTitle:@"gobackIndex,返回指定索引页" forState:UIControlStateNormal];
141 | [_gobackIndexButton addTarget:self action:@selector(onTouchGobackIndex:) forControlEvents:UIControlEventTouchUpInside];
142 | }
143 | return _gobackIndexButton;
144 | }
145 |
146 | - (UIButton *)gobackPageButton {
147 |
148 | if (!_gobackPageButton) {
149 | _gobackPageButton = [UIButton buttonWithType:UIButtonTypeSystem];
150 | [_gobackPageButton setTitle:@"goback,返回指定的页面" forState:UIControlStateNormal];
151 | [_gobackPageButton addTarget:self action:@selector(onTouchGobackPage:) forControlEvents:UIControlEventTouchUpInside];
152 | }
153 | return _gobackPageButton;
154 | }
155 |
156 | - (UIButton *)gobackPageOffsetButton {
157 |
158 | if (!_gobackPageOffsetButton) {
159 | _gobackPageOffsetButton = [UIButton buttonWithType:UIButtonTypeSystem];
160 | [_gobackPageOffsetButton setTitle:@"goback,返回指定的页面并进行偏移" forState:UIControlStateNormal];
161 | [_gobackPageOffsetButton addTarget:self action:@selector(onTouchGobackPageOffset:) forControlEvents:UIControlEventTouchUpInside];
162 | }
163 | return _gobackPageOffsetButton;
164 | }
165 |
166 | @end
167 |
168 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Web/JSDWebViewVC.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDWebViewVC.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDBaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDWebViewVC : JSDBaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Moudles/TestRouterSkip/Web/JSDWebViewVC.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDWebViewVC.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDWebViewVC.h"
10 |
11 | @interface JSDWebViewVC ()
12 |
13 | @end
14 |
15 | @implementation JSDWebViewVC
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 |
21 | }
22 |
23 | /*
24 | #pragma mark - Navigation
25 |
26 | // In a storyboard-based application, you will often want to do a little preparation before navigation
27 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
28 | // Get the new view controller using [segue destinationViewController].
29 | // Pass the selected object to the new view controller.
30 | }
31 | */
32 |
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Router/JSDVCRouter+Handle.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDVCRouter+Handle.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDVCRouter.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface JSDVCRouter (Handle)
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Router/JSDVCRouter.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDVCRouter.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "JSDVCRouterConfig.h"
12 | #import "UIViewController+JSDTool.h"
13 | extern BOOL userIsLogin;
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface JSDVCRouter : NSObject
17 |
18 | + (BOOL)openURL:(NSString *)url;//调用 Router;
19 | + (BOOL)openURL:(NSString *)url parameters:(NSDictionary *)parameters;
20 |
21 | + (void)addRoute:(NSString* )route handler:(BOOL (^)(NSDictionary *parameters))handlerBlock;//注册 Router,调用 Router 时会触发回调;
22 |
23 |
24 | @end
25 |
26 | NS_ASSUME_NONNULL_END
27 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Router/JSDVCRouter.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDVCRouter.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDVCRouter.h"
10 |
11 | BOOL userIsLogin = NO;
12 |
13 | #define JSDRouterURL(string) [NSURL URLWithString:string]
14 |
15 | @implementation JSDVCRouter
16 |
17 | + (BOOL)openURL:(NSString *)url {
18 |
19 | return [self routeURL:url parameters:nil];
20 | }
21 |
22 | + (BOOL)openURL:(NSString *)url parameters:(NSDictionary *)parameters {
23 |
24 | return [self routeURL:url parameters:parameters];
25 | }
26 |
27 | + (void)addRoute:(NSString *)route handler:(BOOL (^)(NSDictionary * _Nonnull parameters))handlerBlock {
28 |
29 | [JLRoutes addRoute:route handler:handlerBlock];
30 | }
31 |
32 | #pragma mark - mark JLRouter
33 |
34 | + (BOOL)routeURL:(NSString*)url parameters:(NSDictionary *)parameters{
35 |
36 | return [JLRoutes routeURL:JSDRouterURL(url) withParameters:parameters];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Router/JSDVCRouterConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSDVCRouterConfig.h
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | //控制器跳转相关参数配置;
14 | extern NSString* const kJSDVCRouteSegue;//区分 Push 或 Modal
15 | extern NSString* const kJSDVCRouteAnimated;//跳转时是否需要动画切换
16 | extern NSString* const kJSDVCRouteBackIndex;//处理同级导航栏返回层级 Index
17 | extern NSString* const kJSDVCRouteBackPage;//指定同级导航栏到此页面
18 | extern NSString* const kJSDVCRouteBackPageOffset;//指定
19 | extern NSString* const kJSDVCRouteFromOutside;//处理外部跳转到App
20 | extern NSString* const kJSDVCRouteNeedLogin;//指定需要登录才能跳转的页面
21 | extern NSString* const kJSDVCRouteSegueNeedNavigation; //Modal 时需要导航控制器;
22 |
23 | extern NSString* const kJSDVCRouteIndexRoot; //导航栏根控制器
24 | extern NSString* const kJSDVCRouteSeguePush; //Push
25 | extern NSString* const kJSDVCRouteSegueModal; //
26 | extern NSString* const kJSDVCRouteSegueBack; //返回上一页;
27 | extern NSString* const kJSDVCRouteClassName;
28 | extern NSString* const kJSDVCRouteClassTitle;
29 | extern NSString* const kJSDVCRouteClassFlags;
30 | extern NSString* const kJSDVCRouteClassNeedLogin;
31 |
32 | //TabBar 下控制器;
33 | extern NSString* const JSDVCRouteHomeTab;
34 | extern NSString* const JSDVCRouteCafeTab;
35 | extern NSString* const JSDVCRouteCoffeeTab;
36 | extern NSString* const JSDVCRouteMyCenterTab;
37 |
38 | extern NSString* const JSDVCRouteInvestTabGB;
39 | extern NSString* const JSDVCRouteInvestTabYX;
40 |
41 | //App 内所有控制器
42 | extern NSString* const JSDVCRouteWebview;
43 | extern NSString* const JSDVCRouteLogin;
44 | extern NSString* const JSDVCRouteRegister;
45 | extern NSString* const JSDVCRouteAppear;
46 | extern NSString* const JSDVCRouteAppearNotNeedLogin;
47 |
48 | @interface JSDVCRouterConfig : NSObject
49 |
50 | + (NSDictionary *)configMapInfo;
51 |
52 | @end
53 |
54 | NS_ASSUME_NONNULL_END
55 |
--------------------------------------------------------------------------------
/JSDRouterGuide/Router/JSDVCRouterConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSDVCRouterConfig.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import "JSDVCRouterConfig.h"
10 |
11 | NSString* const kJSDVCRouteSegue = @"JSDVCRouteSegue";
12 | NSString* const kJSDVCRouteAnimated = @"JSDVCRouteAnimated";
13 | NSString* const kJSDVCRouteBackIndex = @"JSDVCRouteBackIndex";
14 | NSString* const kJSDVCRouteBackPage = @"JSDVCRouteBackPage";
15 | NSString* const kJSDVCRouteBackPageOffset = @"JSDVCRouteBackPageOffset";
16 | NSString* const kJSDVCRouteFromOutside = @"JSDVCRouteFromOutside";
17 | NSString* const kJSDVCRouteNeedLogin = @"JSDVCRouteNeedLogin";
18 | NSString* const kJSDVCRouteSegueNeedNavigation = @"JSDVCRouteNeedNavigation";
19 |
20 | NSString* const kJSDVCRouteIndexRoot = @"root";
21 | NSString* const kJSDVCRouteSeguePush = @"push";
22 | NSString* const kJSDVCRouteSegueModal = @"modal";
23 | NSString* const kJSDVCRouteSegueBack = @"/back";
24 |
25 | NSString* const kJSDVCRouteClassName = @"class";
26 | NSString* const kJSDVCRouteClassTitle = @"title";
27 | NSString* const kJSDVCRouteClassFlags = @"flags";
28 | NSString* const kJSDVCRouteClassNeedLogin = @"needLogin";
29 |
30 | NSString* const JSDVCRouteHomeTab = @"/rootTab/0";
31 | NSString* const JSDVCRouteCafeTab = @"/rootTab/1";
32 | NSString* const JSDVCRouteCoffeeTab = @"/rootTab/2";
33 | NSString* const JSDVCRouteMyCenterTab = @"/rootTab/3";
34 |
35 | //App 内相关控制器
36 | NSString* const JSDVCRouteWebview = @"/webView";
37 | NSString* const JSDVCRouteLogin = @"/login";
38 | NSString* const JSDVCRouteRegister = @"/register";
39 | NSString* const JSDVCRouteAppear = @"/home/Appear";
40 | NSString* const JSDVCRouteAppearNotNeedLogin = @"/home/AppearNotNeedLogin";
41 |
42 | @implementation JSDVCRouterConfig
43 |
44 | + (NSDictionary *)configMapInfo {
45 |
46 | return @{
47 | JSDVCRouteWebview: @{kJSDVCRouteClassName: @"JSDWebViewVC",
48 | kJSDVCRouteClassTitle: @"WebView",
49 | kJSDVCRouteClassFlags: @"",
50 | kJSDVCRouteClassNeedLogin: @"",
51 | },
52 | JSDVCRouteLogin: @{kJSDVCRouteClassName: @"JSDLoginVC",
53 | kJSDVCRouteClassTitle: @"登录",
54 | kJSDVCRouteClassFlags: @"",
55 | kJSDVCRouteClassNeedLogin: @"",
56 | },
57 | JSDVCRouteRegister: @{kJSDVCRouteClassName: @"JSDRegisterVC",
58 | kJSDVCRouteClassTitle: @"注册",
59 | kJSDVCRouteClassFlags: @"",
60 | kJSDVCRouteClassNeedLogin: @"",
61 | },
62 | JSDVCRouteAppear: @{kJSDVCRouteClassName: @"JSDAppearVC",
63 | kJSDVCRouteClassTitle: @"测试OpenRouter:",
64 | kJSDVCRouteClassFlags: @"",
65 | kJSDVCRouteClassNeedLogin: @"1",
66 |
67 |
68 | },
69 | JSDVCRouteAppearNotNeedLogin: @{kJSDVCRouteClassName: @"JSDAppearNotNeedLogInVC",
70 | kJSDVCRouteClassTitle: @"测试OpenRouterNotNeedLogin:",
71 | kJSDVCRouteClassFlags: @"",
72 | kJSDVCRouteClassNeedLogin: @"",
73 | },
74 | };
75 | }
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/JSDRouterGuide/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // JSDRouterGuide
4 | //
5 | // Created by Jersey on 12/12/2019.
6 | // Copyright © 2019 Jersey. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | NSString * appDelegateClassName;
14 | @autoreleasepool {
15 | // Setup code that might create autoreleased objects goes here.
16 | appDelegateClassName = NSStringFromClass([AppDelegate class]);
17 | }
18 | return UIApplicationMain(argc, argv, nil, appDelegateClassName);
19 | }
20 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'JSDRouterGuide' do
5 | # Comment the next line if you don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for JSDRouterGuide
9 | pod 'JLRoutes', '1.6'
10 | pod 'Masonry'
11 |
12 | end
13 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JLRoutes (1.6)
3 | - Masonry (1.1.0)
4 |
5 | DEPENDENCIES:
6 | - JLRoutes (= 1.6)
7 | - Masonry
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - JLRoutes
12 | - Masonry
13 |
14 | SPEC CHECKSUMS:
15 | JLRoutes: 435d791422e96c9b9b5e1c4db1aedb3ae1b1a08f
16 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
17 |
18 | PODFILE CHECKSUM: 01a4918a85cb47ad0d12a8393246fb9fb3e69b5c
19 |
20 | COCOAPODS: 1.8.1
21 |
--------------------------------------------------------------------------------
/Pods/JLRoutes/JLRoutes/JLRoutes.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016, Joel Levin
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 | Neither the name of JLRoutes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 | */
12 |
13 | #import
14 |
15 |
16 | FOUNDATION_EXTERN NSString *__nonnull const kJLRoutePatternKey;
17 | FOUNDATION_EXTERN NSString *__nonnull const kJLRouteURLKey;
18 | FOUNDATION_EXTERN NSString *__nonnull const kJLRouteNamespaceKey;
19 | FOUNDATION_EXTERN NSString *__nonnull const kJLRouteWildcardComponentsKey;
20 | FOUNDATION_EXTERN NSString *__nonnull const kJLRoutesGlobalNamespaceKey;
21 |
22 |
23 | @interface JLRoutes : NSObject
24 | /** @class JLRoutes
25 | JLRoutes is a way to manage URL routes and invoke them from a URL.
26 | */
27 |
28 | /// Returns the global routing namespace (this is used by the +addRoute methods by default)
29 | + (nonnull instancetype)globalRoutes;
30 |
31 | /// Returns a routing namespace for the given scheme
32 | + (nonnull instancetype)routesForScheme:(nonnull NSString *)scheme;
33 |
34 | /// Tells JLRoutes that it should manually replace '+' in parsed values to ' '. Defaults to YES.
35 | + (void)setShouldDecodePlusSymbols:(BOOL)shouldDeecode;
36 | + (BOOL)shouldDecodePlusSymbols;
37 |
38 | /// Registers a routePattern with default priority (0) in the receiving scheme namespace.
39 | + (void)addRoute:(nonnull NSString *)routePattern handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock;
40 | - (void)addRoute:(nonnull NSString *)routePattern handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock; // instance method
41 |
42 | /// Registers multiple routePatterns for one handler with default priority (0) in the receiving scheme namespace.
43 | + (void)addRoutes:(nonnull NSArray *)routePatterns handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock;
44 | - (void)addRoutes:(nonnull NSArray *)routePatterns handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock; // instance method
45 |
46 |
47 | /// Removes a routePattern from the receiving scheme namespace.
48 | + (void)removeRoute:(nonnull NSString *)routePattern;
49 | - (void)removeRoute:(nonnull NSString *)routePattern; // instance method
50 |
51 | /// Removes all routes from the receiving scheme namespace.
52 | + (void)removeAllRoutes;
53 | - (void)removeAllRoutes; // instance method
54 |
55 | /// Unregister and delete an entire scheme namespace
56 | + (void)unregisterRouteScheme:(nonnull NSString *)scheme;
57 |
58 | /// Registers a routePattern with default priority (0) using dictionary-style subscripting.
59 | - (void)setObject:(nullable id)handlerBlock forKeyedSubscript:(nonnull NSString *)routePatten;
60 |
61 | /// Registers a routePattern in the global scheme namespace with a handlerBlock to call when the route pattern is matched by a URL.
62 | /// The block returns a BOOL representing if the handlerBlock actually handled the route or not. If
63 | /// a block returns NO, JLRoutes will continue trying to find a matching route.
64 | + (void)addRoute:(nonnull NSString *)routePattern priority:(NSUInteger)priority handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock;
65 | - (void)addRoute:(nonnull NSString *)routePattern priority:(NSUInteger)priority handler:(BOOL (^__nullable)(NSDictionary *__nonnull parameters))handlerBlock; // instance method
66 |
67 | /// Routes a URL, calling handler blocks (for patterns that match URL) until one returns YES, optionally specifying add'l parameters
68 | + (BOOL)routeURL:(nullable NSURL *)URL;
69 | + (BOOL)routeURL:(nullable NSURL *)URL withParameters:(nullable NSDictionary *)parameters;
70 |
71 | - (BOOL)routeURL:(nullable NSURL *)URL; // instance method
72 | - (BOOL)routeURL:(nullable NSURL *)URL withParameters:(nullable NSDictionary *)parameters; // instance method
73 |
74 | /// Returns whether a route exists for a URL
75 | + (BOOL)canRouteURL:(nullable NSURL *)URL;
76 | + (BOOL)canRouteURL:(nullable NSURL *)URL withParameters:(nullable NSDictionary *)parameters;
77 |
78 | - (BOOL)canRouteURL:(nullable NSURL *)URL; // instance method
79 | - (BOOL)canRouteURL:(nullable NSURL *)URL withParameters:(nullable NSDictionary *)parameters; // instance method
80 |
81 | /// Prints the entire routing table
82 | + (nonnull NSString *)description;
83 |
84 | /// Allows configuration of verbose logging. Default is NO. This is mostly just helpful with debugging.
85 | + (void)setVerboseLoggingEnabled:(BOOL)loggingEnabled;
86 | + (BOOL)isVerboseLoggingEnabled;
87 |
88 | /// Controls whether or not this routes controller will try to match a URL with global routes if it can't be matched in the current namespace. Default is NO.
89 | @property (nonatomic, assign) BOOL shouldFallbackToGlobalRoutes;
90 |
91 | /// Called any time routeURL returns NO. Respects shouldFallbackToGlobalRoutes.
92 | @property (nonatomic, copy) void (^__nullable unmatchedURLHandler)(JLRoutes *__nonnull routes, NSURL *__nullable URL, NSDictionary *__nullable parameters);
93 |
94 | @end
95 |
--------------------------------------------------------------------------------
/Pods/JLRoutes/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016, Joel Levin. All rights reserved.
2 |
3 | - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4 | - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
6 |
7 | Neither the name of JLRoutes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JLRoutes (1.6)
3 | - Masonry (1.1.0)
4 |
5 | DEPENDENCIES:
6 | - JLRoutes (= 1.6)
7 | - Masonry
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - JLRoutes
12 | - Masonry
13 |
14 | SPEC CHECKSUMS:
15 | JLRoutes: 435d791422e96c9b9b5e1c4db1aedb3ae1b1a08f
16 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
17 |
18 | PODFILE CHECKSUM: 01a4918a85cb47ad0d12a8393246fb9fb3e69b5c
19 |
20 | COCOAPODS: 1.8.1
21 |
--------------------------------------------------------------------------------
/Pods/Masonry/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | /**
13 | * A group of MASConstraint objects
14 | */
15 | @interface MASCompositeConstraint : MASConstraint
16 |
17 | /**
18 | * Creates a composite with a predefined array of children
19 | *
20 | * @param children child MASConstraints
21 | *
22 | * @return a composite constraint
23 | */
24 | - (id)initWithChildren:(NSArray *)children;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASCompositeConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASCompositeConstraint.h"
10 | #import "MASConstraint+Private.h"
11 |
12 | @interface MASCompositeConstraint ()
13 |
14 | @property (nonatomic, strong) id mas_key;
15 | @property (nonatomic, strong) NSMutableArray *childConstraints;
16 |
17 | @end
18 |
19 | @implementation MASCompositeConstraint
20 |
21 | - (id)initWithChildren:(NSArray *)children {
22 | self = [super init];
23 | if (!self) return nil;
24 |
25 | _childConstraints = [children mutableCopy];
26 | for (MASConstraint *constraint in _childConstraints) {
27 | constraint.delegate = self;
28 | }
29 |
30 | return self;
31 | }
32 |
33 | #pragma mark - MASConstraintDelegate
34 |
35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
36 | NSUInteger index = [self.childConstraints indexOfObject:constraint];
37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint];
39 | }
40 |
41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
42 | id strongDelegate = self.delegate;
43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
44 | newConstraint.delegate = self;
45 | [self.childConstraints addObject:newConstraint];
46 | return newConstraint;
47 | }
48 |
49 | #pragma mark - NSLayoutConstraint multiplier proxies
50 |
51 | - (MASConstraint * (^)(CGFloat))multipliedBy {
52 | return ^id(CGFloat multiplier) {
53 | for (MASConstraint *constraint in self.childConstraints) {
54 | constraint.multipliedBy(multiplier);
55 | }
56 | return self;
57 | };
58 | }
59 |
60 | - (MASConstraint * (^)(CGFloat))dividedBy {
61 | return ^id(CGFloat divider) {
62 | for (MASConstraint *constraint in self.childConstraints) {
63 | constraint.dividedBy(divider);
64 | }
65 | return self;
66 | };
67 | }
68 |
69 | #pragma mark - MASLayoutPriority proxy
70 |
71 | - (MASConstraint * (^)(MASLayoutPriority))priority {
72 | return ^id(MASLayoutPriority priority) {
73 | for (MASConstraint *constraint in self.childConstraints) {
74 | constraint.priority(priority);
75 | }
76 | return self;
77 | };
78 | }
79 |
80 | #pragma mark - NSLayoutRelation proxy
81 |
82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation {
83 | return ^id(id attr, NSLayoutRelation relation) {
84 | for (MASConstraint *constraint in self.childConstraints.copy) {
85 | constraint.equalToWithRelation(attr, relation);
86 | }
87 | return self;
88 | };
89 | }
90 |
91 | #pragma mark - attribute chaining
92 |
93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
95 | return self;
96 | }
97 |
98 | #pragma mark - Animator proxy
99 |
100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
101 |
102 | - (MASConstraint *)animator {
103 | for (MASConstraint *constraint in self.childConstraints) {
104 | [constraint animator];
105 | }
106 | return self;
107 | }
108 |
109 | #endif
110 |
111 | #pragma mark - debug helpers
112 |
113 | - (MASConstraint * (^)(id))key {
114 | return ^id(id key) {
115 | self.mas_key = key;
116 | int i = 0;
117 | for (MASConstraint *constraint in self.childConstraints) {
118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]);
119 | }
120 | return self;
121 | };
122 | }
123 |
124 | #pragma mark - NSLayoutConstraint constant setters
125 |
126 | - (void)setInsets:(MASEdgeInsets)insets {
127 | for (MASConstraint *constraint in self.childConstraints) {
128 | constraint.insets = insets;
129 | }
130 | }
131 |
132 | - (void)setInset:(CGFloat)inset {
133 | for (MASConstraint *constraint in self.childConstraints) {
134 | constraint.inset = inset;
135 | }
136 | }
137 |
138 | - (void)setOffset:(CGFloat)offset {
139 | for (MASConstraint *constraint in self.childConstraints) {
140 | constraint.offset = offset;
141 | }
142 | }
143 |
144 | - (void)setSizeOffset:(CGSize)sizeOffset {
145 | for (MASConstraint *constraint in self.childConstraints) {
146 | constraint.sizeOffset = sizeOffset;
147 | }
148 | }
149 |
150 | - (void)setCenterOffset:(CGPoint)centerOffset {
151 | for (MASConstraint *constraint in self.childConstraints) {
152 | constraint.centerOffset = centerOffset;
153 | }
154 | }
155 |
156 | #pragma mark - MASConstraint
157 |
158 | - (void)activate {
159 | for (MASConstraint *constraint in self.childConstraints) {
160 | [constraint activate];
161 | }
162 | }
163 |
164 | - (void)deactivate {
165 | for (MASConstraint *constraint in self.childConstraints) {
166 | [constraint deactivate];
167 | }
168 | }
169 |
170 | - (void)install {
171 | for (MASConstraint *constraint in self.childConstraints) {
172 | constraint.updateExisting = self.updateExisting;
173 | [constraint install];
174 | }
175 | }
176 |
177 | - (void)uninstall {
178 | for (MASConstraint *constraint in self.childConstraints) {
179 | [constraint uninstall];
180 | }
181 | }
182 |
183 | @end
184 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint+Private.h
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 29/04/14.
6 | // Copyright (c) 2014 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 |
11 | @protocol MASConstraintDelegate;
12 |
13 |
14 | @interface MASConstraint ()
15 |
16 | /**
17 | * Whether or not to check for an existing constraint instead of adding constraint
18 | */
19 | @property (nonatomic, assign) BOOL updateExisting;
20 |
21 | /**
22 | * Usually MASConstraintMaker but could be a parent MASConstraint
23 | */
24 | @property (nonatomic, weak) id delegate;
25 |
26 | /**
27 | * Based on a provided value type, is equal to calling:
28 | * NSNumber - setOffset:
29 | * NSValue with CGPoint - setPointOffset:
30 | * NSValue with CGSize - setSizeOffset:
31 | * NSValue with MASEdgeInsets - setInsets:
32 | */
33 | - (void)setLayoutConstantWithValue:(NSValue *)value;
34 |
35 | @end
36 |
37 |
38 | @interface MASConstraint (Abstract)
39 |
40 | /**
41 | * Sets the constraint relation to given NSLayoutRelation
42 | * returns a block which accepts one of the following:
43 | * MASViewAttribute, UIView, NSValue, NSArray
44 | * see readme for more details.
45 | */
46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation;
47 |
48 | /**
49 | * Override to set a custom chaining behaviour
50 | */
51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
52 |
53 | @end
54 |
55 |
56 | @protocol MASConstraintDelegate
57 |
58 | /**
59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example
60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks
61 | */
62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint;
63 |
64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * Enables Constraints to be created with chainable syntax
13 | * Constraint can represent single NSLayoutConstraint (MASViewConstraint)
14 | * or a group of NSLayoutConstraints (MASComposisteConstraint)
15 | */
16 | @interface MASConstraint : NSObject
17 |
18 | // Chaining Support
19 |
20 | /**
21 | * Modifies the NSLayoutConstraint constant,
22 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
23 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
24 | */
25 | - (MASConstraint * (^)(MASEdgeInsets insets))insets;
26 |
27 | /**
28 | * Modifies the NSLayoutConstraint constant,
29 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
30 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
31 | */
32 | - (MASConstraint * (^)(CGFloat inset))inset;
33 |
34 | /**
35 | * Modifies the NSLayoutConstraint constant,
36 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
37 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight
38 | */
39 | - (MASConstraint * (^)(CGSize offset))sizeOffset;
40 |
41 | /**
42 | * Modifies the NSLayoutConstraint constant,
43 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
44 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
45 | */
46 | - (MASConstraint * (^)(CGPoint offset))centerOffset;
47 |
48 | /**
49 | * Modifies the NSLayoutConstraint constant
50 | */
51 | - (MASConstraint * (^)(CGFloat offset))offset;
52 |
53 | /**
54 | * Modifies the NSLayoutConstraint constant based on a value type
55 | */
56 | - (MASConstraint * (^)(NSValue *value))valueOffset;
57 |
58 | /**
59 | * Sets the NSLayoutConstraint multiplier property
60 | */
61 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy;
62 |
63 | /**
64 | * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy
65 | */
66 | - (MASConstraint * (^)(CGFloat divider))dividedBy;
67 |
68 | /**
69 | * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority
70 | */
71 | - (MASConstraint * (^)(MASLayoutPriority priority))priority;
72 |
73 | /**
74 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow
75 | */
76 | - (MASConstraint * (^)(void))priorityLow;
77 |
78 | /**
79 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium
80 | */
81 | - (MASConstraint * (^)(void))priorityMedium;
82 |
83 | /**
84 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh
85 | */
86 | - (MASConstraint * (^)(void))priorityHigh;
87 |
88 | /**
89 | * Sets the constraint relation to NSLayoutRelationEqual
90 | * returns a block which accepts one of the following:
91 | * MASViewAttribute, UIView, NSValue, NSArray
92 | * see readme for more details.
93 | */
94 | - (MASConstraint * (^)(id attr))equalTo;
95 |
96 | /**
97 | * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual
98 | * returns a block which accepts one of the following:
99 | * MASViewAttribute, UIView, NSValue, NSArray
100 | * see readme for more details.
101 | */
102 | - (MASConstraint * (^)(id attr))greaterThanOrEqualTo;
103 |
104 | /**
105 | * Sets the constraint relation to NSLayoutRelationLessThanOrEqual
106 | * returns a block which accepts one of the following:
107 | * MASViewAttribute, UIView, NSValue, NSArray
108 | * see readme for more details.
109 | */
110 | - (MASConstraint * (^)(id attr))lessThanOrEqualTo;
111 |
112 | /**
113 | * Optional semantic property which has no effect but improves the readability of constraint
114 | */
115 | - (MASConstraint *)with;
116 |
117 | /**
118 | * Optional semantic property which has no effect but improves the readability of constraint
119 | */
120 | - (MASConstraint *)and;
121 |
122 | /**
123 | * Creates a new MASCompositeConstraint with the called attribute and reciever
124 | */
125 | - (MASConstraint *)left;
126 | - (MASConstraint *)top;
127 | - (MASConstraint *)right;
128 | - (MASConstraint *)bottom;
129 | - (MASConstraint *)leading;
130 | - (MASConstraint *)trailing;
131 | - (MASConstraint *)width;
132 | - (MASConstraint *)height;
133 | - (MASConstraint *)centerX;
134 | - (MASConstraint *)centerY;
135 | - (MASConstraint *)baseline;
136 |
137 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
138 |
139 | - (MASConstraint *)firstBaseline;
140 | - (MASConstraint *)lastBaseline;
141 |
142 | #endif
143 |
144 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
145 |
146 | - (MASConstraint *)leftMargin;
147 | - (MASConstraint *)rightMargin;
148 | - (MASConstraint *)topMargin;
149 | - (MASConstraint *)bottomMargin;
150 | - (MASConstraint *)leadingMargin;
151 | - (MASConstraint *)trailingMargin;
152 | - (MASConstraint *)centerXWithinMargins;
153 | - (MASConstraint *)centerYWithinMargins;
154 |
155 | #endif
156 |
157 |
158 | /**
159 | * Sets the constraint debug name
160 | */
161 | - (MASConstraint * (^)(id key))key;
162 |
163 | // NSLayoutConstraint constant Setters
164 | // for use outside of mas_updateConstraints/mas_makeConstraints blocks
165 |
166 | /**
167 | * Modifies the NSLayoutConstraint constant,
168 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
169 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
170 | */
171 | - (void)setInsets:(MASEdgeInsets)insets;
172 |
173 | /**
174 | * Modifies the NSLayoutConstraint constant,
175 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
176 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
177 | */
178 | - (void)setInset:(CGFloat)inset;
179 |
180 | /**
181 | * Modifies the NSLayoutConstraint constant,
182 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
183 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight
184 | */
185 | - (void)setSizeOffset:(CGSize)sizeOffset;
186 |
187 | /**
188 | * Modifies the NSLayoutConstraint constant,
189 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
190 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
191 | */
192 | - (void)setCenterOffset:(CGPoint)centerOffset;
193 |
194 | /**
195 | * Modifies the NSLayoutConstraint constant
196 | */
197 | - (void)setOffset:(CGFloat)offset;
198 |
199 |
200 | // NSLayoutConstraint Installation support
201 |
202 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
203 | /**
204 | * Whether or not to go through the animator proxy when modifying the constraint
205 | */
206 | @property (nonatomic, copy, readonly) MASConstraint *animator;
207 | #endif
208 |
209 | /**
210 | * Activates an NSLayoutConstraint if it's supported by an OS.
211 | * Invokes install otherwise.
212 | */
213 | - (void)activate;
214 |
215 | /**
216 | * Deactivates previously installed/activated NSLayoutConstraint.
217 | */
218 | - (void)deactivate;
219 |
220 | /**
221 | * Creates a NSLayoutConstraint and adds it to the appropriate view.
222 | */
223 | - (void)install;
224 |
225 | /**
226 | * Removes previously installed NSLayoutConstraint
227 | */
228 | - (void)uninstall;
229 |
230 | @end
231 |
232 |
233 | /**
234 | * Convenience auto-boxing macros for MASConstraint methods.
235 | *
236 | * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax.
237 | * A potential drawback of this is that the unprefixed macros will appear in global scope.
238 | */
239 | #define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__)))
240 | #define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
241 | #define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
242 |
243 | #define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__)))
244 |
245 |
246 | #ifdef MAS_SHORTHAND_GLOBALS
247 |
248 | #define equalTo(...) mas_equalTo(__VA_ARGS__)
249 | #define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__)
250 | #define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__)
251 |
252 | #define offset(...) mas_offset(__VA_ARGS__)
253 |
254 | #endif
255 |
256 |
257 | @interface MASConstraint (AutoboxingSupport)
258 |
259 | /**
260 | * Aliases to corresponding relation methods (for shorthand macros)
261 | * Also needed to aid autocompletion
262 | */
263 | - (MASConstraint * (^)(id attr))mas_equalTo;
264 | - (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo;
265 | - (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo;
266 |
267 | /**
268 | * A dummy method to aid autocompletion
269 | */
270 | - (MASConstraint * (^)(id offset))mas_offset;
271 |
272 | @end
273 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint.m
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 1/20/14.
6 | //
7 |
8 | #import "MASConstraint.h"
9 | #import "MASConstraint+Private.h"
10 |
11 | #define MASMethodNotImplemented() \
12 | @throw [NSException exceptionWithName:NSInternalInconsistencyException \
13 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \
14 | userInfo:nil]
15 |
16 | @implementation MASConstraint
17 |
18 | #pragma mark - Init
19 |
20 | - (id)init {
21 | NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly.");
22 | return [super init];
23 | }
24 |
25 | #pragma mark - NSLayoutRelation proxies
26 |
27 | - (MASConstraint * (^)(id))equalTo {
28 | return ^id(id attribute) {
29 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
30 | };
31 | }
32 |
33 | - (MASConstraint * (^)(id))mas_equalTo {
34 | return ^id(id attribute) {
35 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
36 | };
37 | }
38 |
39 | - (MASConstraint * (^)(id))greaterThanOrEqualTo {
40 | return ^id(id attribute) {
41 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
42 | };
43 | }
44 |
45 | - (MASConstraint * (^)(id))mas_greaterThanOrEqualTo {
46 | return ^id(id attribute) {
47 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
48 | };
49 | }
50 |
51 | - (MASConstraint * (^)(id))lessThanOrEqualTo {
52 | return ^id(id attribute) {
53 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
54 | };
55 | }
56 |
57 | - (MASConstraint * (^)(id))mas_lessThanOrEqualTo {
58 | return ^id(id attribute) {
59 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
60 | };
61 | }
62 |
63 | #pragma mark - MASLayoutPriority proxies
64 |
65 | - (MASConstraint * (^)(void))priorityLow {
66 | return ^id{
67 | self.priority(MASLayoutPriorityDefaultLow);
68 | return self;
69 | };
70 | }
71 |
72 | - (MASConstraint * (^)(void))priorityMedium {
73 | return ^id{
74 | self.priority(MASLayoutPriorityDefaultMedium);
75 | return self;
76 | };
77 | }
78 |
79 | - (MASConstraint * (^)(void))priorityHigh {
80 | return ^id{
81 | self.priority(MASLayoutPriorityDefaultHigh);
82 | return self;
83 | };
84 | }
85 |
86 | #pragma mark - NSLayoutConstraint constant proxies
87 |
88 | - (MASConstraint * (^)(MASEdgeInsets))insets {
89 | return ^id(MASEdgeInsets insets){
90 | self.insets = insets;
91 | return self;
92 | };
93 | }
94 |
95 | - (MASConstraint * (^)(CGFloat))inset {
96 | return ^id(CGFloat inset){
97 | self.inset = inset;
98 | return self;
99 | };
100 | }
101 |
102 | - (MASConstraint * (^)(CGSize))sizeOffset {
103 | return ^id(CGSize offset) {
104 | self.sizeOffset = offset;
105 | return self;
106 | };
107 | }
108 |
109 | - (MASConstraint * (^)(CGPoint))centerOffset {
110 | return ^id(CGPoint offset) {
111 | self.centerOffset = offset;
112 | return self;
113 | };
114 | }
115 |
116 | - (MASConstraint * (^)(CGFloat))offset {
117 | return ^id(CGFloat offset){
118 | self.offset = offset;
119 | return self;
120 | };
121 | }
122 |
123 | - (MASConstraint * (^)(NSValue *value))valueOffset {
124 | return ^id(NSValue *offset) {
125 | NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset);
126 | [self setLayoutConstantWithValue:offset];
127 | return self;
128 | };
129 | }
130 |
131 | - (MASConstraint * (^)(id offset))mas_offset {
132 | // Will never be called due to macro
133 | return nil;
134 | }
135 |
136 | #pragma mark - NSLayoutConstraint constant setter
137 |
138 | - (void)setLayoutConstantWithValue:(NSValue *)value {
139 | if ([value isKindOfClass:NSNumber.class]) {
140 | self.offset = [(NSNumber *)value doubleValue];
141 | } else if (strcmp(value.objCType, @encode(CGPoint)) == 0) {
142 | CGPoint point;
143 | [value getValue:&point];
144 | self.centerOffset = point;
145 | } else if (strcmp(value.objCType, @encode(CGSize)) == 0) {
146 | CGSize size;
147 | [value getValue:&size];
148 | self.sizeOffset = size;
149 | } else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) {
150 | MASEdgeInsets insets;
151 | [value getValue:&insets];
152 | self.insets = insets;
153 | } else {
154 | NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value);
155 | }
156 | }
157 |
158 | #pragma mark - Semantic properties
159 |
160 | - (MASConstraint *)with {
161 | return self;
162 | }
163 |
164 | - (MASConstraint *)and {
165 | return self;
166 | }
167 |
168 | #pragma mark - Chaining
169 |
170 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute {
171 | MASMethodNotImplemented();
172 | }
173 |
174 | - (MASConstraint *)left {
175 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft];
176 | }
177 |
178 | - (MASConstraint *)top {
179 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop];
180 | }
181 |
182 | - (MASConstraint *)right {
183 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight];
184 | }
185 |
186 | - (MASConstraint *)bottom {
187 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom];
188 | }
189 |
190 | - (MASConstraint *)leading {
191 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading];
192 | }
193 |
194 | - (MASConstraint *)trailing {
195 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing];
196 | }
197 |
198 | - (MASConstraint *)width {
199 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth];
200 | }
201 |
202 | - (MASConstraint *)height {
203 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight];
204 | }
205 |
206 | - (MASConstraint *)centerX {
207 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX];
208 | }
209 |
210 | - (MASConstraint *)centerY {
211 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY];
212 | }
213 |
214 | - (MASConstraint *)baseline {
215 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
216 | }
217 |
218 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
219 |
220 | - (MASConstraint *)firstBaseline {
221 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline];
222 | }
223 | - (MASConstraint *)lastBaseline {
224 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline];
225 | }
226 |
227 | #endif
228 |
229 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
230 |
231 | - (MASConstraint *)leftMargin {
232 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
233 | }
234 |
235 | - (MASConstraint *)rightMargin {
236 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin];
237 | }
238 |
239 | - (MASConstraint *)topMargin {
240 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin];
241 | }
242 |
243 | - (MASConstraint *)bottomMargin {
244 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin];
245 | }
246 |
247 | - (MASConstraint *)leadingMargin {
248 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin];
249 | }
250 |
251 | - (MASConstraint *)trailingMargin {
252 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin];
253 | }
254 |
255 | - (MASConstraint *)centerXWithinMargins {
256 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins];
257 | }
258 |
259 | - (MASConstraint *)centerYWithinMargins {
260 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins];
261 | }
262 |
263 | #endif
264 |
265 | #pragma mark - Abstract
266 |
267 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); }
268 |
269 | - (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); }
270 |
271 | - (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); }
272 |
273 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); }
274 |
275 | - (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); }
276 |
277 | - (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); }
278 |
279 | - (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); }
280 |
281 | - (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); }
282 |
283 | - (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); }
284 |
285 | - (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); }
286 |
287 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
288 |
289 | - (MASConstraint *)animator { MASMethodNotImplemented(); }
290 |
291 | #endif
292 |
293 | - (void)activate { MASMethodNotImplemented(); }
294 |
295 | - (void)deactivate { MASMethodNotImplemented(); }
296 |
297 | - (void)install { MASMethodNotImplemented(); }
298 |
299 | - (void)uninstall { MASMethodNotImplemented(); }
300 |
301 | @end
302 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraintMaker.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraintMaker.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | typedef NS_OPTIONS(NSInteger, MASAttribute) {
13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft,
14 | MASAttributeRight = 1 << NSLayoutAttributeRight,
15 | MASAttributeTop = 1 << NSLayoutAttributeTop,
16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom,
17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading,
18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing,
19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth,
20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight,
21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX,
22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
24 |
25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
26 |
27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline,
28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline,
29 |
30 | #endif
31 |
32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
33 |
34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin,
37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin,
38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin,
39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin,
40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins,
41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins,
42 |
43 | #endif
44 |
45 | };
46 |
47 | /**
48 | * Provides factory methods for creating MASConstraints.
49 | * Constraints are collected until they are ready to be installed
50 | *
51 | */
52 | @interface MASConstraintMaker : NSObject
53 |
54 | /**
55 | * The following properties return a new MASViewConstraint
56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute
57 | */
58 | @property (nonatomic, strong, readonly) MASConstraint *left;
59 | @property (nonatomic, strong, readonly) MASConstraint *top;
60 | @property (nonatomic, strong, readonly) MASConstraint *right;
61 | @property (nonatomic, strong, readonly) MASConstraint *bottom;
62 | @property (nonatomic, strong, readonly) MASConstraint *leading;
63 | @property (nonatomic, strong, readonly) MASConstraint *trailing;
64 | @property (nonatomic, strong, readonly) MASConstraint *width;
65 | @property (nonatomic, strong, readonly) MASConstraint *height;
66 | @property (nonatomic, strong, readonly) MASConstraint *centerX;
67 | @property (nonatomic, strong, readonly) MASConstraint *centerY;
68 | @property (nonatomic, strong, readonly) MASConstraint *baseline;
69 |
70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
71 |
72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline;
73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline;
74 |
75 | #endif
76 |
77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
78 |
79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin;
80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin;
81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin;
82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin;
83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin;
84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin;
85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins;
86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins;
87 |
88 | #endif
89 |
90 | /**
91 | * Returns a block which creates a new MASCompositeConstraint with the first item set
92 | * to the makers associated view and children corresponding to the set bits in the
93 | * MASAttribute parameter. Combine multiple attributes via binary-or.
94 | */
95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs);
96 |
97 | /**
98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges
99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right)
100 | * with the first item set to the makers associated view
101 | */
102 | @property (nonatomic, strong, readonly) MASConstraint *edges;
103 |
104 | /**
105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize
106 | * which generates the appropriate MASViewConstraint children (width, height)
107 | * with the first item set to the makers associated view
108 | */
109 | @property (nonatomic, strong, readonly) MASConstraint *size;
110 |
111 | /**
112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter
113 | * which generates the appropriate MASViewConstraint children (centerX, centerY)
114 | * with the first item set to the makers associated view
115 | */
116 | @property (nonatomic, strong, readonly) MASConstraint *center;
117 |
118 | /**
119 | * Whether or not to check for an existing constraint instead of adding constraint
120 | */
121 | @property (nonatomic, assign) BOOL updateExisting;
122 |
123 | /**
124 | * Whether or not to remove existing constraints prior to installing
125 | */
126 | @property (nonatomic, assign) BOOL removeExisting;
127 |
128 | /**
129 | * initialises the maker with a default view
130 | *
131 | * @param view any MASConstraint are created with this view as the first item
132 | *
133 | * @return a new MASConstraintMaker
134 | */
135 | - (id)initWithView:(MAS_VIEW *)view;
136 |
137 | /**
138 | * Calls install method on any MASConstraints which have been created by this maker
139 | *
140 | * @return an array of all the installed MASConstraints
141 | */
142 | - (NSArray *)install;
143 |
144 | - (MASConstraint * (^)(dispatch_block_t))group;
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * When you are debugging or printing the constraints attached to a view this subclass
13 | * makes it easier to identify which constraints have been created via Masonry
14 | */
15 | @interface MASLayoutConstraint : NSLayoutConstraint
16 |
17 | /**
18 | * a key to associate with this constraint
19 | */
20 | @property (nonatomic, strong) id mas_key;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASLayoutConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASLayoutConstraint.h"
10 |
11 | @implementation MASLayoutConstraint
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASUtilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASUtilities.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 19/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 |
13 | #if TARGET_OS_IPHONE || TARGET_OS_TV
14 |
15 | #import
16 | #define MAS_VIEW UIView
17 | #define MAS_VIEW_CONTROLLER UIViewController
18 | #define MASEdgeInsets UIEdgeInsets
19 |
20 | typedef UILayoutPriority MASLayoutPriority;
21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;
26 |
27 | #elif TARGET_OS_MAC
28 |
29 | #import
30 | #define MAS_VIEW NSView
31 | #define MASEdgeInsets NSEdgeInsets
32 |
33 | typedef NSLayoutPriority MASLayoutPriority;
34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired;
35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh;
36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow;
37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501;
38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut;
39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow;
40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow;
41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression;
42 |
43 | #endif
44 |
45 | /**
46 | * Allows you to attach keys to objects matching the variable names passed.
47 | *
48 | * view1.mas_key = @"view1", view2.mas_key = @"view2";
49 | *
50 | * is equivalent to:
51 | *
52 | * MASAttachKeys(view1, view2);
53 | */
54 | #define MASAttachKeys(...) \
55 | { \
56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \
57 | for (id key in keyPairs.allKeys) { \
58 | id obj = keyPairs[key]; \
59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \
60 | @"Cannot attach mas_key to %@", obj); \
61 | [obj setMas_key:key]; \
62 | } \
63 | }
64 |
65 | /**
66 | * Used to create object hashes
67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html
68 | */
69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger))
70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch)))
71 |
72 | /**
73 | * Given a scalar or struct value, wraps it in NSValue
74 | * Based on EXPObjectify: https://github.com/specta/expecta
75 | */
76 | static inline id _MASBoxValue(const char *type, ...) {
77 | va_list v;
78 | va_start(v, type);
79 | id obj = nil;
80 | if (strcmp(type, @encode(id)) == 0) {
81 | id actual = va_arg(v, id);
82 | obj = actual;
83 | } else if (strcmp(type, @encode(CGPoint)) == 0) {
84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint);
85 | obj = [NSValue value:&actual withObjCType:type];
86 | } else if (strcmp(type, @encode(CGSize)) == 0) {
87 | CGSize actual = (CGSize)va_arg(v, CGSize);
88 | obj = [NSValue value:&actual withObjCType:type];
89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) {
90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets);
91 | obj = [NSValue value:&actual withObjCType:type];
92 | } else if (strcmp(type, @encode(double)) == 0) {
93 | double actual = (double)va_arg(v, double);
94 | obj = [NSNumber numberWithDouble:actual];
95 | } else if (strcmp(type, @encode(float)) == 0) {
96 | float actual = (float)va_arg(v, double);
97 | obj = [NSNumber numberWithFloat:actual];
98 | } else if (strcmp(type, @encode(int)) == 0) {
99 | int actual = (int)va_arg(v, int);
100 | obj = [NSNumber numberWithInt:actual];
101 | } else if (strcmp(type, @encode(long)) == 0) {
102 | long actual = (long)va_arg(v, long);
103 | obj = [NSNumber numberWithLong:actual];
104 | } else if (strcmp(type, @encode(long long)) == 0) {
105 | long long actual = (long long)va_arg(v, long long);
106 | obj = [NSNumber numberWithLongLong:actual];
107 | } else if (strcmp(type, @encode(short)) == 0) {
108 | short actual = (short)va_arg(v, int);
109 | obj = [NSNumber numberWithShort:actual];
110 | } else if (strcmp(type, @encode(char)) == 0) {
111 | char actual = (char)va_arg(v, int);
112 | obj = [NSNumber numberWithChar:actual];
113 | } else if (strcmp(type, @encode(bool)) == 0) {
114 | bool actual = (bool)va_arg(v, int);
115 | obj = [NSNumber numberWithBool:actual];
116 | } else if (strcmp(type, @encode(unsigned char)) == 0) {
117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int);
118 | obj = [NSNumber numberWithUnsignedChar:actual];
119 | } else if (strcmp(type, @encode(unsigned int)) == 0) {
120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int);
121 | obj = [NSNumber numberWithUnsignedInt:actual];
122 | } else if (strcmp(type, @encode(unsigned long)) == 0) {
123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long);
124 | obj = [NSNumber numberWithUnsignedLong:actual];
125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) {
126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long);
127 | obj = [NSNumber numberWithUnsignedLongLong:actual];
128 | } else if (strcmp(type, @encode(unsigned short)) == 0) {
129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int);
130 | obj = [NSNumber numberWithUnsignedShort:actual];
131 | }
132 | va_end(v);
133 | return obj;
134 | }
135 |
136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value))
137 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * An immutable tuple which stores the view and the related NSLayoutAttribute.
13 | * Describes part of either the left or right hand side of a constraint equation
14 | */
15 | @interface MASViewAttribute : NSObject
16 |
17 | /**
18 | * The view which the reciever relates to. Can be nil if item is not a view.
19 | */
20 | @property (nonatomic, weak, readonly) MAS_VIEW *view;
21 |
22 | /**
23 | * The item which the reciever relates to.
24 | */
25 | @property (nonatomic, weak, readonly) id item;
26 |
27 | /**
28 | * The attribute which the reciever relates to
29 | */
30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
31 |
32 | /**
33 | * Convenience initializer.
34 | */
35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
36 |
37 | /**
38 | * The designated initializer.
39 | */
40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
41 |
42 | /**
43 | * Determine whether the layoutAttribute is a size attribute
44 | *
45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
46 | */
47 | - (BOOL)isSizeAttribute;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewAttribute.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 |
11 | @implementation MASViewAttribute
12 |
13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
15 | return self;
16 | }
17 |
18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
19 | self = [super init];
20 | if (!self) return nil;
21 |
22 | _view = view;
23 | _item = item;
24 | _layoutAttribute = layoutAttribute;
25 |
26 | return self;
27 | }
28 |
29 | - (BOOL)isSizeAttribute {
30 | return self.layoutAttribute == NSLayoutAttributeWidth
31 | || self.layoutAttribute == NSLayoutAttributeHeight;
32 | }
33 |
34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute {
35 | if ([viewAttribute isKindOfClass:self.class]) {
36 | return self.view == viewAttribute.view
37 | && self.layoutAttribute == viewAttribute.layoutAttribute;
38 | }
39 | return [super isEqual:viewAttribute];
40 | }
41 |
42 | - (NSUInteger)hash {
43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 | #import "MASUtilities.h"
13 |
14 | /**
15 | * A single constraint.
16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
17 | */
18 | @interface MASViewConstraint : MASConstraint
19 |
20 | /**
21 | * First item/view and first attribute of the NSLayoutConstraint
22 | */
23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
24 |
25 | /**
26 | * Second item/view and second attribute of the NSLayoutConstraint
27 | */
28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
29 |
30 | /**
31 | * initialises the MASViewConstraint with the first part of the equation
32 | *
33 | * @param firstViewAttribute view.mas_left, view.mas_width etc.
34 | *
35 | * @return a new view constraint
36 | */
37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
38 |
39 | /**
40 | * Returns all MASViewConstraints installed with this view as a first item.
41 | *
42 | * @param view A view to retrieve constraints for.
43 | *
44 | * @return An array of MASViewConstraints.
45 | */
46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Masonry.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for Masonry.
12 | FOUNDATION_EXPORT double MasonryVersionNumber;
13 |
14 | //! Project version string for Masonry.
15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
16 |
17 | #import "MASUtilities.h"
18 | #import "View+MASAdditions.h"
19 | #import "View+MASShorthandAdditions.h"
20 | #import "ViewController+MASAdditions.h"
21 | #import "NSArray+MASAdditions.h"
22 | #import "NSArray+MASShorthandAdditions.h"
23 | #import "MASConstraint.h"
24 | #import "MASCompositeConstraint.h"
25 | #import "MASViewAttribute.h"
26 | #import "MASViewConstraint.h"
27 | #import "MASConstraintMaker.h"
28 | #import "MASLayoutConstraint.h"
29 | #import "NSLayoutConstraint+MASDebugAdditions.h"
30 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.h
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | typedef NS_ENUM(NSUInteger, MASAxisType) {
14 | MASAxisTypeHorizontal,
15 | MASAxisTypeVertical
16 | };
17 |
18 | @interface NSArray (MASAdditions)
19 |
20 | /**
21 | * Creates a MASConstraintMaker with each view in the callee.
22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view
23 | *
24 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
25 | *
26 | * @return Array of created MASConstraints
27 | */
28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
29 |
30 | /**
31 | * Creates a MASConstraintMaker with each view in the callee.
32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
33 | * If an existing constraint exists then it will be updated instead.
34 | *
35 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
36 | *
37 | * @return Array of created/updated MASConstraints
38 | */
39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
40 |
41 | /**
42 | * Creates a MASConstraintMaker with each view in the callee.
43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
44 | * All constraints previously installed for the views will be removed.
45 | *
46 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
47 | *
48 | * @return Array of created/updated MASConstraints
49 | */
50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
51 |
52 | /**
53 | * distribute with fixed spacing
54 | *
55 | * @param axisType which axis to distribute items along
56 | * @param fixedSpacing the spacing between each item
57 | * @param leadSpacing the spacing before the first item and the container
58 | * @param tailSpacing the spacing after the last item and the container
59 | */
60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
61 |
62 | /**
63 | * distribute with fixed item size
64 | *
65 | * @param axisType which axis to distribute items along
66 | * @param fixedItemLength the fixed length of each item
67 | * @param leadSpacing the spacing before the first item and the container
68 | * @param tailSpacing the spacing after the last item and the container
69 | */
70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.m
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 | #import "View+MASAdditions.h"
11 |
12 | @implementation NSArray (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block {
15 | NSMutableArray *constraints = [NSMutableArray array];
16 | for (MAS_VIEW *view in self) {
17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]];
19 | }
20 | return constraints;
21 | }
22 |
23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block {
24 | NSMutableArray *constraints = [NSMutableArray array];
25 | for (MAS_VIEW *view in self) {
26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]];
28 | }
29 | return constraints;
30 | }
31 |
32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
33 | NSMutableArray *constraints = [NSMutableArray array];
34 | for (MAS_VIEW *view in self) {
35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]];
37 | }
38 | return constraints;
39 | }
40 |
41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
42 | if (self.count < 2) {
43 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
44 | return;
45 | }
46 |
47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
48 | if (axisType == MASAxisTypeHorizontal) {
49 | MAS_VIEW *prev;
50 | for (int i = 0; i < self.count; i++) {
51 | MAS_VIEW *v = self[i];
52 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
53 | if (prev) {
54 | make.width.equalTo(prev);
55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing);
56 | if (i == self.count - 1) {//last one
57 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
58 | }
59 | }
60 | else {//first one
61 | make.left.equalTo(tempSuperView).offset(leadSpacing);
62 | }
63 |
64 | }];
65 | prev = v;
66 | }
67 | }
68 | else {
69 | MAS_VIEW *prev;
70 | for (int i = 0; i < self.count; i++) {
71 | MAS_VIEW *v = self[i];
72 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
73 | if (prev) {
74 | make.height.equalTo(prev);
75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing);
76 | if (i == self.count - 1) {//last one
77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
78 | }
79 | }
80 | else {//first one
81 | make.top.equalTo(tempSuperView).offset(leadSpacing);
82 | }
83 |
84 | }];
85 | prev = v;
86 | }
87 | }
88 | }
89 |
90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
91 | if (self.count < 2) {
92 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
93 | return;
94 | }
95 |
96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
97 | if (axisType == MASAxisTypeHorizontal) {
98 | MAS_VIEW *prev;
99 | for (int i = 0; i < self.count; i++) {
100 | MAS_VIEW *v = self[i];
101 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
102 | make.width.equalTo(@(fixedItemLength));
103 | if (prev) {
104 | if (i == self.count - 1) {//last one
105 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
106 | }
107 | else {
108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
110 | }
111 | }
112 | else {//first one
113 | make.left.equalTo(tempSuperView).offset(leadSpacing);
114 | }
115 | }];
116 | prev = v;
117 | }
118 | }
119 | else {
120 | MAS_VIEW *prev;
121 | for (int i = 0; i < self.count; i++) {
122 | MAS_VIEW *v = self[i];
123 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
124 | make.height.equalTo(@(fixedItemLength));
125 | if (prev) {
126 | if (i == self.count - 1) {//last one
127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
128 | }
129 | else {
130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
132 | }
133 | }
134 | else {//first one
135 | make.top.equalTo(tempSuperView).offset(leadSpacing);
136 | }
137 | }];
138 | prev = v;
139 | }
140 | }
141 | }
142 |
143 | - (MAS_VIEW *)mas_commonSuperviewOfViews
144 | {
145 | MAS_VIEW *commonSuperview = nil;
146 | MAS_VIEW *previousView = nil;
147 | for (id object in self) {
148 | if ([object isKindOfClass:[MAS_VIEW class]]) {
149 | MAS_VIEW *view = (MAS_VIEW *)object;
150 | if (previousView) {
151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview];
152 | } else {
153 | commonSuperview = view;
154 | }
155 | previousView = view;
156 | }
157 | }
158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy.");
159 | return commonSuperview;
160 | }
161 |
162 | @end
163 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand array additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface NSArray (MASShorthandAdditions)
18 |
19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
22 |
23 | @end
24 |
25 | @implementation NSArray (MASShorthandAdditions)
26 |
27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
28 | return [self mas_makeConstraints:block];
29 | }
30 |
31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
32 | return [self mas_updateConstraints:block];
33 | }
34 |
35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
36 | return [self mas_remakeConstraints:block];
37 | }
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * makes debug and log output of NSLayoutConstraints more readable
13 | */
14 | @interface NSLayoutConstraint (MASDebugAdditions)
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSLayoutConstraint+MASDebugAdditions.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 |
13 | @implementation NSLayoutConstraint (MASDebugAdditions)
14 |
15 | #pragma mark - description maps
16 |
17 | + (NSDictionary *)layoutRelationDescriptionsByValue {
18 | static dispatch_once_t once;
19 | static NSDictionary *descriptionMap;
20 | dispatch_once(&once, ^{
21 | descriptionMap = @{
22 | @(NSLayoutRelationEqual) : @"==",
23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=",
24 | @(NSLayoutRelationLessThanOrEqual) : @"<=",
25 | };
26 | });
27 | return descriptionMap;
28 | }
29 |
30 | + (NSDictionary *)layoutAttributeDescriptionsByValue {
31 | static dispatch_once_t once;
32 | static NSDictionary *descriptionMap;
33 | dispatch_once(&once, ^{
34 | descriptionMap = @{
35 | @(NSLayoutAttributeTop) : @"top",
36 | @(NSLayoutAttributeLeft) : @"left",
37 | @(NSLayoutAttributeBottom) : @"bottom",
38 | @(NSLayoutAttributeRight) : @"right",
39 | @(NSLayoutAttributeLeading) : @"leading",
40 | @(NSLayoutAttributeTrailing) : @"trailing",
41 | @(NSLayoutAttributeWidth) : @"width",
42 | @(NSLayoutAttributeHeight) : @"height",
43 | @(NSLayoutAttributeCenterX) : @"centerX",
44 | @(NSLayoutAttributeCenterY) : @"centerY",
45 | @(NSLayoutAttributeBaseline) : @"baseline",
46 |
47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline",
49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline",
50 | #endif
51 |
52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin",
54 | @(NSLayoutAttributeRightMargin) : @"rightMargin",
55 | @(NSLayoutAttributeTopMargin) : @"topMargin",
56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin",
57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin",
58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin",
59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins",
60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins",
61 | #endif
62 |
63 | };
64 |
65 | });
66 | return descriptionMap;
67 | }
68 |
69 |
70 | + (NSDictionary *)layoutPriorityDescriptionsByValue {
71 | static dispatch_once_t once;
72 | static NSDictionary *descriptionMap;
73 | dispatch_once(&once, ^{
74 | #if TARGET_OS_IPHONE || TARGET_OS_TV
75 | descriptionMap = @{
76 | @(MASLayoutPriorityDefaultHigh) : @"high",
77 | @(MASLayoutPriorityDefaultLow) : @"low",
78 | @(MASLayoutPriorityDefaultMedium) : @"medium",
79 | @(MASLayoutPriorityRequired) : @"required",
80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size",
81 | };
82 | #elif TARGET_OS_MAC
83 | descriptionMap = @{
84 | @(MASLayoutPriorityDefaultHigh) : @"high",
85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window",
86 | @(MASLayoutPriorityDefaultMedium) : @"medium",
87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put",
88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window",
89 | @(MASLayoutPriorityDefaultLow) : @"low",
90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size",
91 | @(MASLayoutPriorityRequired) : @"required",
92 | };
93 | #endif
94 | });
95 | return descriptionMap;
96 | }
97 |
98 | #pragma mark - description override
99 |
100 | + (NSString *)descriptionForObject:(id)obj {
101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) {
102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]];
103 | }
104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj];
105 | }
106 |
107 | - (NSString *)description {
108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"];
109 |
110 | [description appendString:[self.class descriptionForObject:self]];
111 |
112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]];
113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) {
114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]];
115 | }
116 |
117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]];
118 |
119 | if (self.secondItem) {
120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]];
121 | }
122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) {
123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]];
124 | }
125 |
126 | if (self.multiplier != 1) {
127 | [description appendFormat:@" * %g", self.multiplier];
128 | }
129 |
130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) {
131 | [description appendFormat:@" %g", self.constant];
132 | } else {
133 | if (self.constant) {
134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)];
135 | }
136 | }
137 |
138 | if (self.priority != MASLayoutPriorityRequired) {
139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]];
140 | }
141 |
142 | [description appendString:@">"];
143 | return description;
144 | }
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | /**
14 | * Provides constraint maker block
15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs
16 | */
17 | @interface MAS_VIEW (MASAdditions)
18 |
19 | /**
20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute
21 | */
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX;
31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY;
32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr);
34 |
35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
36 |
37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline;
38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline;
39 |
40 | #endif
41 |
42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
43 |
44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin;
49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin;
50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins;
51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins;
52 |
53 | #endif
54 |
55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
56 |
57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0));
58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0));
59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0));
60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0));
61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0));
62 |
63 | #endif
64 |
65 | /**
66 | * a key to associate with this view
67 | */
68 | @property (nonatomic, strong) id mas_key;
69 |
70 | /**
71 | * Finds the closest common superview between this view and another view
72 | *
73 | * @param view other view
74 | *
75 | * @return returns nil if common superview could not be found
76 | */
77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view;
78 |
79 | /**
80 | * Creates a MASConstraintMaker with the callee view.
81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing
82 | *
83 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
84 | *
85 | * @return Array of created MASConstraints
86 | */
87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
88 |
89 | /**
90 | * Creates a MASConstraintMaker with the callee view.
91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
92 | * If an existing constraint exists then it will be updated instead.
93 | *
94 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
95 | *
96 | * @return Array of created/updated MASConstraints
97 | */
98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
99 |
100 | /**
101 | * Creates a MASConstraintMaker with the callee view.
102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
103 | * All constraints previously installed for the view will be removed.
104 | *
105 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
106 | *
107 | * @return Array of created/updated MASConstraints
108 | */
109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 | #import
11 |
12 | @implementation MAS_VIEW (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block {
15 | self.translatesAutoresizingMaskIntoConstraints = NO;
16 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
17 | block(constraintMaker);
18 | return [constraintMaker install];
19 | }
20 |
21 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block {
22 | self.translatesAutoresizingMaskIntoConstraints = NO;
23 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
24 | constraintMaker.updateExisting = YES;
25 | block(constraintMaker);
26 | return [constraintMaker install];
27 | }
28 |
29 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
30 | self.translatesAutoresizingMaskIntoConstraints = NO;
31 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
32 | constraintMaker.removeExisting = YES;
33 | block(constraintMaker);
34 | return [constraintMaker install];
35 | }
36 |
37 | #pragma mark - NSLayoutAttribute properties
38 |
39 | - (MASViewAttribute *)mas_left {
40 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft];
41 | }
42 |
43 | - (MASViewAttribute *)mas_top {
44 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop];
45 | }
46 |
47 | - (MASViewAttribute *)mas_right {
48 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight];
49 | }
50 |
51 | - (MASViewAttribute *)mas_bottom {
52 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom];
53 | }
54 |
55 | - (MASViewAttribute *)mas_leading {
56 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading];
57 | }
58 |
59 | - (MASViewAttribute *)mas_trailing {
60 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing];
61 | }
62 |
63 | - (MASViewAttribute *)mas_width {
64 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth];
65 | }
66 |
67 | - (MASViewAttribute *)mas_height {
68 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight];
69 | }
70 |
71 | - (MASViewAttribute *)mas_centerX {
72 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX];
73 | }
74 |
75 | - (MASViewAttribute *)mas_centerY {
76 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY];
77 | }
78 |
79 | - (MASViewAttribute *)mas_baseline {
80 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline];
81 | }
82 |
83 | - (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute
84 | {
85 | return ^(NSLayoutAttribute attr) {
86 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr];
87 | };
88 | }
89 |
90 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
91 |
92 | - (MASViewAttribute *)mas_firstBaseline {
93 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline];
94 | }
95 | - (MASViewAttribute *)mas_lastBaseline {
96 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline];
97 | }
98 |
99 | #endif
100 |
101 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
102 |
103 | - (MASViewAttribute *)mas_leftMargin {
104 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin];
105 | }
106 |
107 | - (MASViewAttribute *)mas_rightMargin {
108 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin];
109 | }
110 |
111 | - (MASViewAttribute *)mas_topMargin {
112 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin];
113 | }
114 |
115 | - (MASViewAttribute *)mas_bottomMargin {
116 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin];
117 | }
118 |
119 | - (MASViewAttribute *)mas_leadingMargin {
120 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin];
121 | }
122 |
123 | - (MASViewAttribute *)mas_trailingMargin {
124 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin];
125 | }
126 |
127 | - (MASViewAttribute *)mas_centerXWithinMargins {
128 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins];
129 | }
130 |
131 | - (MASViewAttribute *)mas_centerYWithinMargins {
132 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins];
133 | }
134 |
135 | #endif
136 |
137 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
138 |
139 | - (MASViewAttribute *)mas_safeAreaLayoutGuide {
140 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
141 | }
142 | - (MASViewAttribute *)mas_safeAreaLayoutGuideTop {
143 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop];
144 | }
145 | - (MASViewAttribute *)mas_safeAreaLayoutGuideBottom {
146 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
147 | }
148 | - (MASViewAttribute *)mas_safeAreaLayoutGuideLeft {
149 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft];
150 | }
151 | - (MASViewAttribute *)mas_safeAreaLayoutGuideRight {
152 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight];
153 | }
154 |
155 | #endif
156 |
157 | #pragma mark - associated properties
158 |
159 | - (id)mas_key {
160 | return objc_getAssociatedObject(self, @selector(mas_key));
161 | }
162 |
163 | - (void)setMas_key:(id)key {
164 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
165 | }
166 |
167 | #pragma mark - heirachy
168 |
169 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view {
170 | MAS_VIEW *closestCommonSuperview = nil;
171 |
172 | MAS_VIEW *secondViewSuperview = view;
173 | while (!closestCommonSuperview && secondViewSuperview) {
174 | MAS_VIEW *firstViewSuperview = self;
175 | while (!closestCommonSuperview && firstViewSuperview) {
176 | if (secondViewSuperview == firstViewSuperview) {
177 | closestCommonSuperview = secondViewSuperview;
178 | }
179 | firstViewSuperview = firstViewSuperview.superview;
180 | }
181 | secondViewSuperview = secondViewSuperview.superview;
182 | }
183 | return closestCommonSuperview;
184 | }
185 |
186 | @end
187 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand view additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface MAS_VIEW (MASShorthandAdditions)
18 |
19 | @property (nonatomic, strong, readonly) MASViewAttribute *left;
20 | @property (nonatomic, strong, readonly) MASViewAttribute *top;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *right;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *width;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *height;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr);
31 |
32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
33 |
34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline;
35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline;
36 |
37 | #endif
38 |
39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
40 |
41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin;
42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin;
43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin;
44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins;
49 |
50 | #endif
51 |
52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
53 |
54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0));
55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0));
56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0));
57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0));
58 |
59 | #endif
60 |
61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
64 |
65 | @end
66 |
67 | #define MAS_ATTR_FORWARD(attr) \
68 | - (MASViewAttribute *)attr { \
69 | return [self mas_##attr]; \
70 | }
71 |
72 | @implementation MAS_VIEW (MASShorthandAdditions)
73 |
74 | MAS_ATTR_FORWARD(top);
75 | MAS_ATTR_FORWARD(left);
76 | MAS_ATTR_FORWARD(bottom);
77 | MAS_ATTR_FORWARD(right);
78 | MAS_ATTR_FORWARD(leading);
79 | MAS_ATTR_FORWARD(trailing);
80 | MAS_ATTR_FORWARD(width);
81 | MAS_ATTR_FORWARD(height);
82 | MAS_ATTR_FORWARD(centerX);
83 | MAS_ATTR_FORWARD(centerY);
84 | MAS_ATTR_FORWARD(baseline);
85 |
86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
87 |
88 | MAS_ATTR_FORWARD(firstBaseline);
89 | MAS_ATTR_FORWARD(lastBaseline);
90 |
91 | #endif
92 |
93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
94 |
95 | MAS_ATTR_FORWARD(leftMargin);
96 | MAS_ATTR_FORWARD(rightMargin);
97 | MAS_ATTR_FORWARD(topMargin);
98 | MAS_ATTR_FORWARD(bottomMargin);
99 | MAS_ATTR_FORWARD(leadingMargin);
100 | MAS_ATTR_FORWARD(trailingMargin);
101 | MAS_ATTR_FORWARD(centerXWithinMargins);
102 | MAS_ATTR_FORWARD(centerYWithinMargins);
103 |
104 | #endif
105 |
106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
107 |
108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop);
109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom);
110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft);
111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight);
112 |
113 | #endif
114 |
115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute {
116 | return [self mas_attribute];
117 | }
118 |
119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
120 | return [self mas_makeConstraints:block];
121 | }
122 |
123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
124 | return [self mas_updateConstraints:block];
125 | }
126 |
127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
128 | return [self mas_remakeConstraints:block];
129 | }
130 |
131 | @end
132 |
133 | #endif
134 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | #ifdef MAS_VIEW_CONTROLLER
14 |
15 | @interface MAS_VIEW_CONTROLLER (MASAdditions)
16 |
17 | /**
18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute
19 | */
20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom;
26 |
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/ViewController+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "ViewController+MASAdditions.h"
10 |
11 | #ifdef MAS_VIEW_CONTROLLER
12 |
13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions)
14 |
15 | - (MASViewAttribute *)mas_topLayoutGuide {
16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
17 | }
18 | - (MASViewAttribute *)mas_topLayoutGuideTop {
19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop];
20 | }
21 | - (MASViewAttribute *)mas_topLayoutGuideBottom {
22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
23 | }
24 |
25 | - (MASViewAttribute *)mas_bottomLayoutGuide {
26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
27 | }
28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop {
29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
30 | }
31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom {
32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
33 | }
34 |
35 |
36 |
37 | @end
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Jersey.xcuserdatad/xcschemes/JLRoutes.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 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Jersey.xcuserdatad/xcschemes/Masonry.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 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Jersey.xcuserdatad/xcschemes/Pods-JSDRouterGuide.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Jersey.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | JLRoutes.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 0
13 |
14 | Masonry.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 1
20 |
21 | Pods-JSDRouterGuide.xcscheme
22 |
23 | isShown
24 |
25 | orderHint
26 | 2
27 |
28 |
29 | SuppressBuildableAutocreation
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.6.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_JLRoutes : NSObject
3 | @end
4 | @implementation PodsDummy_JLRoutes
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes-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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes-umbrella.h:
--------------------------------------------------------------------------------
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 | #import "JLRoutes.h"
14 |
15 | FOUNDATION_EXPORT double JLRoutesVersionNumber;
16 | FOUNDATION_EXPORT const unsigned char JLRoutesVersionString[];
17 |
18 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes.modulemap:
--------------------------------------------------------------------------------
1 | framework module JLRoutes {
2 | umbrella header "JLRoutes-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/JLRoutes/JLRoutes.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JLRoutes
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation"
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}/JLRoutes
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Masonry : NSObject
3 | @end
4 | @implementation PodsDummy_Masonry
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-umbrella.h:
--------------------------------------------------------------------------------
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 | #import "MASCompositeConstraint.h"
14 | #import "MASConstraint+Private.h"
15 | #import "MASConstraint.h"
16 | #import "MASConstraintMaker.h"
17 | #import "MASLayoutConstraint.h"
18 | #import "Masonry.h"
19 | #import "MASUtilities.h"
20 | #import "MASViewAttribute.h"
21 | #import "MASViewConstraint.h"
22 | #import "NSArray+MASAdditions.h"
23 | #import "NSArray+MASShorthandAdditions.h"
24 | #import "NSLayoutConstraint+MASDebugAdditions.h"
25 | #import "View+MASAdditions.h"
26 | #import "View+MASShorthandAdditions.h"
27 | #import "ViewController+MASAdditions.h"
28 |
29 | FOUNDATION_EXPORT double MasonryVersionNumber;
30 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
31 |
32 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry.modulemap:
--------------------------------------------------------------------------------
1 | framework module Masonry {
2 | umbrella header "Masonry-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit"
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}/Masonry
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## JLRoutes
5 |
6 | Copyright (c) 2016, Joel Levin. All rights reserved.
7 |
8 | - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9 | - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11 |
12 | Neither the name of JLRoutes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 |
15 |
16 | ## Masonry
17 |
18 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
19 |
20 | Permission is hereby granted, free of charge, to any person obtaining a copy
21 | of this software and associated documentation files (the "Software"), to deal
22 | in the Software without restriction, including without limitation the rights
23 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24 | copies of the Software, and to permit persons to whom the Software is
25 | furnished to do so, subject to the following conditions:
26 |
27 | The above copyright notice and this permission notice shall be included in
28 | all copies or substantial portions of the Software.
29 |
30 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
36 | THE SOFTWARE.
37 | Generated by CocoaPods - https://cocoapods.org
38 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-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 | Copyright (c) 2016, Joel Levin. All rights reserved.
18 |
19 | - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
20 | - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
21 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
22 |
23 | Neither the name of JLRoutes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
26 | License
27 | BSD 3-Clause "New" License
28 | Title
29 | JLRoutes
30 | Type
31 | PSGroupSpecifier
32 |
33 |
34 | FooterText
35 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
36 |
37 | Permission is hereby granted, free of charge, to any person obtaining a copy
38 | of this software and associated documentation files (the "Software"), to deal
39 | in the Software without restriction, including without limitation the rights
40 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41 | copies of the Software, and to permit persons to whom the Software is
42 | furnished to do so, subject to the following conditions:
43 |
44 | The above copyright notice and this permission notice shall be included in
45 | all copies or substantial portions of the Software.
46 |
47 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
53 | THE SOFTWARE.
54 | License
55 | MIT
56 | Title
57 | Masonry
58 | Type
59 | PSGroupSpecifier
60 |
61 |
62 | FooterText
63 | Generated by CocoaPods - https://cocoapods.org
64 | Title
65 |
66 | Type
67 | PSGroupSpecifier
68 |
69 |
70 | StringsTable
71 | Acknowledgements
72 | Title
73 | Acknowledgements
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_JSDRouterGuide : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_JSDRouterGuide
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks-Debug-input-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${PODS_ROOT}/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks.sh
2 | ${BUILT_PRODUCTS_DIR}/JLRoutes/JLRoutes.framework
3 | ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks-Debug-output-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JLRoutes.framework
2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks-Release-input-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${PODS_ROOT}/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks.sh
2 | ${BUILT_PRODUCTS_DIR}/JLRoutes/JLRoutes.framework
3 | ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks-Release-output-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JLRoutes.framework
2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | function on_error {
7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
8 | }
9 | trap 'on_error $LINENO' ERR
10 |
11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
13 | # frameworks to, so exit 0 (signalling the script phase was successful).
14 | exit 0
15 | fi
16 |
17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
19 |
20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
22 |
23 | # Used as a return value for each invocation of `strip_invalid_archs` function.
24 | STRIP_BINARY_RETVAL=0
25 |
26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
29 |
30 | # Copies and strips a vendored framework
31 | install_framework()
32 | {
33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
34 | local source="${BUILT_PRODUCTS_DIR}/$1"
35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
37 | elif [ -r "$1" ]; then
38 | local source="$1"
39 | fi
40 |
41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
42 |
43 | if [ -L "${source}" ]; then
44 | echo "Symlinked..."
45 | source="$(readlink "${source}")"
46 | fi
47 |
48 | # Use filter instead of exclude so missing patterns don't throw errors.
49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
51 |
52 | local basename
53 | basename="$(basename -s .framework "$1")"
54 | binary="${destination}/${basename}.framework/${basename}"
55 |
56 | if ! [ -r "$binary" ]; then
57 | binary="${destination}/${basename}"
58 | elif [ -L "${binary}" ]; then
59 | echo "Destination binary is symlinked..."
60 | dirname="$(dirname "${binary}")"
61 | binary="${dirname}/$(readlink "${binary}")"
62 | fi
63 |
64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
66 | strip_invalid_archs "$binary"
67 | fi
68 |
69 | # Resign the code if required by the build settings to avoid unstable apps
70 | code_sign_if_enabled "${destination}/$(basename "$1")"
71 |
72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
74 | local swift_runtime_libs
75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
76 | for lib in $swift_runtime_libs; do
77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
79 | code_sign_if_enabled "${destination}/${lib}"
80 | done
81 | fi
82 | }
83 |
84 | # Copies and strips a vendored dSYM
85 | install_dsym() {
86 | local source="$1"
87 | if [ -r "$source" ]; then
88 | # Copy the dSYM into a the targets temp dir.
89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
91 |
92 | local basename
93 | basename="$(basename -s .framework.dSYM "$source")"
94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
95 |
96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
98 | strip_invalid_archs "$binary"
99 | fi
100 |
101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
102 | # Move the stripped file into its final destination.
103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
105 | else
106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
108 | fi
109 | fi
110 | }
111 |
112 | # Copies the bcsymbolmap files of a vendored framework
113 | install_bcsymbolmap() {
114 | local bcsymbolmap_path="$1"
115 | local destination="${BUILT_PRODUCTS_DIR}"
116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
118 | }
119 |
120 | # Signs a framework with the provided identity
121 | code_sign_if_enabled() {
122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
123 | # Use the current code_sign_identity
124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
126 |
127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
128 | code_sign_cmd="$code_sign_cmd &"
129 | fi
130 | echo "$code_sign_cmd"
131 | eval "$code_sign_cmd"
132 | fi
133 | }
134 |
135 | # Strip invalid architectures
136 | strip_invalid_archs() {
137 | binary="$1"
138 | # Get architectures for current target binary
139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
140 | # Intersect them with the architectures we are building for
141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
142 | # If there are no archs supported by this binary then warn the user
143 | if [[ -z "$intersected_archs" ]]; then
144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
145 | STRIP_BINARY_RETVAL=0
146 | return
147 | fi
148 | stripped=""
149 | for arch in $binary_archs; do
150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
151 | # Strip non-valid architectures in-place
152 | lipo -remove "$arch" -output "$binary" "$binary"
153 | stripped="$stripped $arch"
154 | fi
155 | done
156 | if [[ "$stripped" ]]; then
157 | echo "Stripped $binary of architectures:$stripped"
158 | fi
159 | STRIP_BINARY_RETVAL=1
160 | }
161 |
162 |
163 | if [[ "$CONFIGURATION" == "Debug" ]]; then
164 | install_framework "${BUILT_PRODUCTS_DIR}/JLRoutes/JLRoutes.framework"
165 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework"
166 | fi
167 | if [[ "$CONFIGURATION" == "Release" ]]; then
168 | install_framework "${BUILT_PRODUCTS_DIR}/JLRoutes/JLRoutes.framework"
169 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework"
170 | fi
171 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
172 | wait
173 | fi
174 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide-umbrella.h:
--------------------------------------------------------------------------------
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 |
14 | FOUNDATION_EXPORT double Pods_JSDRouterGuideVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_JSDRouterGuideVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JLRoutes" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JLRoutes/JLRoutes.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "JLRoutes" -framework "Masonry" -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 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_JSDRouterGuide {
2 | umbrella header "Pods-JSDRouterGuide-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-JSDRouterGuide/Pods-JSDRouterGuide.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JLRoutes" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JLRoutes/JLRoutes.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "JLRoutes" -framework "Masonry" -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 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JSDRouterGuide
2 | 基于 JLRoutes 封装实现组件化架构
3 |
4 | ## 优雅的封装 Router!
5 | 针对 JLRoutes 进行封装, 完成 App 内所有控制器之间跳转, 解除不同模块之间非必要的耦合度;
6 |
7 | ## 已完成
8 |
9 | * App 内控制器跳转, 传参等;
10 |
11 | ## 待补充
12 | App 内部跳转除了, 频繁的控制器之间切换外, 还有比如跳转到 H5, 或者跳转到 WebView 等;
13 | App 外跳转则包含 Scheme 启动, 3D Touch, UniversalLink, 点击通知等都会触发;
14 | 这些包含跳转, 页面切换的我们均可以统一使用 Router 来进行有效的管理, 使 App 变得更加动态化, 模块之间耦合度更低;
15 | * [ ] 支持 H5 跳转
16 | * [ ] 外部 Scheme 启动 App
17 | * [ ] UniversalLink
18 | * [ ] 3D Touch Shortcut
19 | * [ ] 支持后台动态下发 RouterMap 配置
20 |
21 | **后续会继续更新文章和代码,让 Router 完善起来!**
22 |
23 | Blog 传送门: [掘金](https://juejin.im/post/5dfb2540f265da33942a8783)
24 |
--------------------------------------------------------------------------------