├── NotificationCenter.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── PhantomDev.xcuserdatad │ └── xcschemes │ ├── NotificationCenter.xcscheme │ ├── NotificationCenterContentA.xcscheme │ ├── NotificationCenterContentB.xcscheme │ ├── NotificationCenterContentD.xcscheme │ ├── NotificationCenterService.xcscheme │ └── xcschememanagement.plist ├── NotificationCenter.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── PhantomDev.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── NotificationCenter ├── AppDelegate+JPushAPNS.m ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon的副本 2.png │ │ ├── icon的副本 3.png │ │ ├── icon的副本 4.png │ │ ├── icon的副本 5.png │ │ ├── icon的副本 6-1.png │ │ ├── icon的副本 6.png │ │ ├── icon的副本 7.png │ │ └── icon的副本.png │ ├── Contents.json │ ├── default_launch.imageset │ │ ├── Contents.json │ │ └── default_launch.png │ └── notification_launch.imageset │ │ ├── Contents.json │ │ └── notification_launch.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── NotificationCenter.entitlements ├── NotificationCenter │ ├── AccessoryImageViewController.h │ ├── AccessoryImageViewController.m │ ├── AccessoryVideoViewController.h │ ├── AccessoryVideoViewController.m │ ├── ActionNoOperationViewController.h │ ├── ActionNoOperationViewController.m │ ├── ActionOperationInputViewController.h │ ├── ActionOperationInputViewController.m │ ├── ActionOperationViewController.h │ ├── ActionOperationViewController.m │ ├── ContentFeedbackViewController.h │ ├── ContentFeedbackViewController.m │ ├── CustomContentViewController.h │ ├── CustomContentViewController.m │ ├── LaunchScreenViewController.h │ ├── LaunchScreenViewController.m │ ├── NotificationCenterViewController.h │ ├── NotificationCenterViewController.m │ ├── RemoveDefaultContentViewController.h │ ├── RemoveDefaultContentViewController.m │ ├── SimpleLocalViewController.h │ ├── SimpleLocalViewController.m │ ├── SoundAndBadgeViewController.h │ ├── SoundAndBadgeViewController.m │ ├── TwoTitleLocalViewController.h │ └── TwoTitleLocalViewController.m ├── Resource │ ├── accessory_icon.png │ ├── notification_sound.wav │ └── notification_video.m4v ├── ThirdLibrary │ └── JPush │ │ ├── JPUSHService.h │ │ └── jpush-ios-2.1.9.a ├── ViewController.h ├── ViewController.m └── main.m ├── NotificationCenterContentA ├── Base.lproj │ └── MainInterface.storyboard ├── Info.plist ├── NotificationViewController.h └── NotificationViewController.m ├── NotificationCenterContentB ├── Base.lproj │ └── MainInterface.storyboard ├── Info.plist ├── NotificationViewController.h └── NotificationViewController.m ├── NotificationCenterContentD ├── Base.lproj │ └── MainInterface.storyboard ├── Info.plist ├── NotificationViewController.h └── NotificationViewController.m ├── NotificationCenterService ├── Info.plist ├── NotificationService.h └── NotificationService.m ├── Podfile ├── Podfile.lock ├── Pods ├── Headers │ ├── Private │ │ ├── MBProgressHUD │ │ │ └── MBProgressHUD.h │ │ └── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ └── View+MASShorthandAdditions.h │ └── Public │ │ ├── MBProgressHUD │ │ └── MBProgressHUD.h │ │ └── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ └── View+MASShorthandAdditions.h ├── MBProgressHUD │ ├── LICENSE │ ├── MBProgressHUD.h │ ├── MBProgressHUD.m │ └── README.mdown ├── 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 │ └── README.md ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── PhantomDev.xcuserdatad │ │ └── xcschemes │ │ ├── MBProgressHUD.xcscheme │ │ ├── Masonry.xcscheme │ │ ├── Pods-NotificationCenter.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── MBProgressHUD │ ├── MBProgressHUD-dummy.m │ ├── MBProgressHUD-prefix.pch │ └── MBProgressHUD.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ └── Pods-NotificationCenter │ ├── Pods-NotificationCenter-acknowledgements.markdown │ ├── Pods-NotificationCenter-acknowledgements.plist │ ├── Pods-NotificationCenter-dummy.m │ ├── Pods-NotificationCenter-frameworks.sh │ ├── Pods-NotificationCenter-resources.sh │ ├── Pods-NotificationCenter.debug.xcconfig │ └── Pods-NotificationCenter.release.xcconfig └── README.md /NotificationCenter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/NotificationCenter.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 69 | 70 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/NotificationCenterContentA.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 70 | 72 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | 92 | 98 | 99 | 100 | 101 | 103 | 104 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/NotificationCenterContentB.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 70 | 72 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | 92 | 98 | 99 | 100 | 101 | 103 | 104 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/NotificationCenterContentD.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 70 | 72 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | 92 | 98 | 99 | 100 | 101 | 103 | 104 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/NotificationCenterService.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 70 | 72 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | 92 | 98 | 99 | 100 | 101 | 103 | 104 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /NotificationCenter.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NotificationCenter.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | NotificationCenterContentA.xcscheme 13 | 14 | orderHint 15 | 5 16 | 17 | NotificationCenterContentB.xcscheme 18 | 19 | orderHint 20 | 6 21 | 22 | NotificationCenterContentD.xcscheme 23 | 24 | orderHint 25 | 7 26 | 27 | NotificationCenterService.xcscheme 28 | 29 | orderHint 30 | 4 31 | 32 | 33 | SuppressBuildableAutocreation 34 | 35 | F961A9FE1D9507A0006B501A 36 | 37 | primary 38 | 39 | 40 | F98359151D9555C600890DC5 41 | 42 | primary 43 | 44 | 45 | F98359261D9555F700890DC5 46 | 47 | primary 48 | 49 | 50 | F983593C1D95560A00890DC5 51 | 52 | primary 53 | 54 | 55 | F98359581D96295100890DC5 56 | 57 | primary 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /NotificationCenter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /NotificationCenter.xcworkspace/xcuserdata/PhantomDev.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 88 | 100 | 101 | 102 | 104 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /NotificationCenter/AppDelegate+JPushAPNS.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate+JPushAPNS.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "JPUSHService.h" 11 | 12 | @implementation AppDelegate (JPushAPNS) 13 | 14 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 15 | // Apns注册成功,该方法没有没有变化。 16 | 17 | // 通过JPUSH上传设备Token. 18 | [JPUSHService registerDeviceToken:deviceToken]; 19 | } 20 | 21 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ 22 | [JPUSHService handleRemoteNotification:userInfo]; 23 | } 24 | 25 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void(^)(UIBackgroundFetchResult))completionHandler { 26 | // 获取推送信息. 27 | [JPUSHService handleRemoteNotification:userInfo]; 28 | completionHandler(UIBackgroundFetchResultNewData); 29 | } 30 | 31 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { 32 | // Apns注册失败. 33 | [JPUSHService registerDeviceToken:nil]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /NotificationCenter/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon的副本.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon的副本 2.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon的副本 3.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon的副本 4.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon的副本 5.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon的副本 6.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon的副本 6-1.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon的副本 7.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "idiom" : "ipad", 53 | "size" : "20x20", 54 | "scale" : "1x" 55 | }, 56 | { 57 | "idiom" : "ipad", 58 | "size" : "20x20", 59 | "scale" : "2x" 60 | }, 61 | { 62 | "idiom" : "ipad", 63 | "size" : "29x29", 64 | "scale" : "1x" 65 | }, 66 | { 67 | "idiom" : "ipad", 68 | "size" : "29x29", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "idiom" : "ipad", 73 | "size" : "40x40", 74 | "scale" : "1x" 75 | }, 76 | { 77 | "idiom" : "ipad", 78 | "size" : "40x40", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "idiom" : "ipad", 83 | "size" : "76x76", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "idiom" : "ipad", 88 | "size" : "76x76", 89 | "scale" : "2x" 90 | }, 91 | { 92 | "idiom" : "ipad", 93 | "size" : "83.5x83.5", 94 | "scale" : "2x" 95 | } 96 | ], 97 | "info" : { 98 | "version" : 1, 99 | "author" : "xcode" 100 | } 101 | } -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 2.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 3.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 4.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 5.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 6-1.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 6.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本 7.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/AppIcon.appiconset/icon的副本.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/default_launch.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "default_launch.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/default_launch.imageset/default_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/default_launch.imageset/default_launch.png -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/notification_launch.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "notification_launch.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /NotificationCenter/Assets.xcassets/notification_launch.imageset/notification_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Assets.xcassets/notification_launch.imageset/notification_launch.png -------------------------------------------------------------------------------- /NotificationCenter/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NotificationCenter/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /NotificationCenter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 通知 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UIBackgroundModes 31 | 32 | remote-notification 33 | 34 | UILaunchStoryboardName 35 | LaunchScreen 36 | UIMainStoryboardFile 37 | Main 38 | UIRequiredDeviceCapabilities 39 | 40 | armv7 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UISupportedInterfaceOrientations~ipad 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationPortraitUpsideDown 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/AccessoryImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AccessoryImageViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface AccessoryImageViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/AccessoryImageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AccessoryImageViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "AccessoryImageViewController.h" 10 | 11 | @interface AccessoryImageViewController () 12 | 13 | @end 14 | 15 | @implementation AccessoryImageViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时带一个辅助图像。下拉该通知,放大图像。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"下拉放大图片"; 33 | 34 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 35 | ofType:@"png"]; 36 | if (imageFilePath) { 37 | NSError* error = nil; 38 | 39 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 40 | URL:[NSURL fileURLWithPath:imageFilePath] 41 | options:nil 42 | error:&error]; 43 | if (imageAttachment) { 44 | // 这里设置的是Array,但是只会取lastObject 45 | content.attachments = @[imageAttachment]; 46 | 47 | } 48 | } 49 | 50 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 51 | repeats:NO]; 52 | NSString* requestIdentifer = @"Request"; 53 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 54 | content:content 55 | trigger:trigger]; 56 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 57 | withCompletionHandler:^(NSError * _Nullable error) { 58 | NSLog(@"Error%@", error); 59 | }]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/AccessoryVideoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AccessoryVideoViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface AccessoryVideoViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/AccessoryVideoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AccessoryVideoViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "AccessoryVideoViewController.h" 10 | 11 | @interface AccessoryVideoViewController () 12 | 13 | @end 14 | 15 | @implementation AccessoryVideoViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时带一个辅助视频。下拉该通知,放大图像并准备播放。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"下拉放大图片,并准备播放"; 33 | 34 | // 需要注意。导入视频的时候,默认不是添加到bundle中,必须手动勾选Add to targets. 35 | NSString* videoFilePath = [[NSBundle mainBundle] pathForResource:@"notification_video" 36 | ofType:@"m4v"]; 37 | if (videoFilePath) { 38 | UNNotificationAttachment* videoAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"videoFilePath" 39 | URL:[NSURL fileURLWithPath:videoFilePath] 40 | options:nil 41 | error:nil]; 42 | if (videoAttachment) { 43 | // 这里设置的是Array,但是只会取lastObject 44 | content.attachments = @[videoAttachment]; 45 | } 46 | } 47 | 48 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 49 | repeats:NO]; 50 | NSString* requestIdentifer = @"Request"; 51 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 52 | content:content 53 | trigger:trigger]; 54 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 55 | withCompletionHandler:^(NSError * _Nullable error) { 56 | NSLog(@"Error%@", error); 57 | }]; 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionNoOperationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionNoOperationViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface ActionNoOperationViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionNoOperationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ActionNoOperationViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "ActionNoOperationViewController.h" 10 | 11 | @interface ActionNoOperationViewController () 12 | 13 | @end 14 | 15 | @implementation ActionNoOperationViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时带一个辅助图像。下拉该通知,放大图像。有两个点击按钮,点击不会进入App。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"下拉放大图片"; 33 | 34 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 35 | ofType:@"png"]; 36 | if (imageFilePath) { 37 | NSError* error = nil; 38 | 39 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 40 | URL:[NSURL fileURLWithPath:imageFilePath] 41 | options:nil 42 | error:&error]; 43 | if (imageAttachment) { 44 | // 这里设置的是Array,但是只会取lastObject 45 | content.attachments = @[imageAttachment]; 46 | 47 | } 48 | } 49 | 50 | NSMutableArray* actionMutableArray = [[NSMutableArray alloc] initWithCapacity:1]; 51 | UNNotificationAction* actionA = [UNNotificationAction actionWithIdentifier:@"IdentifierNeedUnUnlock" 52 | title:@"需要解锁" 53 | options: UNNotificationActionOptionAuthenticationRequired]; 54 | UNNotificationAction* actionB = [UNNotificationAction actionWithIdentifier:@"IdentifierRed" 55 | title:@"红色显示" 56 | options: UNNotificationActionOptionDestructive]; 57 | [actionMutableArray addObjectsFromArray:@[actionA, actionB]]; 58 | 59 | if ([actionMutableArray count] > 1) { 60 | UNNotificationCategory* categoryNotification = [UNNotificationCategory categoryWithIdentifier:@"categoryNoOperationAction" 61 | actions:actionMutableArray 62 | intentIdentifiers:@[] 63 | options:UNNotificationCategoryOptionCustomDismissAction]; 64 | [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categoryNotification]]; 65 | content.categoryIdentifier = @"categoryNoOperationAction"; 66 | } 67 | 68 | 69 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 70 | repeats:NO]; 71 | NSString* requestIdentifer = @"Request"; 72 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 73 | content:content 74 | trigger:trigger]; 75 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 76 | withCompletionHandler:^(NSError * _Nullable error) { 77 | NSLog(@"Error%@", error); 78 | }]; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionOperationInputViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionOperationInputViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface ActionOperationInputViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionOperationInputViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ActionOperationInputViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "ActionOperationInputViewController.h" 10 | 11 | @interface ActionOperationInputViewController () 12 | 13 | @end 14 | 15 | @implementation ActionOperationInputViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时带一个辅助图像。下拉该通知,放大图像。有一个点击按钮,点击会进入App。有一个文本输入。创建5秒后触发。建议回到桌面。"]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | } 25 | 26 | #pragma mark - CreateNotificationAction 27 | - (void)createNotification:(UIButton *)sender { 28 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 29 | content.title = @"Apple"; 30 | content.subtitle = @"Apple Developer"; 31 | content.body = @"下拉放大图片"; 32 | 33 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 34 | ofType:@"png"]; 35 | if (imageFilePath) { 36 | NSError* error = nil; 37 | 38 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 39 | URL:[NSURL fileURLWithPath:imageFilePath] 40 | options:nil 41 | error:&error]; 42 | if (imageAttachment) { 43 | // 这里设置的是Array,但是只会取lastObject 44 | content.attachments = @[imageAttachment]; 45 | 46 | } 47 | } 48 | 49 | NSMutableArray* actionMutableArray = [[NSMutableArray alloc] initWithCapacity:1]; 50 | UNNotificationAction* actionC = [UNNotificationAction actionWithIdentifier:@"IdentifierJoinAppC" 51 | title:@"进入应用C" 52 | options: UNNotificationActionOptionForeground]; 53 | UNTextInputNotificationAction* actionD = [UNTextInputNotificationAction actionWithIdentifier:@"IdentifierJoinAppD" 54 | title:@"文本输入D" 55 | options:UNNotificationActionOptionForeground textInputButtonTitle:@"Send" 56 | textInputPlaceholder:@"Say something."]; 57 | [actionMutableArray addObjectsFromArray:@[actionC, actionD]]; 58 | 59 | if ([actionMutableArray count] > 1) { 60 | UNNotificationCategory* categoryNotification = [UNNotificationCategory categoryWithIdentifier:@"categoryOperationInput" 61 | actions:actionMutableArray 62 | intentIdentifiers:@[] 63 | options:UNNotificationCategoryOptionCustomDismissAction]; 64 | [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categoryNotification]]; 65 | content.categoryIdentifier = @"categoryOperationInput"; 66 | } 67 | 68 | 69 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 70 | repeats:NO]; 71 | NSString* requestIdentifer = @"Request"; 72 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 73 | content:content 74 | trigger:trigger]; 75 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 76 | withCompletionHandler:^(NSError * _Nullable error) { 77 | NSLog(@"Error%@", error); 78 | }]; 79 | } 80 | @end 81 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionOperationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionOperationViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface ActionOperationViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ActionOperationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ActionOperationViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "ActionOperationViewController.h" 10 | 11 | @interface ActionOperationViewController () 12 | 13 | @end 14 | 15 | @implementation ActionOperationViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时带一个辅助图像。下拉该通知,放大图像。有两个点击按钮,点击会进入App。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"下拉放大图片"; 33 | content.badge = @2; 34 | 35 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 36 | ofType:@"png"]; 37 | if (imageFilePath) { 38 | NSError* error = nil; 39 | 40 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 41 | URL:[NSURL fileURLWithPath:imageFilePath] 42 | options:nil 43 | error:&error]; 44 | if (imageAttachment) { 45 | // 这里设置的是Array,但是只会取lastObject 46 | content.attachments = @[imageAttachment]; 47 | 48 | } 49 | } 50 | 51 | NSMutableArray* actionMutableArray = [[NSMutableArray alloc] initWithCapacity:1]; 52 | UNNotificationAction* actionA = [UNNotificationAction actionWithIdentifier:@"IdentifierJoinAppA" 53 | title:@"进入应用A-保留badge" 54 | options: UNNotificationActionOptionForeground]; 55 | UNNotificationAction* actionB = [UNNotificationAction actionWithIdentifier:@"IdentifierJoinAppB" 56 | title:@"进入应用B-清除badge" 57 | options: UNNotificationActionOptionForeground]; 58 | [actionMutableArray addObjectsFromArray:@[actionA, actionB]]; 59 | 60 | if ([actionMutableArray count] > 1) { 61 | UNNotificationCategory* categoryNotification = [UNNotificationCategory categoryWithIdentifier:@"categoryOperationAction" 62 | actions:actionMutableArray 63 | intentIdentifiers:@[] 64 | options:UNNotificationCategoryOptionCustomDismissAction]; 65 | [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categoryNotification]]; 66 | content.categoryIdentifier = @"categoryOperationAction"; 67 | } 68 | 69 | 70 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 71 | repeats:NO]; 72 | NSString* requestIdentifer = @"Request"; 73 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 74 | content:content 75 | trigger:trigger]; 76 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 77 | withCompletionHandler:^(NSError * _Nullable error) { 78 | NSLog(@"Error%@", error); 79 | }]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ContentFeedbackViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContentFeedbackViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface ContentFeedbackViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/ContentFeedbackViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContentFeedbackViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "ContentFeedbackViewController.h" 10 | 11 | @interface ContentFeedbackViewController () 12 | 13 | @end 14 | 15 | @implementation ContentFeedbackViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | [self buildNotificationDes:@"这是一个新的本地通知。自定义通知栏,并隐藏下方系统自带的消息框。带两个Title,分别为title和subtitle。这里展示一下如何不进入App,获取用户选项后给在通知栏给用户实时反馈。下拉该通知。创建5秒后触发。建议回到桌面。"]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | } 25 | 26 | #pragma mark - CreateNotificationAction 27 | - (void)createNotification:(UIButton *)sender { 28 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 29 | content.title = @"Apple"; 30 | content.subtitle = @"Who are you?"; 31 | content.body = @"Hello World"; 32 | 33 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 34 | ofType:@"png"]; 35 | if (imageFilePath) { 36 | NSError* error = nil; 37 | 38 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 39 | URL:[NSURL fileURLWithPath:imageFilePath] 40 | options:nil 41 | error:&error]; 42 | if (imageAttachment) { 43 | // 这里设置的是Array,但是只会取lastObject 44 | content.attachments = @[imageAttachment]; 45 | 46 | } 47 | } 48 | 49 | NSMutableArray* actionMutableArray = [[NSMutableArray alloc] initWithCapacity:1]; 50 | UNNotificationAction* actionC = [UNNotificationAction actionWithIdentifier:@"IdentifierJoinAppE" 51 | title:@"我是JuZi" 52 | options: UNNotificationActionOptionDestructive]; 53 | UNTextInputNotificationAction* actionD = [UNTextInputNotificationAction actionWithIdentifier:@"IdentifierJoinAppF" 54 | title:@"自己输入" 55 | options:UNNotificationActionOptionDestructive textInputButtonTitle:@"Send" 56 | textInputPlaceholder:@"What your name."]; 57 | [actionMutableArray addObjectsFromArray:@[actionC, actionD]]; 58 | 59 | if ([actionMutableArray count] > 1) { 60 | UNNotificationCategory* categoryNotification = [UNNotificationCategory categoryWithIdentifier:@"myNotificationCategoryD" 61 | actions:actionMutableArray 62 | intentIdentifiers:@[] 63 | options:UNNotificationCategoryOptionCustomDismissAction]; 64 | [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categoryNotification]]; 65 | } 66 | 67 | 68 | // 使用自定义的NotificationContent的时候,需要对应extension中info.plist (key-UNNotificationExtensionCategory) 69 | // 注意:UNNotificationExtensionCategory默认是string类型。可以手动更改成array类型,array中的item(string)是categoryName。参照NotificationCenterContentB中的info.plist 70 | // 隐藏默认消息框。添加UNNotificationExtensionDefaultContentHidden属性,Bool(YES). 71 | // 执行UNNotificationContentExtension的delegate方法didReceiveNotificationResponse:completionHandler: 72 | content.categoryIdentifier = @"myNotificationCategoryD"; 73 | 74 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 75 | repeats:NO]; 76 | NSString* requestIdentifer = @"Request"; 77 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 78 | content:content 79 | trigger:trigger]; 80 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 81 | withCompletionHandler:^(NSError * _Nullable error) { 82 | NSLog(@"Error%@", error); 83 | }]; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/CustomContentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomContentViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface CustomContentViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/CustomContentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomContentViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "CustomContentViewController.h" 10 | 11 | @interface CustomContentViewController () 12 | 13 | @end 14 | 15 | @implementation CustomContentViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知。自定义通知栏,带两个Title,分别为title和subtitle。同时带一个辅助图像。下拉该通知。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"111"; 31 | content.subtitle = @"222"; 32 | content.body = @"下拉放大"; 33 | 34 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 35 | ofType:@"png"]; 36 | if (imageFilePath) { 37 | NSError* error = nil; 38 | 39 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 40 | URL:[NSURL fileURLWithPath:imageFilePath] 41 | options:nil 42 | error:&error]; 43 | if (imageAttachment) { 44 | // 这里设置的是Array,但是只会取lastObject 45 | content.attachments = @[imageAttachment]; 46 | 47 | } 48 | } 49 | 50 | // 使用自定义的NotificationContent的时候,需要对应extension中info.plist (key-UNNotificationExtensionCategory) 51 | // 注意:UNNotificationExtensionCategory默认是string类型。可以手动更改成array类型,array中的item(string)是categoryName。参照NotificationCenterContentB中的info.plist 52 | // 自定义的Content和today一样可以自定义长宽。可以在sb中设定。height。也可以代码设定。 53 | // self.preferredContentSize = CGSizeMake(0, width); 54 | // 将key NSExtensionMainStoryboard改成NSExtensionPrincipalClass, value 由sb类名改指定VC的类名可以不使用sb,使用纯代码布局。不推荐。 55 | // 你会注意到下拉之后,视图会有一个先拉伸后收缩的动画,是App从一个默认size适应你的布局。不好看,可以通过UNNotificationExtensionInitialContentSizeRatio在设置默认size的长宽比。 56 | content.categoryIdentifier = @"myNotificationCategoryA"; 57 | 58 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 59 | repeats:NO]; 60 | NSString* requestIdentifer = @"Request"; 61 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 62 | content:content 63 | trigger:trigger]; 64 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 65 | withCompletionHandler:^(NSError * _Nullable error) { 66 | NSLog(@"Error%@", error); 67 | }]; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/LaunchScreenViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LaunchScreenViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface LaunchScreenViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/LaunchScreenViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LaunchScreenViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "LaunchScreenViewController.h" 10 | 11 | @interface LaunchScreenViewController () 12 | 13 | @end 14 | 15 | @implementation LaunchScreenViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个新的本地通知,带两个Title,分别为title和subtitle。同时在点击进入App的时候更改启动图。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"改变App的启动图"; 33 | content.launchImageName = @"notification_launch"; 34 | 35 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 36 | repeats:NO]; 37 | NSString* requestIdentifer = @"Request"; 38 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 39 | content:content 40 | trigger:trigger]; 41 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 42 | withCompletionHandler:^(NSError * _Nullable error) { 43 | NSLog(@"Error%@", error); 44 | }]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/NotificationCenterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationCenterViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @import UserNotifications; 12 | 13 | @interface NotificationCenterViewController : UIViewController 14 | 15 | - (void)buildNotificationDes:(NSString *)desStr; 16 | - (void)createNotification:(UIButton *)sender; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/NotificationCenterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationCenterViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface NotificationCenterViewController () 12 | 13 | @property (nonatomic, strong) UILabel* noteInfoLabel; 14 | 15 | @end 16 | 17 | @implementation NotificationCenterViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | 24 | UIButton* createNotificationButton = [UIButton buttonWithType:UIButtonTypeCustom]; 25 | [self.view addSubview:createNotificationButton]; 26 | [createNotificationButton mas_makeConstraints:^(MASConstraintMaker *make) { 27 | make.bottom.equalTo(self.view).offset(-10.0f); 28 | make.left.equalTo(self.view).offset(20.0f); 29 | make.centerX.equalTo(self.view); 30 | make.height.offset(44.0f); 31 | }]; 32 | [createNotificationButton.layer setCornerRadius:22.0f]; 33 | [createNotificationButton setBackgroundColor:[UIColor redColor]]; 34 | [createNotificationButton setTitleColor:[UIColor whiteColor] 35 | forState:UIControlStateNormal]; 36 | [createNotificationButton setTitleColor:[UIColor lightGrayColor] 37 | forState:UIControlStateHighlighted]; 38 | [createNotificationButton setTitle:@"创建Notification" 39 | forState:UIControlStateNormal]; 40 | [createNotificationButton addTarget:self 41 | action:@selector(createNotification:) 42 | forControlEvents:UIControlEventTouchUpInside]; 43 | 44 | _noteInfoLabel = [[UILabel alloc] init]; 45 | [self.view addSubview:self.noteInfoLabel]; 46 | [self.noteInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) { 47 | make.centerX.equalTo(self.view); 48 | make.left.equalTo(self.view).offset(10.0f); 49 | make.top.equalTo(self.view).offset(44 + 20 + 10.0f); 50 | make.height.offset(200.0f); 51 | }]; 52 | [self.noteInfoLabel.layer setBorderColor:[UIColor lightGrayColor].CGColor]; 53 | [self.noteInfoLabel.layer setBorderWidth:1.0f]; 54 | [self.noteInfoLabel setNumberOfLines:0]; 55 | [self.noteInfoLabel setTextColor:[UIColor grayColor]]; 56 | } 57 | 58 | - (void)didReceiveMemoryWarning { 59 | [super didReceiveMemoryWarning]; 60 | } 61 | 62 | #pragma mark - NotificationDes 63 | - (void)buildNotificationDes:(NSString *)desStr { 64 | NSAssert(YES, @"The method need rewrite, and create diff notification des."); 65 | [self.noteInfoLabel setText:desStr]; 66 | } 67 | 68 | #pragma mark - CreateNotificationAction 69 | - (void)createNotification:(UIButton *)sender { 70 | NSAssert(NO, @"The method need rewrite, and create diff notification with user."); 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/RemoveDefaultContentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RemoveDefaultContentViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface RemoveDefaultContentViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/RemoveDefaultContentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RemoveDefaultContentViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "RemoveDefaultContentViewController.h" 10 | 11 | @interface RemoveDefaultContentViewController () 12 | 13 | @end 14 | 15 | @implementation RemoveDefaultContentViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | [self buildNotificationDes:@"这是一个新的本地通知。自定义通知栏,并隐藏下方系统自带的消息框。带两个Title,分别为title和subtitle。下拉该通知。创建5秒后触发。建议回到桌面。"]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | } 25 | 26 | #pragma mark - CreateNotificationAction 27 | - (void)createNotification:(UIButton *)sender { 28 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 29 | content.title = @"Apple"; 30 | content.subtitle = @"Apple Developer"; 31 | content.body = @"下拉放大"; 32 | 33 | NSString* imageFilePath = [[NSBundle mainBundle] pathForResource:@"accessory_icon" 34 | ofType:@"png"]; 35 | if (imageFilePath) { 36 | NSError* error = nil; 37 | 38 | UNNotificationAttachment *imageAttachment = [UNNotificationAttachment attachmentWithIdentifier:@"imageAttachment" 39 | URL:[NSURL fileURLWithPath:imageFilePath] 40 | options:nil 41 | error:&error]; 42 | if (imageAttachment) { 43 | // 这里设置的是Array,但是只会取lastObject 44 | content.attachments = @[imageAttachment]; 45 | 46 | } 47 | } 48 | 49 | // 使用自定义的NotificationContent的时候,需要对应extension中info.plist (key-UNNotificationExtensionCategory) 50 | // 注意:UNNotificationExtensionCategory默认是string类型。可以手动更改成array类型,array中的item(string)是categoryName。参照NotificationCenterContentB中的info.plist 51 | // 隐藏默认消息框。添加UNNotificationExtensionDefaultContentHidden属性,Bool(YES). 52 | content.categoryIdentifier = @"myNotificationCategoryB"; 53 | 54 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 55 | repeats:NO]; 56 | NSString* requestIdentifer = @"Request"; 57 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 58 | content:content 59 | trigger:trigger]; 60 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 61 | withCompletionHandler:^(NSError * _Nullable error) { 62 | NSLog(@"Error%@", error); 63 | }]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/SimpleLocalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleLocalViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface SimpleLocalViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/SimpleLocalViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleLocalViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "SimpleLocalViewController.h" 10 | 11 | @interface SimpleLocalViewController () 12 | 13 | @end 14 | 15 | @implementation SimpleLocalViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个最简单的本地通知,只包括最简单的部分。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.body = @"Hello,world!"; 31 | 32 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 33 | repeats:NO]; 34 | NSString* requestIdentifer = @"Request"; 35 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 36 | content:content 37 | trigger:trigger]; 38 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 39 | withCompletionHandler:^(NSError * _Nullable error) { 40 | NSLog(@"Error%@", error); 41 | }]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/SoundAndBadgeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SoundAndBadgeViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface SoundAndBadgeViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/SoundAndBadgeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SoundAndBadgeViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "SoundAndBadgeViewController.h" 10 | 11 | @interface SoundAndBadgeViewController () 12 | 13 | @end 14 | 15 | @implementation SoundAndBadgeViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个简单的本地通知,带两个Title,分别为title和subtitle。同时带有sound和badge。badge在iOS10中得到保留,。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"Hello,world!"; 33 | 34 | UNNotificationSound* customSound = [UNNotificationSound soundNamed:@""]; 35 | content.sound = customSound; 36 | content.badge = @1; 37 | 38 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 39 | repeats:NO]; 40 | NSString* requestIdentifer = @"Request"; 41 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 42 | content:content 43 | trigger:trigger]; 44 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 45 | withCompletionHandler:^(NSError * _Nullable error) { 46 | NSLog(@"Error%@", error); 47 | }]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/TwoTitleLocalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TwoTitleLocalViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationCenterViewController.h" 10 | 11 | @interface TwoTitleLocalViewController : NotificationCenterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenter/NotificationCenter/TwoTitleLocalViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TwoTitleLocalViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "TwoTitleLocalViewController.h" 10 | 11 | @interface TwoTitleLocalViewController () 12 | 13 | @end 14 | 15 | @implementation TwoTitleLocalViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self buildNotificationDes:@"这是一个简单的本地通知,带两个Title,分别为title和subtitle。这两个字段在Apple Watch上iOS8.2被使用。创建5秒后触发。建议回到桌面。"]; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - CreateNotificationAction 28 | - (void)createNotification:(UIButton *)sender { 29 | UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; 30 | content.title = @"Apple"; 31 | content.subtitle = @"Apple Developer"; 32 | content.body = @"Hello,world!"; 33 | 34 | UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 35 | repeats:NO]; 36 | NSString* requestIdentifer = @"Request"; 37 | UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:requestIdentifer 38 | content:content 39 | trigger:trigger]; 40 | [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request 41 | withCompletionHandler:^(NSError * _Nullable error) { 42 | NSLog(@"Error%@", error); 43 | }]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /NotificationCenter/Resource/accessory_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Resource/accessory_icon.png -------------------------------------------------------------------------------- /NotificationCenter/Resource/notification_sound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Resource/notification_sound.wav -------------------------------------------------------------------------------- /NotificationCenter/Resource/notification_video.m4v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/Resource/notification_video.m4v -------------------------------------------------------------------------------- /NotificationCenter/ThirdLibrary/JPush/jpush-ios-2.1.9.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColdJuzi/NotificationCenterDemo/e899986b7ad1eef3be50e624464c533bd9bdc301/NotificationCenter/ThirdLibrary/JPush/jpush-ios-2.1.9.a -------------------------------------------------------------------------------- /NotificationCenter/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /NotificationCenter/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | #import "SimpleLocalViewController.h" 13 | #import "TwoTitleLocalViewController.h" 14 | #import "LaunchScreenViewController.h" 15 | #import "SoundAndBadgeViewController.h" 16 | #import "AccessoryImageViewController.h" 17 | #import "AccessoryVideoViewController.h" 18 | #import "ActionNoOperationViewController.h" 19 | #import "ActionOperationViewController.h" 20 | #import "ActionOperationInputViewController.h" 21 | #import "CustomContentViewController.h" 22 | #import "RemoveDefaultContentViewController.h" 23 | #import "ContentFeedbackViewController.h" 24 | 25 | @interface ViewController () 26 | 27 | @property (nonatomic, strong) UITableView* notificationCenterTableV; 28 | 29 | @property (nonatomic, strong) NSArray* notificationCenterListA; 30 | 31 | @end 32 | 33 | @implementation ViewController 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | self.title = @"Notification Center"; 39 | 40 | _notificationCenterListA = @[@"简单的本地通知", 41 | @"带两个Title的本地通知", 42 | @"改变启动图的本地通知", 43 | @"带声音的本地通知", 44 | @"带图像的本地通知", 45 | @"带视频的本地通知", 46 | @"不进入应用的按钮", 47 | @"进入应用的按钮", 48 | @"带文本输入框的按钮", 49 | @"自定义的通知栏", 50 | @"隐藏系统默认消息框", 51 | @"不进App通知栏反馈",]; 52 | 53 | [self buildView]; 54 | } 55 | 56 | - (void)viewWillAppear:(BOOL)animated { 57 | [super viewWillAppear:animated]; 58 | 59 | NSIndexPath* selectedIndexPath = [self.notificationCenterTableV indexPathForSelectedRow]; 60 | if (selectedIndexPath) { 61 | [self.notificationCenterTableV deselectRowAtIndexPath:selectedIndexPath 62 | animated:YES]; 63 | } 64 | } 65 | 66 | - (void)didReceiveMemoryWarning { 67 | [super didReceiveMemoryWarning]; 68 | } 69 | 70 | #pragma mark - BuildView 71 | - (void)buildView { 72 | _notificationCenterTableV = [[UITableView alloc] initWithFrame:CGRectZero 73 | style:UITableViewStylePlain]; 74 | self.notificationCenterTableV.delegate = self; 75 | self.notificationCenterTableV.dataSource = self; 76 | [self.view addSubview:self.notificationCenterTableV]; 77 | [self.notificationCenterTableV mas_makeConstraints:^(MASConstraintMaker *make) { 78 | make.edges.equalTo(self.view); 79 | }]; 80 | } 81 | 82 | #pragma mark - UITableViewDataSource 83 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 84 | return [self.notificationCenterListA count]; 85 | } 86 | 87 | static NSString* cellIdnetifier = @"CellIdentifier"; 88 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 89 | UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdnetifier]; 90 | if (!cell) { 91 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle 92 | reuseIdentifier:cellIdnetifier]; 93 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 94 | } 95 | NSString* titleStr = [self.notificationCenterListA objectAtIndex:indexPath.row]; 96 | cell.textLabel.text = titleStr; 97 | return cell; 98 | } 99 | 100 | #pragma mark - UITableViewDelegate 101 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 102 | UIViewController* viewController = nil; 103 | switch (indexPath.row) { 104 | case 0: 105 | viewController = [[SimpleLocalViewController alloc] init]; 106 | break; 107 | case 1: 108 | viewController = [[TwoTitleLocalViewController alloc] init]; 109 | break; 110 | case 2: 111 | viewController = [[LaunchScreenViewController alloc] init]; 112 | break; 113 | case 3: 114 | viewController = [[SoundAndBadgeViewController alloc] init]; 115 | break; 116 | case 4: 117 | viewController = [[AccessoryImageViewController alloc] init]; 118 | break; 119 | case 5: 120 | viewController = [[AccessoryVideoViewController alloc] init]; 121 | break; 122 | case 6: 123 | viewController = [[ActionNoOperationViewController alloc] init]; 124 | break; 125 | case 7: 126 | viewController = [[ActionOperationViewController alloc] init]; 127 | break; 128 | case 8: 129 | viewController = [[ActionOperationInputViewController alloc] init]; 130 | break; 131 | case 9: 132 | viewController = [[CustomContentViewController alloc] init]; 133 | break; 134 | case 10: 135 | viewController = [[RemoveDefaultContentViewController alloc] init]; 136 | break; 137 | case 11: 138 | viewController = [[ContentFeedbackViewController alloc] init]; 139 | break; 140 | 141 | default: 142 | break; 143 | } 144 | if (viewController) { 145 | [self.navigationController pushViewController:viewController 146 | animated:YES]; 147 | } else { 148 | [tableView deselectRowAtIndexPath:indexPath 149 | animated:YES]; 150 | } 151 | } 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /NotificationCenter/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NotificationCenter 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NotificationCenterContentA/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NotificationCenterContentA 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | UNNotificationExtensionCategory 28 | myNotificationCategoryA 29 | UNNotificationExtensionInitialContentSizeRatio 30 | 1 31 | 32 | NSExtensionMainStoryboard 33 | MainInterface 34 | NSExtensionPointIdentifier 35 | com.apple.usernotifications.content-extension 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /NotificationCenterContentA/NotificationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.h 3 | // NotificationCenterContentA 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotificationViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenterContentA/NotificationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.m 3 | // NotificationCenterContentA 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationViewController.h" 10 | #import 11 | #import 12 | 13 | @interface NotificationViewController () 14 | 15 | @property IBOutlet UILabel *label; 16 | @property (weak, nonatomic) IBOutlet UILabel *titleLabelA; 17 | @property (weak, nonatomic) IBOutlet UILabel *titleLabelB; 18 | 19 | @end 20 | 21 | @implementation NotificationViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // 不能插入新的event。纯代码addTarget的event无法使用。 26 | // Do any required interface initialization here. 27 | } 28 | 29 | - (void)didReceiveNotification:(UNNotification *)notification { 30 | self.label.text = notification.request.content.body; 31 | self.titleLabelA.text = [NSString stringWithFormat:@"%@ + %@", notification.request.content.title, notification.request.content.subtitle]; 32 | self.titleLabelB.text = [NSString stringWithFormat:@" = %ld", [notification.request.content.title integerValue] + [notification.request.content.subtitle integerValue]]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /NotificationCenterContentB/Base.lproj/MainInterface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 33 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /NotificationCenterContentB/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NotificationCenterContentB 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | UNNotificationExtensionDefaultContentHidden 28 | 29 | UNNotificationExtensionCategory 30 | 31 | myNotificationCategoryB 32 | myNotificationCategoryC 33 | 34 | UNNotificationExtensionInitialContentSizeRatio 35 | 1 36 | 37 | NSExtensionMainStoryboard 38 | MainInterface 39 | NSExtensionPointIdentifier 40 | com.apple.usernotifications.content-extension 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /NotificationCenterContentB/NotificationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.h 3 | // NotificationCenterContentB 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotificationViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenterContentB/NotificationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.m 3 | // NotificationCenterContentB 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationViewController.h" 10 | #import 11 | #import 12 | 13 | @interface NotificationViewController () 14 | 15 | @property IBOutlet UILabel *label; 16 | 17 | @property (weak, nonatomic) IBOutlet UILabel *subTitleLabel; 18 | 19 | @property (weak, nonatomic) IBOutlet UILabel *desLabel; 20 | 21 | @end 22 | 23 | @implementation NotificationViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do any required interface initialization here. 28 | } 29 | 30 | - (void)didReceiveNotification:(UNNotification *)notification { 31 | self.label.text = notification.request.content.title; 32 | self.subTitleLabel.text = notification.request.content.subtitle; 33 | self.desLabel.text = notification.request.content.body; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /NotificationCenterContentD/Base.lproj/MainInterface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 33 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /NotificationCenterContentD/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NotificationCenterContentD 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | UNNotificationExtensionDefaultContentHidden 28 | 29 | UNNotificationExtensionCategory 30 | myNotificationCategoryD 31 | UNNotificationExtensionInitialContentSizeRatio 32 | 0.5 33 | 34 | NSExtensionMainStoryboard 35 | MainInterface 36 | NSExtensionPointIdentifier 37 | com.apple.usernotifications.content-extension 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /NotificationCenterContentD/NotificationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.h 3 | // NotificationCenterContentD 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotificationViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenterContentD/NotificationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.m 3 | // NotificationCenterContentD 4 | // 5 | // Created by LiangHao on 2016/9/24. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationViewController.h" 10 | #import 11 | #import 12 | 13 | @interface NotificationViewController () 14 | 15 | @property IBOutlet UILabel *label; 16 | @property (weak, nonatomic) IBOutlet UILabel *subTitleLabel; 17 | @property (weak, nonatomic) IBOutlet UILabel *desLabel; 18 | 19 | @end 20 | 21 | @implementation NotificationViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // Do any required interface initialization here. 26 | } 27 | 28 | - (void)didReceiveNotification:(UNNotification *)notification { 29 | self.label.text = notification.request.content.body; 30 | self.subTitleLabel.text = notification.request.content.subtitle; 31 | } 32 | 33 | - (void)didReceiveNotificationResponse:(UNNotificationResponse *)response completionHandler:(void (^)(UNNotificationContentExtensionResponseOption option))completion { 34 | if ([response isKindOfClass:[UNTextInputNotificationResponse class]]) { 35 | NSString* userSayStr = [(UNTextInputNotificationResponse *)response userText]; 36 | if (userSayStr) { 37 | self.desLabel.text = userSayStr; 38 | } 39 | } else { 40 | if ([response.actionIdentifier isEqualToString:@"IdentifierJoinAppE"]) { 41 | self.desLabel.text = @"我是JuZi"; 42 | } 43 | } 44 | // 必须设置completion,否则通知不会消失。 45 | // 直接让该通知消失 46 | completion(UNNotificationContentExtensionResponseOptionDismiss); 47 | // 消失并传递按钮信息给AppDelegate,是否进入App看Att的设置。 48 | // completion(UNNotificationContentExtensionResponseOptionDismissAndForwardAction); 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /NotificationCenterService/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleDisplayName 13 | NotificationCenterService 14 | CFBundleExecutable 15 | $(EXECUTABLE_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | $(PRODUCT_NAME) 22 | CFBundlePackageType 23 | XPC! 24 | CFBundleShortVersionString 25 | 1.0 26 | CFBundleVersion 27 | 1 28 | NSExtension 29 | 30 | NSExtensionPointIdentifier 31 | com.apple.usernotifications.service 32 | NSExtensionPrincipalClass 33 | NotificationService 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /NotificationCenterService/NotificationService.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationService.h 3 | // NotificationCenterService 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotificationService : UNNotificationServiceExtension 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NotificationCenterService/NotificationService.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationService.m 3 | // NotificationCenterService 4 | // 5 | // Created by LiangHao on 2016/9/23. 6 | // Copyright © 2016年 PhantomSmart. All rights reserved. 7 | // 8 | 9 | #import "NotificationService.h" 10 | #import 11 | 12 | @interface NotificationService () 13 | 14 | @property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver); 15 | @property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent; 16 | 17 | @end 18 | 19 | @implementation NotificationService 20 | 21 | // 通知还有30秒到底屏幕! 22 | - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler { 23 | self.contentHandler = contentHandler; 24 | self.bestAttemptContent = [request.content mutableCopy]; 25 | 26 | self.contentHandler = contentHandler; 27 | self.bestAttemptContent = [request.content mutableCopy]; 28 | 29 | // 这里以PNG图像为例,也可以是视频或者音频。前提是你有时间碾碎他们。 30 | NSString* imageUrlStr = [request.content.userInfo objectForKey:@"image"]; 31 | // NSString* videoUrlStr = [request.content.userInfo objectForKey:@"video"]; 32 | // NSString* soundUrlStr = [request.content.userInfo objectForKey:@"sound"]; 33 | NSData* imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrlStr]]; 34 | if (imageData) { 35 | NSString* imageFilePath = [self saveImageDataToSandBox:imageData]; 36 | if (imageFilePath && imageFilePath.length != 0) { 37 | UNNotificationAttachment* attachment = [UNNotificationAttachment attachmentWithIdentifier:@"photo" URL:[NSURL URLWithString:[@"file://" stringByAppendingString:imageFilePath]] options:nil error:nil]; 38 | if (attachment) { 39 | self.bestAttemptContent.attachments = @[attachment]; 40 | } 41 | } 42 | } 43 | 44 | self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title]; 45 | 46 | self.contentHandler(self.bestAttemptContent); 47 | } 48 | 49 | - (void)serviceExtensionTimeWillExpire { 50 | // Called just before the extension will be terminated by the system. 51 | // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. 52 | self.contentHandler(self.bestAttemptContent); 53 | } 54 | 55 | #pragma mark - SaveImageDataToSandBox 56 | - (NSString *)saveImageDataToSandBox:(NSData *)imageData { 57 | NSString * documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; 58 | 59 | NSString* imageDataFilePath = [NSString stringWithFormat:@"%@/notification_image.png", documentPath]; 60 | NSFileManager* fileManager = [NSFileManager defaultManager]; 61 | if ([fileManager fileExistsAtPath:imageDataFilePath]) { 62 | [fileManager removeItemAtPath:imageDataFilePath 63 | error:nil]; 64 | } 65 | 66 | UIImage* notificationImage = [UIImage imageWithData:imageData]; 67 | if (notificationImage) { 68 | NSError* error = nil; 69 | [UIImagePNGRepresentation(notificationImage) writeToFile:imageDataFilePath options:NSAtomicWrite error:&error]; 70 | if (!error) { 71 | return imageDataFilePath; 72 | } 73 | } 74 | return nil; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, "7.1" 2 | 3 | xcodeproj 'NotificationCenter.xcodeproj' 4 | inhibit_all_warnings! 5 | 6 | def import_model_pods 7 | end 8 | 9 | def import_controller_pods 10 | pod 'Masonry', '0.6.0' 11 | pod 'MBProgressHUD', '0.9' 12 | end 13 | 14 | target 'NotificationCenter' do 15 | import_controller_pods 16 | end 17 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (0.6.0) 3 | - MBProgressHUD (0.9) 4 | 5 | DEPENDENCIES: 6 | - Masonry (= 0.6.0) 7 | - MBProgressHUD (= 0.9) 8 | 9 | SPEC CHECKSUMS: 10 | Masonry: 695dcee5cf90504cc83d85c40e0bd3f4376ed583 11 | MBProgressHUD: d8e7ea388dc1549a42e0d219067cf5f2c898fb66 12 | 13 | PODFILE CHECKSUM: 2c9194906488e0dbbdb9caf694311c522877a432 14 | 15 | COCOAPODS: 1.0.1 16 | -------------------------------------------------------------------------------- /Pods/Headers/Private/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/MBProgressHUD/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Matej Bukovinski 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/MBProgressHUD/README.mdown: -------------------------------------------------------------------------------- 1 | # MBProgressHUD [![Build Status](https://travis-ci.org/matej/MBProgressHUD.png)](https://travis-ci.org/matej/MBProgressHUD) 2 | 3 | MBProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features. 4 | 5 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/1-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/1.png) 6 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/2-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/2.png) 7 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/3-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/3.png) 8 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/4-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/4.png) 9 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/5-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/5.png) 10 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/6-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/6.png) 11 | [![](http://dl.dropbox.com/u/378729/MBProgressHUD/7-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/7.png) 12 | 13 | ## Requirements 14 | 15 | MBProgressHUD works on any iOS version and is compatible with both ARC and non-ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates: 16 | 17 | * Foundation.framework 18 | * UIKit.framework 19 | * CoreGraphics.framework 20 | 21 | You will need LLVM 3.0 or later in order to build MBProgressHUD. 22 | 23 | ## Adding MBProgressHUD to your project 24 | 25 | ### Cocoapods 26 | 27 | [CocoaPods](http://cocoapods.org) is the recommended way to add MBProgressHUD to your project. 28 | 29 | 1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 0.8'` 30 | 2. Install the pod(s) by running `pod install`. 31 | 3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`. 32 | 33 | ### Source files 34 | 35 | Alternatively you can directly add the `MBProgressHUD.h` and `MBProgressHUD.m` source files to your project. 36 | 37 | 1. Download the [latest code version](https://github.com/matej/MBProgressHUD/archive/master.zip) or add the repository as a git submodule to your git-tracked project. 38 | 2. Open your project in Xcode, then drag and drop `MBProgressHUD.h` and `MBProgressHUD.m` onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project. 39 | 3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`. 40 | 41 | ### Static library 42 | 43 | You can also add MBProgressHUD as a static library to your project or workspace. 44 | 45 | 1. Download the [latest code version](https://github.com/matej/MBProgressHUD/downloads) or add the repository as a git submodule to your git-tracked project. 46 | 2. Open your project in Xcode, then drag and drop `MBProgressHUD.xcodeproj` onto your project or workspace (use the "Product Navigator view"). 47 | 3. Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add `libMBProgressHUD.a`. You might also need to add `MBProgressHUD` to the Target Dependencies list. 48 | 4. Include MBProgressHUD wherever you need it with `#import `. 49 | 50 | ## Usage 51 | 52 | The main guideline you need to follow when dealing with MBProgressHUD while running long-running tasks is keeping the main thread work-free, so the UI can be updated promptly. The recommended way of using MBProgressHUD is therefore to set it up on the main thread and then spinning the task, that you want to perform, off onto a new thread. 53 | 54 | ```objective-c 55 | [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 56 | dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ 57 | // Do something... 58 | dispatch_async(dispatch_get_main_queue(), ^{ 59 | [MBProgressHUD hideHUDForView:self.view animated:YES]; 60 | }); 61 | }); 62 | ``` 63 | 64 | If you need to configure the HUD you can do this by using the MBProgressHUD reference that showHUDAddedTo:animated: returns. 65 | 66 | ```objective-c 67 | MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 68 | hud.mode = MBProgressHUDModeAnnularDeterminate; 69 | hud.labelText = @"Loading"; 70 | [self doSomethingInBackgroundWithProgressCallback:^(float progress) { 71 | hud.progress = progress; 72 | } completionCallback:^{ 73 | [hud hide:YES]; 74 | }]; 75 | ``` 76 | 77 | UI updates should always be done on the main thread. Some MBProgressHUD setters are however considered "thread safe" and can be called from background threads. Those also include `setMode:`, `setCustomView:`, `setLabelText:`, `setLabelFont:`, `setDetailsLabelText:`, `setDetailsLabelFont:` and `setProgress:`. 78 | 79 | If you need to run your long-running task in the main thread, you should perform it with a slight delay, so UIKit will have enough time to update the UI (i.e., draw the HUD) before you block the main thread with your task. 80 | 81 | ```objective-c 82 | [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 83 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC); 84 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 85 | // Do something... 86 | [MBProgressHUD hideHUDForView:self.view animated:YES]; 87 | }); 88 | ``` 89 | 90 | You should be aware that any HUD updates issued inside the above block won't be displayed until the block completes. 91 | 92 | For more examples, including how to use MBProgressHUD with asynchronous operations such as NSURLConnection, take a look at the bundled demo project. Extensive API documentation is provided in the header file (MBProgressHUD.h). 93 | 94 | 95 | ## License 96 | 97 | This code is distributed under the terms and conditions of the [MIT license](LICENSE). 98 | 99 | ## Change-log 100 | 101 | A brief summary of each MBProgressHUD release can be found on the [wiki](https://github.com/matej/MBProgressHUD/wiki/Change-log). 102 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (0.6.0) 3 | - MBProgressHUD (0.9) 4 | 5 | DEPENDENCIES: 6 | - Masonry (= 0.6.0) 7 | - MBProgressHUD (= 0.9) 8 | 9 | SPEC CHECKSUMS: 10 | Masonry: 695dcee5cf90504cc83d85c40e0bd3f4376ed583 11 | MBProgressHUD: d8e7ea388dc1549a42e0d219067cf5f2c898fb66 12 | 13 | PODFILE CHECKSUM: 2c9194906488e0dbbdb9caf694311c522877a432 14 | 15 | COCOAPODS: 1.0.1 16 | -------------------------------------------------------------------------------- /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 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)setOffset:(CGFloat)offset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.offset = offset; 135 | } 136 | } 137 | 138 | - (void)setSizeOffset:(CGSize)sizeOffset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.sizeOffset = sizeOffset; 141 | } 142 | } 143 | 144 | - (void)setCenterOffset:(CGPoint)centerOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.centerOffset = centerOffset; 147 | } 148 | } 149 | 150 | #pragma mark - MASConstraint 151 | 152 | - (void)activate { 153 | for (MASConstraint *constraint in self.childConstraints) { 154 | [constraint activate]; 155 | } 156 | } 157 | 158 | - (void)deactivate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint deactivate]; 161 | } 162 | } 163 | 164 | - (void)install { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | constraint.updateExisting = self.updateExisting; 167 | [constraint install]; 168 | } 169 | } 170 | 171 | - (void)uninstall { 172 | for (MASConstraint *constraint in self.childConstraints) { 173 | [constraint uninstall]; 174 | } 175 | } 176 | 177 | @end 178 | -------------------------------------------------------------------------------- /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/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraintBuilder.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 | 26 | /** 27 | * Provides factory methods for creating MASConstraints. 28 | * Constraints are collected until they are ready to be installed 29 | * 30 | */ 31 | @interface MASConstraintMaker : NSObject 32 | 33 | /** 34 | * The following properties return a new MASViewConstraint 35 | * with the first item set to the makers associated view and the appropriate MASViewAttribute 36 | */ 37 | @property (nonatomic, strong, readonly) MASConstraint *left; 38 | @property (nonatomic, strong, readonly) MASConstraint *top; 39 | @property (nonatomic, strong, readonly) MASConstraint *right; 40 | @property (nonatomic, strong, readonly) MASConstraint *bottom; 41 | @property (nonatomic, strong, readonly) MASConstraint *leading; 42 | @property (nonatomic, strong, readonly) MASConstraint *trailing; 43 | @property (nonatomic, strong, readonly) MASConstraint *width; 44 | @property (nonatomic, strong, readonly) MASConstraint *height; 45 | @property (nonatomic, strong, readonly) MASConstraint *centerX; 46 | @property (nonatomic, strong, readonly) MASConstraint *centerY; 47 | @property (nonatomic, strong, readonly) MASConstraint *baseline; 48 | 49 | /** 50 | * Returns a block which creates a new MASCompositeConstraint with the first item set 51 | * to the makers associated view and children corresponding to the set bits in the 52 | * MASAttribute parameter. Combine multiple attributes via binary-or. 53 | */ 54 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); 55 | 56 | /** 57 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges 58 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right) 59 | * with the first item set to the makers associated view 60 | */ 61 | @property (nonatomic, strong, readonly) MASConstraint *edges; 62 | 63 | /** 64 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize 65 | * which generates the appropriate MASViewConstraint children (width, height) 66 | * with the first item set to the makers associated view 67 | */ 68 | @property (nonatomic, strong, readonly) MASConstraint *size; 69 | 70 | /** 71 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter 72 | * which generates the appropriate MASViewConstraint children (centerX, centerY) 73 | * with the first item set to the makers associated view 74 | */ 75 | @property (nonatomic, strong, readonly) MASConstraint *center; 76 | 77 | /** 78 | * Whether or not to check for an existing constraint instead of adding constraint 79 | */ 80 | @property (nonatomic, assign) BOOL updateExisting; 81 | 82 | /** 83 | * Whether or not to remove existing constraints prior to installing 84 | */ 85 | @property (nonatomic, assign) BOOL removeExisting; 86 | 87 | /** 88 | * initialises the maker with a default view 89 | * 90 | * @param view any MASConstrait are created with this view as the first item 91 | * 92 | * @return a new MASConstraintMaker 93 | */ 94 | - (id)initWithView:(MAS_VIEW *)view; 95 | 96 | /** 97 | * Calls install method on any MASConstraints which have been created by this maker 98 | * 99 | * @return an array of all the installed MASConstraints 100 | */ 101 | - (NSArray *)install; 102 | 103 | - (MASConstraint * (^)(dispatch_block_t))group; 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /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 | #if TARGET_OS_IPHONE 12 | 13 | #import 14 | #define MAS_VIEW UIView 15 | #define MASEdgeInsets UIEdgeInsets 16 | 17 | typedef UILayoutPriority MASLayoutPriority; 18 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; 19 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; 20 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; 21 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; 22 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; 23 | 24 | #elif TARGET_OS_MAC 25 | 26 | #import 27 | #define MAS_VIEW NSView 28 | #define MASEdgeInsets NSEdgeInsets 29 | 30 | typedef NSLayoutPriority MASLayoutPriority; 31 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; 32 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; 33 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; 34 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; 35 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; 36 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; 37 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; 38 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; 39 | 40 | #endif 41 | 42 | /** 43 | * Allows you to attach keys to objects matching the variable names passed. 44 | * 45 | * view1.mas_key = @"view1", view2.mas_key = @"view2"; 46 | * 47 | * is equivalent to: 48 | * 49 | * MASAttachKeys(view1, view2); 50 | */ 51 | #define MASAttachKeys(...) \ 52 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ 53 | for (id key in keyPairs.allKeys) { \ 54 | id obj = keyPairs[key]; \ 55 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ 56 | @"Cannot attach mas_key to %@", obj); \ 57 | [obj setMas_key:key]; \ 58 | } 59 | 60 | /** 61 | * Used to create object hashes 62 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html 63 | */ 64 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) 65 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) 66 | 67 | /** 68 | * Given a scalar or struct value, wraps it in NSValue 69 | * Based on EXPObjectify: https://github.com/specta/expecta 70 | */ 71 | static inline id _MASBoxValue(const char *type, ...) { 72 | va_list v; 73 | va_start(v, type); 74 | id obj = nil; 75 | if (strcmp(type, @encode(id)) == 0) { 76 | id actual = va_arg(v, id); 77 | obj = actual; 78 | } else if (strcmp(type, @encode(CGPoint)) == 0) { 79 | CGPoint actual = (CGPoint)va_arg(v, CGPoint); 80 | obj = [NSValue value:&actual withObjCType:type]; 81 | } else if (strcmp(type, @encode(CGSize)) == 0) { 82 | CGSize actual = (CGSize)va_arg(v, CGSize); 83 | obj = [NSValue value:&actual withObjCType:type]; 84 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { 85 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); 86 | obj = [NSValue value:&actual withObjCType:type]; 87 | } else if (strcmp(type, @encode(double)) == 0) { 88 | double actual = (double)va_arg(v, double); 89 | obj = [NSNumber numberWithDouble:actual]; 90 | } else if (strcmp(type, @encode(float)) == 0) { 91 | float actual = (float)va_arg(v, double); 92 | obj = [NSNumber numberWithFloat:actual]; 93 | } else if (strcmp(type, @encode(int)) == 0) { 94 | int actual = (int)va_arg(v, int); 95 | obj = [NSNumber numberWithInt:actual]; 96 | } else if (strcmp(type, @encode(long)) == 0) { 97 | long actual = (long)va_arg(v, long); 98 | obj = [NSNumber numberWithLong:actual]; 99 | } else if (strcmp(type, @encode(long long)) == 0) { 100 | long long actual = (long long)va_arg(v, long long); 101 | obj = [NSNumber numberWithLongLong:actual]; 102 | } else if (strcmp(type, @encode(short)) == 0) { 103 | short actual = (short)va_arg(v, int); 104 | obj = [NSNumber numberWithShort:actual]; 105 | } else if (strcmp(type, @encode(char)) == 0) { 106 | char actual = (char)va_arg(v, int); 107 | obj = [NSNumber numberWithChar:actual]; 108 | } else if (strcmp(type, @encode(bool)) == 0) { 109 | bool actual = (bool)va_arg(v, int); 110 | obj = [NSNumber numberWithBool:actual]; 111 | } else if (strcmp(type, @encode(unsigned char)) == 0) { 112 | unsigned char actual = (unsigned char)va_arg(v, unsigned int); 113 | obj = [NSNumber numberWithUnsignedChar:actual]; 114 | } else if (strcmp(type, @encode(unsigned int)) == 0) { 115 | unsigned int actual = (unsigned int)va_arg(v, unsigned int); 116 | obj = [NSNumber numberWithUnsignedInt:actual]; 117 | } else if (strcmp(type, @encode(unsigned long)) == 0) { 118 | unsigned long actual = (unsigned long)va_arg(v, unsigned long); 119 | obj = [NSNumber numberWithUnsignedLong:actual]; 120 | } else if (strcmp(type, @encode(unsigned long long)) == 0) { 121 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); 122 | obj = [NSNumber numberWithUnsignedLongLong:actual]; 123 | } else if (strcmp(type, @encode(unsigned short)) == 0) { 124 | unsigned short actual = (unsigned short)va_arg(v, unsigned int); 125 | obj = [NSNumber numberWithUnsignedShort:actual]; 126 | } 127 | va_end(v); 128 | return obj; 129 | } 130 | 131 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) 132 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.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 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The attribute which the reciever relates to 24 | */ 25 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 26 | 27 | /** 28 | * The designated initializer. 29 | */ 30 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 31 | 32 | /** 33 | * Determine whether the layoutAttribute is a size attribute 34 | * 35 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 36 | */ 37 | - (BOOL)isSizeAttribute; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.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 = [super init]; 15 | if (!self) return nil; 16 | 17 | _view = view; 18 | _layoutAttribute = layoutAttribute; 19 | 20 | return self; 21 | } 22 | 23 | - (BOOL)isSizeAttribute { 24 | return self.layoutAttribute == NSLayoutAttributeWidth 25 | || self.layoutAttribute == NSLayoutAttributeHeight; 26 | } 27 | 28 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 29 | if ([viewAttribute isKindOfClass:self.class]) { 30 | return self.view == viewAttribute.view 31 | && self.layoutAttribute == viewAttribute.layoutAttribute; 32 | } 33 | return [super isEqual:viewAttribute]; 34 | } 35 | 36 | - (NSUInteger)hash { 37 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.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 "MASUtilities.h" 10 | #import "View+MASAdditions.h" 11 | #import "View+MASShorthandAdditions.h" 12 | #import "NSArray+MASAdditions.h" 13 | #import "NSArray+MASShorthandAdditions.h" 14 | #import "MASConstraint.h" 15 | #import "MASCompositeConstraint.h" 16 | #import "MASViewAttribute.h" 17 | #import "MASViewConstraint.h" 18 | #import "MASConstraintMaker.h" 19 | #import "MASLayoutConstraint.h" 20 | #import "NSLayoutConstraint+MASDebugAdditions.h" 21 | -------------------------------------------------------------------------------- /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 | @interface NSArray (MASAdditions) 14 | 15 | /** 16 | * Creates a MASConstraintMaker with each view in the callee. 17 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 18 | * 19 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 20 | * 21 | * @return Array of created MASConstraints 22 | */ 23 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block; 24 | 25 | /** 26 | * Creates a MASConstraintMaker with each view in the callee. 27 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 28 | * If an existing constraint exists then it will be updated instead. 29 | * 30 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 31 | * 32 | * @return Array of created/updated MASConstraints 33 | */ 34 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block; 35 | 36 | /** 37 | * Creates a MASConstraintMaker with each view in the callee. 38 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 39 | * All constraints previously installed for the views will be removed. 40 | * 41 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 42 | * 43 | * @return Array of created/updated MASConstraints 44 | */ 45 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /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 | @end 42 | -------------------------------------------------------------------------------- /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 | 48 | }); 49 | return descriptionMap; 50 | } 51 | 52 | 53 | + (NSDictionary *)layoutPriorityDescriptionsByValue { 54 | static dispatch_once_t once; 55 | static NSDictionary *descriptionMap; 56 | dispatch_once(&once, ^{ 57 | #if TARGET_OS_IPHONE 58 | descriptionMap = @{ 59 | @(MASLayoutPriorityDefaultHigh) : @"high", 60 | @(MASLayoutPriorityDefaultLow) : @"low", 61 | @(MASLayoutPriorityDefaultMedium) : @"medium", 62 | @(MASLayoutPriorityRequired) : @"required", 63 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", 64 | }; 65 | #elif TARGET_OS_MAC 66 | descriptionMap = @{ 67 | @(MASLayoutPriorityDefaultHigh) : @"high", 68 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", 69 | @(MASLayoutPriorityDefaultMedium) : @"medium", 70 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", 71 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", 72 | @(MASLayoutPriorityDefaultLow) : @"low", 73 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", 74 | @(MASLayoutPriorityRequired) : @"required", 75 | }; 76 | #endif 77 | }); 78 | return descriptionMap; 79 | } 80 | 81 | #pragma mark - description override 82 | 83 | + (NSString *)descriptionForObject:(id)obj { 84 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { 85 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; 86 | } 87 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; 88 | } 89 | 90 | - (NSString *)description { 91 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; 92 | 93 | [description appendString:[self.class descriptionForObject:self]]; 94 | 95 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; 96 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { 97 | [description appendFormat:@".%@", [self.class.layoutAttributeDescriptionsByValue objectForKey:@(self.firstAttribute)]]; 98 | } 99 | 100 | [description appendFormat:@" %@", [self.class.layoutRelationDescriptionsByValue objectForKey:@(self.relation)]]; 101 | 102 | if (self.secondItem) { 103 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; 104 | } 105 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { 106 | [description appendFormat:@".%@", [self.class.layoutAttributeDescriptionsByValue objectForKey:@(self.secondAttribute)]]; 107 | } 108 | 109 | if (self.multiplier != 1) { 110 | [description appendFormat:@" * %g", self.multiplier]; 111 | } 112 | 113 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { 114 | [description appendFormat:@" %g", self.constant]; 115 | } else { 116 | if (self.constant) { 117 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; 118 | } 119 | } 120 | 121 | if (self.priority != MASLayoutPriorityRequired) { 122 | [description appendFormat:@" ^%@", [self.class.layoutPriorityDescriptionsByValue objectForKey:@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; 123 | } 124 | 125 | [description appendString:@">"]; 126 | return description; 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /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 | /** 36 | * a key to associate with this view 37 | */ 38 | @property (nonatomic, strong) id mas_key; 39 | 40 | /** 41 | * Finds the closest common superview between this view and another view 42 | * 43 | * @param view other view 44 | * 45 | * @return returns nil if common superview could not be found 46 | */ 47 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 48 | 49 | /** 50 | * Creates a MASConstraintMaker with the callee view. 51 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 52 | * 53 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 54 | * 55 | * @return Array of created MASConstraints 56 | */ 57 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block; 58 | 59 | /** 60 | * Creates a MASConstraintMaker with the callee view. 61 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 62 | * If an existing constraint exists then it will be updated instead. 63 | * 64 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 65 | * 66 | * @return Array of created/updated MASConstraints 67 | */ 68 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block; 69 | 70 | /** 71 | * Creates a MASConstraintMaker with the callee view. 72 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 73 | * All constraints previously installed for the view will be removed. 74 | * 75 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 76 | * 77 | * @return Array of created/updated MASConstraints 78 | */ 79 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /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 | #pragma mark - associated properties 91 | 92 | - (id)mas_key { 93 | return objc_getAssociatedObject(self, @selector(mas_key)); 94 | } 95 | 96 | - (void)setMas_key:(id)key { 97 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 98 | } 99 | 100 | #pragma mark - heirachy 101 | 102 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view { 103 | MAS_VIEW *closestCommonSuperview = nil; 104 | 105 | MAS_VIEW *secondViewSuperview = view; 106 | while (!closestCommonSuperview && secondViewSuperview) { 107 | MAS_VIEW *firstViewSuperview = self; 108 | while (!closestCommonSuperview && firstViewSuperview) { 109 | if (secondViewSuperview == firstViewSuperview) { 110 | closestCommonSuperview = secondViewSuperview; 111 | } 112 | firstViewSuperview = firstViewSuperview.superview; 113 | } 114 | secondViewSuperview = secondViewSuperview.superview; 115 | } 116 | return closestCommonSuperview; 117 | } 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /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 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 33 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 34 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 35 | 36 | @end 37 | 38 | #define MAS_ATTR_FORWARD(attr) \ 39 | - (MASViewAttribute *)attr { \ 40 | return [self mas_##attr]; \ 41 | } 42 | 43 | @implementation MAS_VIEW (MASShorthandAdditions) 44 | 45 | MAS_ATTR_FORWARD(top); 46 | MAS_ATTR_FORWARD(left); 47 | MAS_ATTR_FORWARD(bottom); 48 | MAS_ATTR_FORWARD(right); 49 | MAS_ATTR_FORWARD(leading); 50 | MAS_ATTR_FORWARD(trailing); 51 | MAS_ATTR_FORWARD(width); 52 | MAS_ATTR_FORWARD(height); 53 | MAS_ATTR_FORWARD(centerX); 54 | MAS_ATTR_FORWARD(centerY); 55 | MAS_ATTR_FORWARD(baseline); 56 | 57 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 58 | return [self mas_attribute]; 59 | } 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 62 | return [self mas_makeConstraints:block]; 63 | } 64 | 65 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 66 | return [self mas_updateConstraints:block]; 67 | } 68 | 69 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 70 | return [self mas_remakeConstraints:block]; 71 | } 72 | 73 | @end 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/PhantomDev.xcuserdatad/xcschemes/MBProgressHUD.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/PhantomDev.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/PhantomDev.xcuserdatad/xcschemes/Pods-NotificationCenter.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/PhantomDev.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MBProgressHUD.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 2 13 | 14 | Masonry.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | Pods-NotificationCenter.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 3 27 | 28 | 29 | SuppressBuildableAutocreation 30 | 31 | 000C37763908AA7055EBE41393986566 32 | 33 | primary 34 | 35 | 36 | 29852B71914AA2E261D18F89DE5A907F 37 | 38 | primary 39 | 40 | 41 | FE2F1D7B9D9FCEA148517E4657B243F4 42 | 43 | primary 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MBProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_MBProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /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 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MBProgressHUD 5 | 6 | Copyright (c) 2013 Matej Bukovinski 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | ## Masonry 27 | 28 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 29 | 30 | Permission is hereby granted, free of charge, to any person obtaining a copy 31 | of this software and associated documentation files (the "Software"), to deal 32 | in the Software without restriction, including without limitation the rights 33 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 34 | copies of the Software, and to permit persons to whom the Software is 35 | furnished to do so, subject to the following conditions: 36 | 37 | The above copyright notice and this permission notice shall be included in 38 | all copies or substantial portions of the Software. 39 | 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 43 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 45 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 46 | THE SOFTWARE. 47 | Generated by CocoaPods - https://cocoapods.org 48 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter-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) 2013 Matej Bukovinski 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | Title 37 | MBProgressHUD 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | FooterText 43 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 44 | 45 | Permission is hereby granted, free of charge, to any person obtaining a copy 46 | of this software and associated documentation files (the "Software"), to deal 47 | in the Software without restriction, including without limitation the rights 48 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 49 | copies of the Software, and to permit persons to whom the Software is 50 | furnished to do so, subject to the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be included in 53 | all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 61 | THE SOFTWARE. 62 | Title 63 | Masonry 64 | Type 65 | PSGroupSpecifier 66 | 67 | 68 | FooterText 69 | Generated by CocoaPods - https://cocoapods.org 70 | Title 71 | 72 | Type 73 | PSGroupSpecifier 74 | 75 | 76 | StringsTable 77 | Acknowledgements 78 | Title 79 | Acknowledgements 80 | 81 | 82 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_NotificationCenter : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_NotificationCenter 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MBProgressHUD" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-NotificationCenter/Pods-NotificationCenter.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MBProgressHUD" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NotificationCenterDemo 2 | iOS 10 User Notification Demo with local and custom content, service. 3 | 4 | 植入了极光2.19的SDK。 5 | 只有注册是根本设备版本而定,所有例子都是使用iOS10的UserNotifications。 6 | 使用极光推送iOS10远程推送的时候,需要选中mutable-content。选中后的提示“请在附加字段中配置相应参数”,一开始被坑了,以为需要在附加字段中添加mutable-content ,其实不用。附加字段添加image等信息。 7 | --------------------------------------------------------------------------------