├── BAReminderDemo ├── BAReminderDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── boai.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── boai.xcuserdatad │ │ └── xcschemes │ │ ├── BAReminderDemo.xcscheme │ │ └── xcschememanagement.plist └── BAReminderDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /BAReminderDemo/BAReminderDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C4C8022C1CF5934200AD5B3B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C4C8022B1CF5934200AD5B3B /* main.m */; }; 11 | C4C8022F1CF5934200AD5B3B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C4C8022E1CF5934200AD5B3B /* AppDelegate.m */; }; 12 | C4C802321CF5934200AD5B3B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4C802311CF5934200AD5B3B /* ViewController.m */; }; 13 | C4C802351CF5934200AD5B3B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C4C802331CF5934200AD5B3B /* Main.storyboard */; }; 14 | C4C802371CF5934200AD5B3B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C4C802361CF5934200AD5B3B /* Assets.xcassets */; }; 15 | C4C8023A1CF5934200AD5B3B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C4C802381CF5934200AD5B3B /* LaunchScreen.storyboard */; }; 16 | C4C802421CF593FD00AD5B3B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4C802411CF593FD00AD5B3B /* CoreGraphics.framework */; }; 17 | C4C802441CF5940600AD5B3B /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4C802431CF5940600AD5B3B /* EventKit.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | C4C802271CF5934200AD5B3B /* BAReminderDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BAReminderDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | C4C8022B1CF5934200AD5B3B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | C4C8022D1CF5934200AD5B3B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | C4C8022E1CF5934200AD5B3B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | C4C802301CF5934200AD5B3B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | C4C802311CF5934200AD5B3B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | C4C802341CF5934200AD5B3B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | C4C802361CF5934200AD5B3B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | C4C802391CF5934200AD5B3B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | C4C8023B1CF5934200AD5B3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | C4C802411CF593FD00AD5B3B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 32 | C4C802431CF5940600AD5B3B /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | C4C802241CF5934200AD5B3B /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | C4C802441CF5940600AD5B3B /* EventKit.framework in Frameworks */, 41 | C4C802421CF593FD00AD5B3B /* CoreGraphics.framework in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | C4C8021E1CF5934200AD5B3B = { 49 | isa = PBXGroup; 50 | children = ( 51 | C4C802431CF5940600AD5B3B /* EventKit.framework */, 52 | C4C802411CF593FD00AD5B3B /* CoreGraphics.framework */, 53 | C4C802291CF5934200AD5B3B /* BAReminderDemo */, 54 | C4C802281CF5934200AD5B3B /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | C4C802281CF5934200AD5B3B /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | C4C802271CF5934200AD5B3B /* BAReminderDemo.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | C4C802291CF5934200AD5B3B /* BAReminderDemo */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | C4C8022D1CF5934200AD5B3B /* AppDelegate.h */, 70 | C4C8022E1CF5934200AD5B3B /* AppDelegate.m */, 71 | C4C802301CF5934200AD5B3B /* ViewController.h */, 72 | C4C802311CF5934200AD5B3B /* ViewController.m */, 73 | C4C802331CF5934200AD5B3B /* Main.storyboard */, 74 | C4C802361CF5934200AD5B3B /* Assets.xcassets */, 75 | C4C802381CF5934200AD5B3B /* LaunchScreen.storyboard */, 76 | C4C8023B1CF5934200AD5B3B /* Info.plist */, 77 | C4C8022A1CF5934200AD5B3B /* Supporting Files */, 78 | ); 79 | path = BAReminderDemo; 80 | sourceTree = ""; 81 | }; 82 | C4C8022A1CF5934200AD5B3B /* Supporting Files */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | C4C8022B1CF5934200AD5B3B /* main.m */, 86 | ); 87 | name = "Supporting Files"; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | C4C802261CF5934200AD5B3B /* BAReminderDemo */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = C4C8023E1CF5934200AD5B3B /* Build configuration list for PBXNativeTarget "BAReminderDemo" */; 96 | buildPhases = ( 97 | C4C802231CF5934200AD5B3B /* Sources */, 98 | C4C802241CF5934200AD5B3B /* Frameworks */, 99 | C4C802251CF5934200AD5B3B /* Resources */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = BAReminderDemo; 106 | productName = BAReminderDemo; 107 | productReference = C4C802271CF5934200AD5B3B /* BAReminderDemo.app */; 108 | productType = "com.apple.product-type.application"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | C4C8021F1CF5934200AD5B3B /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastUpgradeCheck = 0720; 117 | ORGANIZATIONNAME = "博爱之家"; 118 | TargetAttributes = { 119 | C4C802261CF5934200AD5B3B = { 120 | CreatedOnToolsVersion = 7.2; 121 | }; 122 | }; 123 | }; 124 | buildConfigurationList = C4C802221CF5934200AD5B3B /* Build configuration list for PBXProject "BAReminderDemo" */; 125 | compatibilityVersion = "Xcode 3.2"; 126 | developmentRegion = English; 127 | hasScannedForEncodings = 0; 128 | knownRegions = ( 129 | en, 130 | Base, 131 | ); 132 | mainGroup = C4C8021E1CF5934200AD5B3B; 133 | productRefGroup = C4C802281CF5934200AD5B3B /* Products */; 134 | projectDirPath = ""; 135 | projectRoot = ""; 136 | targets = ( 137 | C4C802261CF5934200AD5B3B /* BAReminderDemo */, 138 | ); 139 | }; 140 | /* End PBXProject section */ 141 | 142 | /* Begin PBXResourcesBuildPhase section */ 143 | C4C802251CF5934200AD5B3B /* Resources */ = { 144 | isa = PBXResourcesBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | C4C8023A1CF5934200AD5B3B /* LaunchScreen.storyboard in Resources */, 148 | C4C802371CF5934200AD5B3B /* Assets.xcassets in Resources */, 149 | C4C802351CF5934200AD5B3B /* Main.storyboard in Resources */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXResourcesBuildPhase section */ 154 | 155 | /* Begin PBXSourcesBuildPhase section */ 156 | C4C802231CF5934200AD5B3B /* Sources */ = { 157 | isa = PBXSourcesBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | C4C802321CF5934200AD5B3B /* ViewController.m in Sources */, 161 | C4C8022F1CF5934200AD5B3B /* AppDelegate.m in Sources */, 162 | C4C8022C1CF5934200AD5B3B /* main.m in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin PBXVariantGroup section */ 169 | C4C802331CF5934200AD5B3B /* Main.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | C4C802341CF5934200AD5B3B /* Base */, 173 | ); 174 | name = Main.storyboard; 175 | sourceTree = ""; 176 | }; 177 | C4C802381CF5934200AD5B3B /* LaunchScreen.storyboard */ = { 178 | isa = PBXVariantGroup; 179 | children = ( 180 | C4C802391CF5934200AD5B3B /* Base */, 181 | ); 182 | name = LaunchScreen.storyboard; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXVariantGroup section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | C4C8023C1CF5934200AD5B3B /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 193 | CLANG_CXX_LIBRARY = "libc++"; 194 | CLANG_ENABLE_MODULES = YES; 195 | CLANG_ENABLE_OBJC_ARC = YES; 196 | CLANG_WARN_BOOL_CONVERSION = YES; 197 | CLANG_WARN_CONSTANT_CONVERSION = YES; 198 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 199 | CLANG_WARN_EMPTY_BODY = YES; 200 | CLANG_WARN_ENUM_CONVERSION = YES; 201 | CLANG_WARN_INT_CONVERSION = YES; 202 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 203 | CLANG_WARN_UNREACHABLE_CODE = YES; 204 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 205 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 206 | COPY_PHASE_STRIP = NO; 207 | DEBUG_INFORMATION_FORMAT = dwarf; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | ENABLE_TESTABILITY = YES; 210 | GCC_C_LANGUAGE_STANDARD = gnu99; 211 | GCC_DYNAMIC_NO_PIC = NO; 212 | GCC_NO_COMMON_BLOCKS = YES; 213 | GCC_OPTIMIZATION_LEVEL = 0; 214 | GCC_PREPROCESSOR_DEFINITIONS = ( 215 | "DEBUG=1", 216 | "$(inherited)", 217 | ); 218 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 219 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 220 | GCC_WARN_UNDECLARED_SELECTOR = YES; 221 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 222 | GCC_WARN_UNUSED_FUNCTION = YES; 223 | GCC_WARN_UNUSED_VARIABLE = YES; 224 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 225 | MTL_ENABLE_DEBUG_INFO = YES; 226 | ONLY_ACTIVE_ARCH = YES; 227 | SDKROOT = iphoneos; 228 | TARGETED_DEVICE_FAMILY = "1,2"; 229 | }; 230 | name = Debug; 231 | }; 232 | C4C8023D1CF5934200AD5B3B /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 237 | CLANG_CXX_LIBRARY = "libc++"; 238 | CLANG_ENABLE_MODULES = YES; 239 | CLANG_ENABLE_OBJC_ARC = YES; 240 | CLANG_WARN_BOOL_CONVERSION = YES; 241 | CLANG_WARN_CONSTANT_CONVERSION = YES; 242 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 243 | CLANG_WARN_EMPTY_BODY = YES; 244 | CLANG_WARN_ENUM_CONVERSION = YES; 245 | CLANG_WARN_INT_CONVERSION = YES; 246 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 247 | CLANG_WARN_UNREACHABLE_CODE = YES; 248 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 249 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 250 | COPY_PHASE_STRIP = NO; 251 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 252 | ENABLE_NS_ASSERTIONS = NO; 253 | ENABLE_STRICT_OBJC_MSGSEND = YES; 254 | GCC_C_LANGUAGE_STANDARD = gnu99; 255 | GCC_NO_COMMON_BLOCKS = YES; 256 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 257 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 258 | GCC_WARN_UNDECLARED_SELECTOR = YES; 259 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 260 | GCC_WARN_UNUSED_FUNCTION = YES; 261 | GCC_WARN_UNUSED_VARIABLE = YES; 262 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 263 | MTL_ENABLE_DEBUG_INFO = NO; 264 | SDKROOT = iphoneos; 265 | TARGETED_DEVICE_FAMILY = "1,2"; 266 | VALIDATE_PRODUCT = YES; 267 | }; 268 | name = Release; 269 | }; 270 | C4C8023F1CF5934200AD5B3B /* Debug */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | INFOPLIST_FILE = BAReminderDemo/Info.plist; 275 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 276 | PRODUCT_BUNDLE_IDENTIFIER = "com.-boai.BAReminderDemo"; 277 | PRODUCT_NAME = "$(TARGET_NAME)"; 278 | }; 279 | name = Debug; 280 | }; 281 | C4C802401CF5934200AD5B3B /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | INFOPLIST_FILE = BAReminderDemo/Info.plist; 286 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 287 | PRODUCT_BUNDLE_IDENTIFIER = "com.-boai.BAReminderDemo"; 288 | PRODUCT_NAME = "$(TARGET_NAME)"; 289 | }; 290 | name = Release; 291 | }; 292 | /* End XCBuildConfiguration section */ 293 | 294 | /* Begin XCConfigurationList section */ 295 | C4C802221CF5934200AD5B3B /* Build configuration list for PBXProject "BAReminderDemo" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | C4C8023C1CF5934200AD5B3B /* Debug */, 299 | C4C8023D1CF5934200AD5B3B /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | C4C8023E1CF5934200AD5B3B /* Build configuration list for PBXNativeTarget "BAReminderDemo" */ = { 305 | isa = XCConfigurationList; 306 | buildConfigurations = ( 307 | C4C8023F1CF5934200AD5B3B /* Debug */, 308 | C4C802401CF5934200AD5B3B /* Release */, 309 | ); 310 | defaultConfigurationIsVisible = 0; 311 | defaultConfigurationName = Release; 312 | }; 313 | /* End XCConfigurationList section */ 314 | }; 315 | rootObject = C4C8021F1CF5934200AD5B3B /* Project object */; 316 | } 317 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo.xcodeproj/project.xcworkspace/xcuserdata/boai.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boai/BAReminderDemo/7201bbc77dfc35bdea1ce7a4a86cc8d34f41ef19/BAReminderDemo/BAReminderDemo.xcodeproj/project.xcworkspace/xcuserdata/boai.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo.xcodeproj/xcuserdata/boai.xcuserdatad/xcschemes/BAReminderDemo.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 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo.xcodeproj/xcuserdata/boai.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BAReminderDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C4C802261CF5934200AD5B3B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BAReminderDemo 4 | // 5 | // Created by 博爱 on 16/5/25. 6 | // Copyright © 2016年 博爱之家. 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 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BAReminderDemo 4 | // 5 | // Created by 博爱 on 16/5/25. 6 | // Copyright © 2016年 博爱之家. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/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 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/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 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // BAReminderDemo 4 | // 5 | // Created by 博爱 on 16/5/25. 6 | // Copyright © 2016年 博爱之家. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // BAReminderDemo 4 | // 5 | // Created by 博爱 on 16/5/25. 6 | // Copyright © 2016年 博爱之家. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | /*! 日历提醒事件 */ 11 | #import 12 | 13 | 14 | #pragma mark - ***** frame设置 15 | // 当前设备的屏幕宽度 16 | #define KSCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width 17 | // 当前设备的屏幕高度 18 | #define KSCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height 19 | 20 | @interface ViewController () 21 | 22 | @property (nonatomic, strong) UIButton *btn; 23 | @property (nonatomic, strong) UIButton *btn2; 24 | 25 | @property (nonatomic, strong) EKEventStore *eventStore; 26 | @property (nonatomic, strong) UIDatePicker *datePicker; 27 | 28 | @property (nonatomic, strong) NSDate *selectedDate; 29 | @property (nonatomic, strong) UILabel *label; 30 | 31 | @end 32 | 33 | @implementation ViewController 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | self.title = @"demo"; 39 | 40 | [self test3]; 41 | 42 | } 43 | 44 | - (void)test3 45 | { 46 | /*! 47 | 48 | 注意: 49 | 50 | 1、要先导入系统库: 51 | 52 | EventKit.framework 53 | 54 | CoreGraphics.framework 55 | 56 | 2、导入头文件: 57 | 58 | #import 59 | 60 | */ 61 | 62 | 63 | self.btn.hidden = NO; 64 | self.btn2.hidden = NO; 65 | self.datePicker.hidden = NO; 66 | 67 | 68 | 69 | /*! 日历提醒的设置 */ 70 | [self settingsEvent]; 71 | } 72 | 73 | - (UIButton *)btn 74 | { 75 | if (!_btn) 76 | { 77 | _btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 78 | _btn.frame = CGRectMake(20, 100, 150, 40); 79 | [_btn setBackgroundColor:[UIColor redColor]]; 80 | [_btn setTitle:@"添加到提醒事项" forState:UIControlStateNormal]; 81 | [_btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 82 | _btn.showsTouchWhenHighlighted = YES; 83 | _btn.layer.masksToBounds = YES; 84 | _btn.layer.cornerRadius = 5.0; 85 | _btn.tag = 1001; 86 | [_btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; 87 | [self.view addSubview:_btn]; 88 | } 89 | return _btn; 90 | } 91 | 92 | - (UIButton *)btn2 93 | { 94 | if (!_btn2) 95 | { 96 | _btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 97 | _btn2.frame = CGRectMake(20, 150, 150, 40); 98 | [_btn2 setBackgroundColor:[UIColor redColor]]; 99 | [_btn2 setTitle:@"添加到日历提醒" forState:UIControlStateNormal]; 100 | [_btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 101 | _btn2.showsTouchWhenHighlighted = YES; 102 | _btn2.layer.masksToBounds = YES; 103 | _btn2.layer.cornerRadius = 5.0; 104 | _btn2.tag = 1002; 105 | [_btn2 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; 106 | [self.view addSubview:_btn2]; 107 | } 108 | return _btn; 109 | } 110 | 111 | - (UILabel *)label 112 | { 113 | if (!_label) 114 | { 115 | _label = [UILabel new]; 116 | _label.frame = CGRectMake(0, CGRectGetMaxY(_datePicker.frame), KSCREEN_WIDTH, 40); 117 | _label.backgroundColor = [UIColor yellowColor]; 118 | _label.textAlignment = NSTextAlignmentCenter; 119 | _label.textColor = [UIColor redColor]; 120 | 121 | [self.view addSubview:_label]; 122 | } 123 | return _label; 124 | } 125 | 126 | - (UIDatePicker *)datePicker 127 | { 128 | if (!_datePicker) 129 | { 130 | _datePicker = [[UIDatePicker alloc] init]; 131 | _datePicker.frame = CGRectMake(0, CGRectGetMaxY(_btn2.frame) + 20, KSCREEN_WIDTH, 200); 132 | 133 | /*! 跟踪所有可用的地区,取出想要的地区 */ 134 | NSLog(@"%@", [NSLocale availableLocaleIdentifiers]); 135 | 136 | /*! 1、设置日期选择控件的地区 */ 137 | [_datePicker setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"zh_Hans_CN"]]; 138 | /*! 英文 */ 139 | // [_datePicker setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"en_SC"]]; 140 | 141 | /*! 2、设置DatePicker的日历。默认为当天。 */ 142 | [_datePicker setCalendar:[NSCalendar currentCalendar]]; 143 | 144 | /*! 3、设置DatePicker的时区。*/ 145 | [_datePicker setTimeZone:[NSTimeZone defaultTimeZone]]; 146 | 147 | /*! 4、设置DatePicker的日期。 */ 148 | [_datePicker setDate:[NSDate date]]; 149 | 150 | /*! 5、设置DatePicker的允许的最小日期。 */ 151 | // NSDate *minDate = [[NSDate alloc]initWithTimeIntervalSince1970:NSTimeIntervalSince1970]; 152 | // _datePicker.minimumDate = minDate; 153 | 154 | /*! 6、设置DatePicker的允许的最大日期。 */ 155 | NSDateComponents *dc = [[NSDateComponents alloc] init]; 156 | dc.year = 2099; 157 | NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 158 | _datePicker.maximumDate = [gregorian dateFromComponents:dc]; 159 | 160 | /*! 6.1 限定UIDatePicker的时间范围 */ 161 | NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 162 | NSDate *currentDate = [NSDate date]; 163 | NSDateComponents *comps = [[NSDateComponents alloc] init]; 164 | comps.year = 30; 165 | NSDate *maxDate = [calendar dateByAddingComponents:comps toDate:currentDate options:0]; 166 | comps.year = -30; 167 | 168 | NSDate *minDate = [calendar dateByAddingComponents:comps toDate:currentDate options:0]; 169 | _datePicker.minimumDate = minDate; 170 | _datePicker.maximumDate = maxDate; 171 | 172 | /*! 7、显示年月日,名称根据本地设置,显示小时,分钟和AM/PM,这个的名称是根据本地设置的 */ 173 | [_datePicker setDatePickerMode:UIDatePickerModeDateAndTime]; 174 | 175 | /*! 8、当值发生改变的时候调用的方法 */ 176 | [_datePicker addTarget:self action:@selector(datePickValueChanged:) forControlEvents:UIControlEventValueChanged]; 177 | 178 | [self.view addSubview:_datePicker]; 179 | } 180 | return _datePicker; 181 | } 182 | 183 | - (void)datePickValueChanged:(UIDatePicker *)sender 184 | { 185 | self.selectedDate = sender.date; 186 | 187 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 188 | [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; // 这里是用大写的 H 189 | NSString *dateStr = [dateFormatter stringFromDate:self.selectedDate]; 190 | 191 | if (self.selectedDate) 192 | { 193 | self.label.hidden = NO; 194 | self.label.text = [NSString stringWithFormat:@"选择日期:%@", dateStr]; 195 | } 196 | else 197 | self.label.hidden = YES; 198 | 199 | } 200 | 201 | - (IBAction)btnClick:(UIButton *)sender 202 | { 203 | 204 | if (sender.tag == 1001) 205 | { 206 | NSLog(@" 添加到提醒事项 "); 207 | 208 | EKReminder *reminder = [EKReminder reminderWithEventStore:self.eventStore]; 209 | reminder.calendar = self.eventStore.defaultCalendarForNewReminders; 210 | reminder.title = @"测试提醒事项【此处可随意更改】!"; 211 | if (!self.selectedDate) 212 | { 213 | [[[UIAlertView alloc] initWithTitle:@"温馨提示:" message:@"请先选择日期时间" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil] show]; 214 | return; 215 | } 216 | [reminder addAlarm:[EKAlarm alarmWithAbsoluteDate:self.selectedDate]]; 217 | 218 | NSError *error = nil; 219 | [self.eventStore saveReminder:reminder commit:YES error:&error]; 220 | if (error) 221 | { 222 | NSLog(@"saveReminder error:%@", error); 223 | } 224 | NSLog(@" 添加到提醒事项 , 时间为:%@", self.selectedDate); 225 | } 226 | if (sender.tag == 1002) 227 | { 228 | NSLog(@" 添加到日历 "); 229 | 230 | EKEvent *event = [EKEvent eventWithEventStore:self.eventStore]; 231 | event.calendar = self.eventStore.defaultCalendarForNewEvents; 232 | event.allDay = NO; 233 | event.title = @"测试日历提醒事项【此处可随意更改】!"; 234 | 235 | NSCalendar *calendar = [NSCalendar currentCalendar]; 236 | NSDateComponents *oneDayAgoComponents = [[NSDateComponents alloc] init]; 237 | oneDayAgoComponents.minute = 2; 238 | NSDate *startDate = [calendar dateByAddingComponents:oneDayAgoComponents toDate:[NSDate date] options:0]; 239 | NSDateComponents *oneYearFromNowComponents = [[NSDateComponents alloc] init]; 240 | oneYearFromNowComponents.minute = 10; 241 | NSDate *endDate = [calendar dateByAddingComponents:oneYearFromNowComponents toDate:[NSDate date] options:0]; 242 | 243 | event.startDate = startDate; 244 | event.endDate = endDate; 245 | 246 | /*! 加入提醒时间 */ 247 | [event addAlarm:[EKAlarm alarmWithAbsoluteDate:startDate]]; 248 | 249 | NSError *error = nil; 250 | [self.eventStore saveEvent:event span:EKSpanFutureEvents commit:YES error:&error]; 251 | if (error) { 252 | NSLog(@"error!!! \n%@", error); 253 | } 254 | } 255 | 256 | } 257 | 258 | #pragma mark - ***** 日历提醒的设置 259 | - (void)settingsEvent 260 | { 261 | if (self.eventStore == nil) 262 | { 263 | self.eventStore = [[EKEventStore alloc] init]; 264 | if ([[[UIDevice currentDevice] systemVersion] floatValue] > 6.0) 265 | { 266 | /*! 6.0以后的系统需要申请权限 */ 267 | [self.eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError * _Nullable error) { 268 | 269 | if (granted) 270 | { 271 | NSLog(@"用户允许使用“日历”!!!"); 272 | } 273 | else 274 | { 275 | NSLog(@"用户不允许使用“日历”!!!"); 276 | } 277 | if (error) 278 | { 279 | NSLog(@"申请“日历”权限error:%@", error); 280 | } 281 | 282 | }]; 283 | [self.eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError * _Nullable error) { 284 | 285 | if (granted) 286 | { 287 | NSLog(@"用户允许使用“提醒事项”!!!"); 288 | } 289 | else 290 | { 291 | NSLog(@"用户不允许使用“提醒事项”!!!"); 292 | } 293 | if (error) 294 | { 295 | NSLog(@"申请“提醒事项”权限error:%@", error); 296 | } 297 | 298 | }]; 299 | } 300 | } 301 | } 302 | 303 | 304 | @end 305 | -------------------------------------------------------------------------------- /BAReminderDemo/BAReminderDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BAReminderDemo 4 | // 5 | // Created by 博爱 on 16/5/25. 6 | // Copyright © 2016年 博爱之家. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BAReminderDemo 2 | 添加系统提醒,和添加系统日历提醒!很贴心的博爱系列的demo,记得加星哦! 3 | --------------------------------------------------------------------------------