├── .gitignore ├── AppledocSettings.plist ├── Classes ├── Foundation │ ├── Foundation+SafeKit.h │ ├── NSArray+SafeKit.h │ ├── NSArray+SafeKit.m │ ├── NSDictionary+SafeKit.h │ ├── NSDictionary+SafeKit.m │ ├── NSMutableArray+SafeKit.h │ ├── NSMutableArray+SafeKit.m │ ├── NSMutableDictionary+SafeKit.h │ ├── NSMutableDictionary+SafeKit.m │ ├── NSMutableString+SafeKit.h │ ├── NSMutableString+SafeKit.m │ ├── NSObject+SafeKit.h │ ├── NSObject+SafeKit.m │ ├── NSString+SafeKit.h │ └── NSString+SafeKit.m ├── MLSDurexKit.h ├── MRC │ ├── NSMutableArray+SafeKitMRC.h │ └── NSMutableArray+SafeKitMRC.m └── SafeCore │ ├── NSException+SafeKit.h │ ├── NSException+SafeKit.m │ ├── NSObject+Swizzle.h │ ├── NSObject+Swizzle.m │ ├── SafeKitConfig.h │ ├── SafeKitConfig.m │ ├── SafeKitCore.h │ ├── SafeKitLog.h │ ├── SafeKitLog.m │ ├── SafeKitMacro.h │ └── SafeKitMacro.m ├── LICENSE ├── MLSDurexKit.podspec ├── MLSDurexKitDemo ├── MLSDurexKitDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MLSDurexKitDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MLSDurexKitDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Local Podspecs │ └── MLSDurexKit.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ └── project.pbxproj │ └── Target Support Files │ ├── MLSDurexKit │ ├── MLSDurexKit-Info.plist │ ├── MLSDurexKit-dummy.m │ ├── MLSDurexKit-prefix.pch │ ├── MLSDurexKit-umbrella.h │ ├── MLSDurexKit.modulemap │ └── MLSDurexKit.xcconfig │ └── Pods-MLSDurexKitDemo │ ├── Pods-MLSDurexKitDemo-Info.plist │ ├── Pods-MLSDurexKitDemo-acknowledgements.markdown │ ├── Pods-MLSDurexKitDemo-acknowledgements.plist │ ├── Pods-MLSDurexKitDemo-dummy.m │ ├── Pods-MLSDurexKitDemo-umbrella.h │ ├── Pods-MLSDurexKitDemo.debug.xcconfig │ ├── Pods-MLSDurexKitDemo.modulemap │ └── Pods-MLSDurexKitDemo.release.xcconfig ├── README.md └── docs ├── html ├── Categories │ ├── NSArray+SafeKit.html │ ├── NSDictionary+SafeKit.html │ ├── NSException+SafeKit.html │ ├── NSMutableArray+SafeKit.html │ ├── NSMutableArray+SafeKitMRC.html │ ├── NSMutableDictionary+SafeKit.html │ ├── NSMutableString+SafeKit.html │ ├── NSObject+SafeKit_KVO.html │ ├── NSObject+SafeKit_Perform.html │ ├── NSObject+Swizzle.html │ └── NSString+SafeKit.html ├── Classes │ ├── SafeKitLog.html │ └── SafeKitPrinter.html ├── Constants │ └── SafeKitObjectPerformExceptionCatch.html ├── css │ ├── scss │ │ ├── _index.scss │ │ ├── _layout.scss │ │ ├── _normalize.scss │ │ ├── _object.scss │ │ ├── _print.scss │ │ ├── _variables.scss │ │ ├── _xcode.scss │ │ └── style.scss │ └── style.css ├── hierarchy.html ├── img │ ├── button_bar_background.png │ ├── disclosure.png │ ├── disclosure_open.png │ ├── library_background.png │ └── title_background.png ├── index.html └── js │ └── script.js └── markdown ├── Categories ├── NSArray+SafeKit.md ├── NSDictionary+SafeKit.md ├── NSException+SafeKit.md ├── NSMutableArray+SafeKit.md ├── NSMutableArray+SafeKitMRC.md ├── NSMutableDictionary+SafeKit.md ├── NSMutableString+SafeKit.md ├── NSObject+SafeKit_KVO.md ├── NSObject+SafeKit_Perform.md ├── NSObject+Swizzle.md └── NSString+SafeKit.md ├── Classes ├── SafeKitLog.md └── SafeKitPrinter.md └── Constants └── SafeKitObjectPerformExceptionCatch.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /AppledocSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | --company-id 6 | cn.minlison 7 | --ignore 8 | 9 | ./MLSDurexKitDemo 10 | ./docs 11 | *.m 12 | ./Classes/MLSDurexKit.h 13 | 14 | --logformat 15 | 1 16 | --print-settings 17 | 18 | --project-company 19 | MinLison 20 | --project-name 21 | MLSDurexKit 22 | --repeat-first-par 23 | 24 | --templates 25 | ./Templates 26 | --verbose 27 | 6 28 | --publish-docset 29 | 30 | --create-docset 31 | 32 | --install-docset 33 | 34 | --docset-install-path 35 | ./docs/docset 36 | --create-html 37 | 38 | --create-markdown 39 | 40 | --output 41 | ./docs 42 | --keep-undocumented-objects 43 | 44 | --keep-undocumented-members 45 | 46 | --search-undocumented-doc 47 | 48 | --keep-intermediate-files 49 | 50 | --preprocess-headerdoc 51 | 52 | --print-information-block-titles 53 | 54 | --merge-categories 55 | 56 | --merge-category-comment 57 | 58 | --use-code-order 59 | 60 | --clean-output 61 | 62 | --warn-undocumented-object 63 | 64 | --warn-undocumented-member 65 | 66 | --warn-missing-arg 67 | 68 | --warn-invalid-crossref 69 | 70 | --warn-unknown-directive 71 | 72 | --warn-empty-description 73 | 74 | --warn-unsupported-typedef-enum 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Classes/Foundation/Foundation+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // Foundation+SafeKit.h 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #if __has_include("Foundation+SafeKit.h") 10 | #import "NSObject+SafeKit.h" 11 | 12 | #import "NSArray+SafeKit.h" 13 | #import "NSMutableArray+SafeKit.h" 14 | 15 | #import "NSDictionary+SafeKit.h" 16 | #import "NSMutableDictionary+SafeKit.h" 17 | 18 | #import "NSString+SafeKit.h" 19 | #import "NSMutableString+SafeKit.h" 20 | #else 21 | #import 22 | 23 | #import 24 | #import 25 | 26 | #import 27 | #import 28 | 29 | #import 30 | #import 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Classes/Foundation/NSArray+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+SafeKit.h 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface NSArray(SafeKit) 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Classes/Foundation/NSArray+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+SafeKit.m 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSArray+SafeKit.h" 10 | #import "NSObject+Swizzle.h" 11 | #import "SafeKitLog.h" 12 | #import "NSException+SafeKit.h" 13 | 14 | @implementation NSArray(SafeKit) 15 | 16 | + (void)load { 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | [self safe_swizzleMethod:@selector(initWithObjects_safe:count:) tarClass:@"__NSPlaceholderArray" tarSel:@selector(initWithObjects:count:)]; 20 | [self safe_swizzleMethod:@selector(safe_objectAtIndex:) tarClass:@"__NSArrayI" tarSel:@selector(objectAtIndex:)]; 21 | [self safe_swizzleMethod:@selector(safe_arrayByAddingObject:) tarClass:@"__NSArrayI" tarSel:@selector(arrayByAddingObject:)]; 22 | [self safe_swizzleMethod:@selector(safe_arrayWithObjects:count:) tarClass:@"__NSArrayI" tarSel:@selector(arrayWithObjects:count:)]; 23 | 24 | // FIXED: ios 11 crash: index 0 beyond bounds for empty array 25 | [self safe_swizzleMethod:@selector(safe_objectAtIndexedSubscript:) tarClass:@"__NSArrayM" tarSel:@selector(objectAtIndexedSubscript:)]; 26 | [self safe_swizzleMethod:@selector(safe_objectAtIndexForNSArray0:) tarClass:@"__NSArray0" tarSel:@selector(objectAtIndex:)]; 27 | }); 28 | } 29 | 30 | - (instancetype)initWithObjects_safe:(const id *)objects count:(NSUInteger)cnt { 31 | @try { 32 | return [self initWithObjects_safe:objects count:cnt]; 33 | } @catch (NSException *exception) { 34 | NSMutableArray *reallArray = [NSMutableArray arrayWithCapacity:cnt]; 35 | for (NSUInteger i = 0; i < cnt; i++) { 36 | if (objects[i]) { 37 | [reallArray addObject:objects[i]]; 38 | } 39 | } 40 | return [self initWithArray:reallArray copyItems:NO]; 41 | } @finally { 42 | } 43 | } 44 | 45 | - (id)safe_objectAtIndex:(NSUInteger)index { 46 | if (index >= [self count]) { 47 | return nil; 48 | } 49 | return [self safe_objectAtIndex:index]; 50 | } 51 | 52 | - (id)safe_objectAtIndexedSubscript:(NSUInteger)index { 53 | if (index >= [self count]) { 54 | return nil; 55 | } 56 | return [self safe_objectAtIndexedSubscript:index]; 57 | } 58 | 59 | - (id)safe_objectAtIndexForNSArray0:(NSUInteger)index { 60 | if (index >= [self count]) { 61 | return nil; 62 | } 63 | return [self safe_objectAtIndexForNSArray0:index]; 64 | } 65 | 66 | - (NSArray *)safe_arrayByAddingObject:(id)anObject { 67 | if (!anObject) { 68 | return self; 69 | } 70 | return [self safe_arrayByAddingObject:anObject]; 71 | } 72 | 73 | 74 | + (instancetype)safe_arrayWithObjects:(const id _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt 75 | { 76 | @try { 77 | return [self safe_arrayWithObjects:objects count:cnt]; 78 | } @catch (NSException *exception) { 79 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 80 | NSMutableArray *realArray = [NSMutableArray arrayWithCapacity:cnt]; 81 | for (NSUInteger i = 0; i < cnt; i ++) { 82 | if (objects[i]) 83 | { 84 | [realArray addObject:objects[i]]; 85 | } 86 | } 87 | return [self arrayWithArray:realArray]; 88 | //#pragma clang diagnostic push 89 | //#pragma clang diagnostic ignored"-Wincompatible-pointer-types-discards-qualifiers" 90 | // 91 | // __unsafe_unretained id *unsafe_objects = objects; 92 | // 93 | //#pragma clang diagnostic pop 94 | 95 | 96 | } @finally { 97 | } 98 | 99 | } 100 | @end 101 | -------------------------------------------------------------------------------- /Classes/Foundation/NSDictionary+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary(SafeKit) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Foundation/NSDictionary+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+SafeKit.h" 10 | #import "SafeKitLog.h" 11 | #import "NSObject+Swizzle.h" 12 | @implementation NSDictionary(SafeKit) 13 | + (void)load 14 | { 15 | static dispatch_once_t onceTokend; 16 | dispatch_once(&onceTokend, ^{ 17 | [self safe_swizzleMethod:@selector(SKinitWithObjects:forKeys:count:) tarClass:@"__NSPlaceholderDictionary" tarSel:@selector(initWithObjects:forKeys:count:)]; 18 | [self safe_swizzleMethod:@selector(SKdictionaryWithObjects:forKeys:count:) tarClass:@"__NSPlaceholderDictionary" tarSel:@selector(dictionaryWithObjects:forKeys:count:)]; 19 | }); 20 | } 21 | - (instancetype)SKinitWithObjects:(const id _Nonnull __unsafe_unretained *)objects forKeys:(const id _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt 22 | { 23 | @try { 24 | return [self SKinitWithObjects:objects forKeys:keys count:cnt]; 25 | } @catch (NSException *exception) { 26 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 27 | 28 | //#pragma clang diagnostic push 29 | //#pragma clang diagnostic ignored"-Wincompatible-pointer-types-discards-qualifiers" 30 | // 31 | // __unsafe_unretained id *unsafe_objects = objects; 32 | // __unsafe_unretained id *unsafe_keys = keys; 33 | // 34 | //#pragma clang diagnostic pop 35 | NSMutableDictionary *realDict = [NSMutableDictionary dictionaryWithCapacity:cnt]; 36 | for (NSUInteger i = 0; i < cnt; i ++) { 37 | 38 | if (keys[i] && objects[i]) 39 | { 40 | realDict[keys[i]] = objects[i]; 41 | } 42 | } 43 | return [self initWithDictionary:realDict copyItems:NO]; 44 | } @finally { 45 | } 46 | } 47 | + (instancetype)SKdictionaryWithObjects:(const id _Nonnull __unsafe_unretained *)objects forKeys:(const id _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt 48 | { 49 | @try { 50 | return [self SKdictionaryWithObjects:objects forKeys:keys count:cnt]; 51 | } @catch (NSException *exception) { 52 | 53 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 54 | 55 | //#pragma clang diagnostic push 56 | //#pragma clang diagnostic ignored"-Wincompatible-pointer-types-discards-qualifiers" 57 | // 58 | // __unsafe_unretained id *unsafe_objects = objects; 59 | // __unsafe_unretained id *unsafe_keys = keys; 60 | // 61 | //#pragma clang diagnostic pop 62 | NSMutableDictionary *realDict = [NSMutableDictionary dictionaryWithCapacity:cnt]; 63 | for (NSUInteger i = 0; i < cnt; i ++) { 64 | 65 | if (keys[i] && objects[i]) 66 | { 67 | realDict[keys[i]] = objects[i]; 68 | } 69 | } 70 | return [self dictionaryWithDictionary:realDict]; 71 | // for (NSUInteger i = 0; i < cnt; i ++) 72 | // { 73 | // 74 | // if (!unsafe_keys[i]) 75 | // { 76 | // unsafe_keys[i] = @""; 77 | // } 78 | // if (!unsafe_objects[i]) 79 | // { 80 | // unsafe_objects[i] = @""; 81 | // } 82 | // } 83 | // 84 | // return [self SKdictionaryWithObjects:unsafe_objects forKeys:unsafe_keys count:cnt]; 85 | 86 | } 87 | @finally 88 | { 89 | } 90 | } 91 | @end 92 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableArray+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSMutableArray(SafeKit) 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableArray+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSMutableArray+SafeKit.h" 10 | #import "NSObject+Swizzle.h" 11 | #import "SafeKitLog.h" 12 | #import "NSException+SafeKit.h" 13 | 14 | @implementation NSMutableArray(SafeKit) 15 | 16 | + (void) load{ 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | [self safe_swizzleMethod:@selector(safe_objectAtIndex:) tarClass:@"__NSArrayM" tarSel:@selector(objectAtIndex:)]; 20 | [self safe_swizzleMethod:@selector(safe_arrayByAddingObject:) tarClass:@"__NSArrayM" tarSel:@selector(arrayByAddingObject:)]; 21 | 22 | [self safe_swizzleMethod:@selector(safe_addObject:) tarClass:@"__NSArrayM" tarSel:@selector(addObject:)]; 23 | [self safe_swizzleMethod:@selector(safe_insertObject:atIndex:) tarClass:@"__NSArrayM" tarSel:@selector(insertObject:atIndex:)]; 24 | [self safe_swizzleMethod:@selector(safe_removeObjectAtIndex:) tarClass:@"__NSArrayM" tarSel:@selector(removeObjectAtIndex:)]; 25 | [self safe_swizzleMethod:@selector(safe_replaceObjectAtIndex:withObject:) tarClass:@"__NSArrayM" tarSel:@selector(replaceObjectAtIndex:withObject:)]; 26 | 27 | [self safe_swizzleMethod:@selector(safe_setObject:atIndexedSubscript:) tarClass:@"__NSArrayM" tarSel:@selector(setObject:atIndexedSubscript:)]; 28 | [self safe_swizzleMethod:@selector(safe_removeObject:) tarClass:@"__NSArrayM" tarSel:@selector(removeObject:)]; 29 | [self safe_swizzleMethod:@selector(safe_insertObjects:atIndexes:) tarClass:@"__NSArrayM" tarSel:@selector(insertObjects:atIndexes:)]; 30 | 31 | 32 | }); 33 | } 34 | 35 | -(id)safe_objectAtIndex:(NSUInteger)index{ 36 | if (index >= [self count]) { 37 | [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"index[%ld] >= count[%ld]",(long)index ,(long)[self count]]]; 38 | return nil; 39 | } 40 | return [self safe_objectAtIndex:index]; 41 | } 42 | 43 | - (NSArray *)safe_arrayByAddingObject:(id)anObject{ 44 | if (!anObject) { 45 | [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"object is nil"]]; 46 | return self; 47 | } 48 | return [self safe_arrayByAddingObject:anObject]; 49 | } 50 | 51 | -(void)safe_addObject:(id)anObject{ 52 | if (!anObject) { 53 | [[SafeKitLog shareInstance]logWarning:@"object is nil"]; 54 | return; 55 | } 56 | [self safe_addObject:anObject]; 57 | } 58 | - (void)safe_insertObject:(id)anObject atIndex:(NSUInteger)index{ 59 | if (index > [self count]) { 60 | [[SafeKitLog shareInstance]logWarning:[NSString stringWithFormat:@"index[%ld] > count[%ld]",(long)index ,(long)[self count]]]; 61 | return; 62 | } 63 | if (!anObject) { 64 | [[SafeKitLog shareInstance]logWarning:@"object is nil"]; 65 | return; 66 | } 67 | [self safe_insertObject:anObject atIndex:index]; 68 | } 69 | 70 | - (void)safe_removeObjectAtIndex:(NSUInteger)index{ 71 | if (index >= [self count]) { 72 | [[SafeKitLog shareInstance]logWarning:[NSString stringWithFormat:@"index[%ld] >= count[%ld]",(long)index ,(long)[self count]]]; 73 | return; 74 | } 75 | 76 | return [self safe_removeObjectAtIndex:index]; 77 | } 78 | - (void)safe_replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject{ 79 | if (index >= [self count]) { 80 | [[SafeKitLog shareInstance]logWarning:[NSString stringWithFormat:@"index[%ld] >= count[%ld]",(long)index ,(long)[self count]]]; 81 | return; 82 | } 83 | if (!anObject) { 84 | [[SafeKitLog shareInstance]logWarning:@"object is nil"]; 85 | return; 86 | } 87 | [self safe_replaceObjectAtIndex:index withObject:anObject]; 88 | } 89 | 90 | 91 | - (void)safe_setObject:(id)obj atIndexedSubscript:(NSUInteger)idx { 92 | if (obj == nil || idx >= self.count) { 93 | @try { 94 | [self safe_setObject:obj atIndexedSubscript:idx]; 95 | } @catch (NSException *exception) { 96 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 97 | 98 | } @finally { 99 | 100 | } 101 | 102 | } else { 103 | [self safe_setObject:obj atIndexedSubscript:idx]; 104 | } 105 | 106 | } 107 | 108 | - (void)safe_removeObject:(id)anObject { 109 | @try { 110 | [self safe_removeObject:anObject]; 111 | } @catch (NSException *exception) { 112 | 113 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 114 | 115 | } @finally { 116 | 117 | } 118 | } 119 | 120 | - (void)safe_insertObjects:(NSArray *)objects atIndexes:(NSIndexSet *)indexes { 121 | @try { 122 | [self safe_insertObjects:objects atIndexes:indexes]; 123 | } @catch (NSException *exception) { 124 | 125 | [[SafeKitLog shareInstance] logError:[NSString stringWithFormat:@"Crash Because %@",[exception callStackSymbols]]]; 126 | 127 | } @finally { 128 | 129 | } 130 | } 131 | 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableDictionary+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableDictionary+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSMutableDictionary(SafeKit) 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableDictionary+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableDictionary+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSMutableDictionary+SafeKit.h" 10 | #import "NSObject+Swizzle.h" 11 | #import "SafeKitLog.h" 12 | #import "NSException+SafeKit.h" 13 | 14 | @implementation NSMutableDictionary(SafeKit) 15 | 16 | - (void)safe_removeObjectForKey:(id)aKey{ 17 | if (!aKey) { 18 | [[SafeKitLog shareInstance]logWarning:@"key is nil"]; 19 | return; 20 | } 21 | [self safe_removeObjectForKey:aKey]; 22 | } 23 | 24 | - (void)safe_setObject:(id)anObject forKey:(id )aKey{ 25 | if (!anObject) { 26 | [[SafeKitLog shareInstance]logWarning:@"object is nil"]; 27 | return; 28 | } 29 | if (!aKey) { 30 | [[SafeKitLog shareInstance]logWarning:@"key is nil"]; 31 | return; 32 | } 33 | [self safe_setObject:anObject forKey:aKey]; 34 | } 35 | 36 | + (void) load{ 37 | static dispatch_once_t onceToken; 38 | dispatch_once(&onceToken, ^{ 39 | [self safe_swizzleMethod:@selector(safe_removeObjectForKey:) tarClass:@"__NSDictionaryM" tarSel:@selector(removeObjectForKey:)]; 40 | [self safe_swizzleMethod:@selector(safe_setObject:forKey:) tarClass:@"__NSDictionaryM" tarSel:@selector(setObject:forKey:)]; 41 | }); 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableString+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableString+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-15. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSMutableString(SafeKit) 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Classes/Foundation/NSMutableString+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableString+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-15. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSMutableString+SafeKit.h" 10 | #import "NSObject+Swizzle.h" 11 | #import "SafeKitLog.h" 12 | #import "NSException+SafeKit.h" 13 | #import "SafeKitMacro.h" 14 | 15 | @implementation NSMutableString(SafeKit) 16 | 17 | - (void)safe_appendString:(NSString *)aString { 18 | if (!aString) { 19 | return; 20 | } 21 | [self safe_appendString:aString]; 22 | } 23 | 24 | - (void)safe_appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) { 25 | if (!format) { 26 | return; 27 | } 28 | va_list arguments; 29 | va_start(arguments, format); 30 | NSString *formatStr = [[NSString alloc]initWithFormat:format arguments:arguments]; 31 | formatStr = SK_AUTORELEASE(formatStr); 32 | [self safe_appendFormat:@"%@",formatStr]; 33 | va_end(arguments); 34 | } 35 | 36 | - (void)safe_setString:(NSString *)aString { 37 | if (!aString) { 38 | return; 39 | } 40 | [self safe_setString:aString]; 41 | } 42 | 43 | - (void)safe_insertString:(NSString *)aString atIndex:(NSUInteger)index { 44 | if (index > [self length]) { 45 | return; 46 | } 47 | if (!aString) { 48 | return; 49 | } 50 | 51 | [self safe_insertString:aString atIndex:index]; 52 | } 53 | 54 | + (void)load { 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | [self safe_swizzleMethod:@selector(safe_appendString:) tarClass:@"__NSCFConstantString" tarSel:@selector(appendString:)]; 58 | [self safe_swizzleMethod:@selector(safe_appendFormat:) tarClass:@"__NSCFConstantString" tarSel:@selector(appendFormat:)]; 59 | [self safe_swizzleMethod:@selector(safe_setString:) tarClass:@"__NSCFConstantString" tarSel:@selector(setString:)]; 60 | [self safe_swizzleMethod:@selector(safe_insertString:atIndex:) tarClass:@"__NSCFConstantString" tarSel:@selector(insertString:atIndex:)]; 61 | }); 62 | } 63 | @end 64 | -------------------------------------------------------------------------------- /Classes/Foundation/NSObject+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+SafeKit.h 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject(SafeKit_Perform) 12 | @end 13 | 14 | @interface NSObject(SafeKit_KVO) 15 | @end -------------------------------------------------------------------------------- /Classes/Foundation/NSObject+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+SafeKit.m 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSObject+SafeKit.h" 10 | #import 11 | #import "NSException+SafeKit.h" 12 | #import "NSObject+Swizzle.h" 13 | #import "SafeKitLog.h" 14 | #import "SafeKitConfig.h" 15 | 16 | @implementation NSObject(SafeKit_Perform) 17 | 18 | - (id)SKperformSelector:(SEL)aSelector{ 19 | 20 | if ([self respondsToSelector:aSelector]) { 21 | if (getSafeKitObjectPerformExceptionCatch() == SafeKitObjectPerformExceptionCatchOn) { 22 | if ([self isSelectorReturnType:aSelector]) { 23 | typedef id (*MethodType)(id, SEL); 24 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 25 | return methodToCall(self, aSelector); 26 | }else{ 27 | typedef void (*MethodType)(id, SEL); 28 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 29 | methodToCall(self, aSelector); 30 | return nil; 31 | } 32 | }else{ 33 | if ([self isSelectorReturnType:aSelector]) { 34 | typedef id (*MethodType)(id, SEL); 35 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 36 | return methodToCall(self, aSelector); 37 | }else{ 38 | typedef void (*MethodType)(id, SEL); 39 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 40 | methodToCall(self, aSelector); 41 | return nil; 42 | } 43 | } 44 | }else{ 45 | [[SafeKitLog shareInstance]logError:[NSString stringWithFormat:@"[%@ %@] unrecognized selector sent to instance ",[[self class]description],NSStringFromSelector(aSelector)]]; 46 | } 47 | return nil; 48 | } 49 | 50 | -(id)SKperformSelector:(SEL)aSelector withObject:(id)object{ 51 | if ([self respondsToSelector:aSelector]) { 52 | if (getSafeKitObjectPerformExceptionCatch() == SafeKitObjectPerformExceptionCatchOn) { 53 | SK_TRY_BODY(if ([self isSelectorReturnType:aSelector]) { 54 | typedef id (*MethodType)(id, SEL, id); 55 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 56 | return methodToCall(self, aSelector, object); 57 | }else{ 58 | typedef void (*MethodType)(id, SEL, id); 59 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 60 | methodToCall(self, aSelector, object); 61 | return nil; 62 | }) 63 | }else{ 64 | if ([self isSelectorReturnType:aSelector]) { 65 | typedef id (*MethodType)(id, SEL, id); 66 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 67 | return methodToCall(self, aSelector, object); 68 | }else{ 69 | typedef void (*MethodType)(id, SEL, id); 70 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 71 | methodToCall(self, aSelector, object); 72 | return nil; 73 | } 74 | } 75 | }else{ 76 | [[SafeKitLog shareInstance]logError:[NSString stringWithFormat:@"[%@ %@] unrecognized selector sent to instance ",[[self class]description],NSStringFromSelector(aSelector)]]; 77 | } 78 | return nil; 79 | } 80 | 81 | -(id)SKperformSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2{ 82 | if ([self respondsToSelector:aSelector]) { 83 | if (getSafeKitObjectPerformExceptionCatch() == SafeKitObjectPerformExceptionCatchOn) { 84 | SK_TRY_BODY(if ([self isSelectorReturnType:aSelector]) { 85 | typedef id (*MethodType)(id, SEL, id, id); 86 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 87 | return methodToCall(self, aSelector, object1, object2); 88 | }else{ 89 | typedef void (*MethodType)(id, SEL, id, id); 90 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 91 | methodToCall(self, aSelector, object1, object2); 92 | return nil; 93 | }) 94 | }else{ 95 | if ([self isSelectorReturnType:aSelector]) { 96 | typedef id (*MethodType)(id, SEL, id, id); 97 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 98 | return methodToCall(self, aSelector, object1, object2); 99 | }else{ 100 | typedef void (*MethodType)(id, SEL, id, id); 101 | MethodType methodToCall = (MethodType)[self methodForSelector:aSelector]; 102 | methodToCall(self, aSelector, object1, object2); 103 | return nil; 104 | } 105 | } 106 | }else{ 107 | [[SafeKitLog shareInstance]logError:[NSString stringWithFormat:@"[%@ %@] unrecognized selector sent to instance ",[[self class]description],NSStringFromSelector(aSelector)]]; 108 | } 109 | return nil; 110 | } 111 | 112 | -(BOOL)isSelectorReturnType:(SEL)aSelector{ 113 | NSMethodSignature *signature = [self methodSignatureForSelector:aSelector]; 114 | if (signature) { 115 | const char *returnType = signature.methodReturnType; 116 | if (!strcmp(returnType, @encode(void))){ 117 | return NO; 118 | }else{ 119 | return YES; 120 | } 121 | } 122 | return NO; 123 | } 124 | 125 | + (void) load{ 126 | static dispatch_once_t onceToken; 127 | dispatch_once(&onceToken, ^{ 128 | [self safe_swizzleMethod:@selector(SKperformSelector:) tarSel:@selector(performSelector:)]; 129 | [self safe_swizzleMethod:@selector(SKperformSelector:withObject:) tarSel:@selector(performSelector:withObject:)]; 130 | [self safe_swizzleMethod:@selector(SKperformSelector:withObject:withObject:) tarSel:@selector(performSelector:withObject:withObject:)]; 131 | }); 132 | 133 | } 134 | @end 135 | 136 | 137 | /////// KVO /////// 138 | @implementation NSObject(SafeKit_KVO) 139 | 140 | //-(Ivar)getAllClassVariable:(Class)clazz withName:(NSString *)key{ 141 | // Ivar ivar = class_getInstanceVariable(clazz, [key cStringUsingEncoding:NSASCIIStringEncoding]); 142 | // 143 | // if (ivar) { 144 | // return ivar; 145 | // }else{ 146 | // if (clazz == [NSObject class]) { 147 | // return ivar; 148 | // }else{ 149 | // return [self getAllClassVariable:[clazz superclass] withName:key]; 150 | // } 151 | // } 152 | //} 153 | //-(void)SKsetValue:(id)value forKey:(NSString *)key{ 154 | // if (!key) { 155 | // [[SafeKitLog shareInstance] logWarning:@"key is nil"]; 156 | // return; 157 | // } 158 | // if (![self getAllClassVariable:[self class] withName:key]) { 159 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",key]]; 160 | // return; 161 | // } 162 | // [self SKsetValue:value forKey:key]; 163 | //} 164 | //-(void)SKsetValue:(id)value forKeyPath:(NSString *)keyPath{ 165 | // if (!keyPath) { 166 | // [[SafeKitLog shareInstance] logWarning:@"keyPath is nil"]; 167 | // return; 168 | // } 169 | // if (![self getAllClassVariable:[self class] withName:keyPath]) { 170 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",keyPath]]; 171 | // return; 172 | // } 173 | // [self SKsetValue:value forKeyPath:keyPath]; 174 | //} 175 | //-(void)SKsetValue:(id)value forUndefinedKey:(NSString *)key{ 176 | // if (!key) { 177 | // [[SafeKitLog shareInstance] logWarning:@"key is nil"]; 178 | // return; 179 | // } 180 | // if (![self getAllClassVariable:[self class] withName:key]) { 181 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",key]]; 182 | // return; 183 | // } 184 | // [self SKsetValue:value forUndefinedKey:key]; 185 | //} 186 | // 187 | //-(id)SKvalueForKey:(NSString *)key{ 188 | // if (!key) { 189 | // [[SafeKitLog shareInstance] logWarning:@"key is nil"]; 190 | // return nil; 191 | // } 192 | // if (![self getAllClassVariable:[self class] withName:key]) { 193 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",key]]; 194 | // return nil; 195 | // } 196 | // return [self SKvalueForKey:key]; 197 | //} 198 | // 199 | //-(id)SKvalueForKeyPath:(NSString *)keyPath{ 200 | // if (!keyPath) { 201 | // [[SafeKitLog shareInstance] logWarning:@"keyPath is nil"]; 202 | // return nil; 203 | // } 204 | // if (![self getAllClassVariable:[self class] withName:keyPath]) { 205 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",keyPath]]; 206 | // return nil; 207 | // } 208 | // return [self SKvalueForKeyPath:keyPath]; 209 | //} 210 | // 211 | //-(id)SKvalueForUndefinedKey:(NSString *)key{ 212 | // if (!key) { 213 | // [[SafeKitLog shareInstance] logWarning:@"key is nil"]; 214 | // return nil; 215 | // } 216 | // if (![self getAllClassVariable:[self class] withName:key]) { 217 | // [[SafeKitLog shareInstance] logWarning:[NSString stringWithFormat:@"[%@] is UndefineKey",key]]; 218 | // return nil; 219 | // } 220 | // return [self SKvalueForUndefinedKey:key]; 221 | //} 222 | //+ (void) load{ 223 | // static dispatch_once_t onceToken; 224 | // dispatch_once(&onceToken, ^{ 225 | // [self safe_swizzleMethod:@selector(SKsetValue:forKey:) tarSel:@selector(setValue:forKey:)]; 226 | // [self safe_swizzleMethod:@selector(SKsetValue:forKeyPath:) tarSel:@selector(setValue:forKeyPath:)]; 227 | // [self safe_swizzleMethod:@selector(SKsetValue:forUndefinedKey:) tarSel:@selector(setValue:forUndefinedKey:)]; 228 | // 229 | // [self safe_swizzleMethod:@selector(SKvalueForKey:) tarSel:@selector(valueForKey:)]; 230 | // [self safe_swizzleMethod:@selector(SKvalueForKeyPath:) tarSel:@selector(valueForKeyPath:)]; 231 | // [self safe_swizzleMethod:@selector(SKvalueForUndefinedKey:) tarSel:@selector(valueForUndefinedKey:)]; 232 | // }); 233 | // 234 | //} 235 | @end 236 | -------------------------------------------------------------------------------- /Classes/Foundation/NSString+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-15. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString(SafeKit) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Foundation/NSString+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-15. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSString+SafeKit.h" 10 | #import "NSObject+Swizzle.h" 11 | #import "SafeKitLog.h" 12 | #import "NSException+SafeKit.h" 13 | 14 | @implementation NSString(SafeKit) 15 | 16 | - (unichar)safe_characterAtIndex:(NSUInteger)index { 17 | if (index >= [self length]) { 18 | return 0; 19 | } 20 | return [self safe_characterAtIndex:index]; 21 | } 22 | 23 | - (NSString *)safe_substringWithRange:(NSRange)range { 24 | if (range.location + range.length > self.length) { 25 | return @""; 26 | } 27 | return [self safe_substringWithRange:range]; 28 | } 29 | 30 | + (void) load { 31 | static dispatch_once_t onceToken; 32 | dispatch_once(&onceToken, ^{ 33 | [self safe_swizzleMethod:@selector(safe_characterAtIndex:) tarClass:@"__NSCFString" tarSel:@selector(characterAtIndex:)]; 34 | [self safe_swizzleMethod:@selector(safe_substringWithRange:) tarClass:@"__NSCFString" tarSel:@selector(substringWithRange:)]; 35 | }); 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /Classes/MLSDurexKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKit.h 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-2-28. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #ifndef MLSDurexKit_h 12 | #define MLSDurexKit_h 13 | 14 | #if __has_include("MLSDurexKit.h") 15 | #import "SafeKitCore.h" 16 | #import "Foundation+SafeKit.h" 17 | #else 18 | #import 19 | #import 20 | #endif 21 | 22 | #endif /* MLSDurexKit_h */ 23 | -------------------------------------------------------------------------------- /Classes/MRC/NSMutableArray+SafeKitMRC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+SafeKitMRC.h 3 | // SafeKitExample 4 | // 5 | // Created by 张宇 on 16/2/19. 6 | // Copyright © 2016年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSMutableArray (SafeKitMRC) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/MRC/NSMutableArray+SafeKitMRC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+SafeKitMRC.m 3 | // SafeKitExample 4 | // 5 | // Created by 张宇 on 16/2/19. 6 | // Copyright © 2016年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSMutableArray+SafeKitMRC.h" 10 | #import "NSObject+swizzle.h" 11 | 12 | // fix enter background crash bug when keyboard show. 13 | @implementation NSMutableArray (SafeKitMRC) 14 | 15 | - (id)safe_objectAtIndex:(NSUInteger)index { 16 | if (index >= [self count]) { 17 | return nil; 18 | } 19 | return [self safe_objectAtIndex:index]; 20 | } 21 | 22 | + (void)load { 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | [self safe_swizzleMethod:@selector(safe_objectAtIndex:) tarClass:@"__NSArrayM" tarSel:@selector(objectAtIndex:)]; 26 | }); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/SafeCore/NSException+SafeKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSException+SafeKit.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define SK_TRY_BODY(__target) \ 12 | @try {\ 13 | {__target}\ 14 | }\ 15 | @catch (NSException *exception) {\ 16 | [exception printStackTrace];\ 17 | }\ 18 | @finally {\ 19 | \ 20 | } 21 | /* 22 | * This category adds methods to the NSException. 23 | */ 24 | @interface NSException(SafeKit) 25 | 26 | /* 27 | * To print stack trace. 28 | */ 29 | -(void)printStackTrace; 30 | 31 | /* 32 | * To print stack trace. 33 | * @param reasonStr the reason of exception trace 34 | */ 35 | -(void)printStackTrace:(NSString *)reasonStr; 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/SafeCore/NSException+SafeKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSException+SafeKit.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSException+SafeKit.h" 10 | #import "SafeKitLog.h" 11 | 12 | @implementation NSException(SafeKit) 13 | -(void)printStackTrace{ 14 | NSString *exceptionStr = [NSException formatExceptionToString:self withReason:nil]; 15 | [[SafeKitLog shareInstance]log:exceptionStr]; 16 | } 17 | 18 | -(void)printStackTrace:(NSString *)reasonStr{ 19 | NSString *exceptionStr = [NSException formatExceptionToString:self withReason:reasonStr]; 20 | [[SafeKitLog shareInstance]log:exceptionStr]; 21 | } 22 | 23 | +(NSString *)formatExceptionToString:(NSException *)exception withReason:(NSString *)reasonStr{ 24 | NSArray *arr = [exception callStackSymbols]; 25 | NSString *reasonText = nil; 26 | if (reasonStr) { 27 | reasonText = reasonStr; 28 | }else{ 29 | reasonText = [exception reason]; 30 | } 31 | NSString *name = [exception name]; 32 | 33 | NSString *header = @"\n=============SafeKit Exception Report=============\n"; 34 | NSString *description = [NSString stringWithFormat:@"%@name:%@\ntime:%@\nreason:%@",header,name,[NSDate date],reasonText]; 35 | 36 | NSString *exceptionStr = [NSString stringWithFormat:@"%@\ncallStackSymbols:\n%@",description,[arr componentsJoinedByString:@"\n"]]; 37 | 38 | return exceptionStr; 39 | } 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/SafeCore/NSObject+Swizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+swizzle.h 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* 12 | * This category adds methods to the NSObject. 13 | */ 14 | @interface NSObject(Swizzle) 15 | 16 | /* 17 | * To swizzle two selector for self class. 18 | * @param srcSel source selector 19 | * @param tarSel target selector 20 | */ 21 | +(void)safe_swizzleMethod:(SEL)srcSel tarSel:(SEL)tarSel; 22 | 23 | /* 24 | * To swizzle two selector from self class to target class. 25 | * @param srcSel source selector 26 | * @param tarClassName target class name string 27 | * @param tarSel target selector 28 | */ 29 | +(void)safe_swizzleMethod:(SEL)srcSel tarClass:(NSString *)tarClassName tarSel:(SEL)tarSel; 30 | 31 | /* 32 | * To swizzle two selector from self class to target class. 33 | * @param srcClass source class 34 | * @param srcSel source selector 35 | * @param tarClass target class 36 | * @param tarSel target selector 37 | */ 38 | +(void)safe_swizzleMethod:(Class)srcClass srcSel:(SEL)srcSel tarClass:(Class)tarClass tarSel:(SEL)tarSel; 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/SafeCore/NSObject+Swizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+swizzle.m 3 | // SafeKitExample 4 | // 5 | // Created by zhangyu on 14-3-13. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "NSObject+Swizzle.h" 10 | #import 11 | #import "NSException+SafeKit.h" 12 | #import "SafeKitConfig.h" 13 | 14 | @implementation NSObject(Swizzle) 15 | 16 | +(void)safe_swizzleMethod:(SEL)srcSel tarSel:(SEL)tarSel{ 17 | Class clazz = [self class]; 18 | [self safe_swizzleMethod:clazz srcSel:srcSel tarClass:clazz tarSel:tarSel]; 19 | 20 | } 21 | +(void)safe_swizzleMethod:(SEL)srcSel tarClass:(NSString *)tarClassName tarSel:(SEL)tarSel{ 22 | if (!tarClassName) { 23 | return; 24 | } 25 | Class srcClass = [self class]; 26 | Class tarClass = NSClassFromString(tarClassName); 27 | [self safe_swizzleMethod:srcClass srcSel:srcSel tarClass:tarClass tarSel:tarSel]; 28 | } 29 | 30 | +(void)safe_swizzleMethod:(Class)srcClass srcSel:(SEL)srcSel tarClass:(Class)tarClass tarSel:(SEL)tarSel{ 31 | if (!srcClass) { 32 | return; 33 | } 34 | if (!srcSel) { 35 | return; 36 | } 37 | if (!tarClass) { 38 | return; 39 | } 40 | if (!tarSel) { 41 | return; 42 | } 43 | SK_TRY_BODY( 44 | Method srcMethod = class_getInstanceMethod(srcClass,srcSel); 45 | Method tarMethod = class_getInstanceMethod(tarClass,tarSel); 46 | method_exchangeImplementations(srcMethod, tarMethod);) 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitConfig.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-19. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | #define SafeKitLogTypeNone 0 //Don't print any log 11 | #define SafeKitLogTypeInfo 1 //print log info 12 | #define SafeKitLogTypeWarning 2 //print log warning 13 | #define SafeKitLogTypeError 4 //print log error 14 | 15 | /* 16 | * You could use "|" join the diffrent type. 17 | * eg:setSafeKitLogType(SafeKitLogTypeInfo | SafeKitLogTypeWarning | SafeKitLogTypeError); 18 | */ 19 | void setSafeKitLogType(NSInteger type); 20 | 21 | /* 22 | * To get SafeKitLog type 23 | * eg: if ((getSafeKitLogType() & SafeKitLogTypeError) != 0) { ... } 24 | */ 25 | NSInteger getSafeKitLogType(void); 26 | 27 | typedef NS_ENUM(NSInteger, SafeKitObjectPerformExceptionCatch) { 28 | SafeKitObjectPerformExceptionCatchOn,//When Object invoke the method named performSelector,it will add try .. catch 29 | SafeKitObjectPerformExceptionCatchOff 30 | }; 31 | 32 | /* 33 | * Set method 34 | */ 35 | void setSafeKitObjectPerformExceptionCatch(SafeKitObjectPerformExceptionCatch type); 36 | 37 | /* 38 | * Get method 39 | */ 40 | SafeKitObjectPerformExceptionCatch getSafeKitObjectPerformExceptionCatch(void); 41 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitConfig.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-19. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "SafeKitConfig.h" 10 | 11 | static NSInteger SafeKitLogTypeValue = SafeKitLogTypeError; 12 | static SafeKitObjectPerformExceptionCatch safeKitObjectPerformExceptionCatchValue = SafeKitObjectPerformExceptionCatchOff; 13 | 14 | 15 | //////// Log //////// 16 | void setSafeKitLogType(NSInteger logType){ 17 | SafeKitLogTypeValue = logType; 18 | } 19 | NSInteger getSafeKitLogType(){ 20 | return SafeKitLogTypeValue; 21 | } 22 | 23 | 24 | //////// catch //////// 25 | void setSafeKitObjectPerformExceptionCatch(SafeKitObjectPerformExceptionCatch type){ 26 | safeKitObjectPerformExceptionCatchValue = type; 27 | } 28 | SafeKitObjectPerformExceptionCatch getSafeKitObjectPerformExceptionCatch(){ 29 | return safeKitObjectPerformExceptionCatchValue; 30 | } 31 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitCore.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-15. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #if __has_include("SafeKitCore.h") 10 | #import "NSObject+Swizzle.h" 11 | #import "NSException+SafeKit.h" 12 | #import "SafeKitLog.h" 13 | #import "SafeKitConfig.h" 14 | #import "SafeKitMacro.h" 15 | #else 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #endif 22 | 23 | 24 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitLog.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-14. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* 12 | * This is an interface for printer. 13 | * This default implementation printer will invoke NSLog to print log on console. 14 | * You could define yourself way to record log. 15 | * Just need to implement another. 16 | */ 17 | @interface SafeKitPrinter : NSObject 18 | 19 | /* 20 | * When the SafeKitLog invoke the method named log,this method will be invode also. 21 | * @param aString log string. 22 | */ 23 | -(void)print:(NSString *)aString; 24 | @end 25 | 26 | /* 27 | * Log manager. 28 | * Please use [SafeKitLog shareInstance] to get the instance of SafeKitLog. 29 | */ 30 | @interface SafeKitLog : NSObject 31 | 32 | /* 33 | * Replace printer by your SafeKitPrinter. 34 | */ 35 | @property (nonatomic, strong) SafeKitPrinter *printer; 36 | 37 | /* 38 | * When you want to implement another log manager,you could use it. 39 | * @param printer SafeKitPrinter. 40 | */ 41 | - (id)initWithPrinter:(SafeKitPrinter *)printer; 42 | 43 | /* 44 | * log. 45 | * @param aString log string. 46 | */ 47 | -(void)log:(NSString *)aString; 48 | 49 | /* 50 | * log. 51 | * @param aString log info string. 52 | */ 53 | -(void)logInfo:(NSString *)aString; 54 | 55 | /* 56 | * log. 57 | * @param aString log warning string. 58 | */ 59 | -(void)logWarning:(NSString *)aString; 60 | 61 | /* 62 | * log. 63 | * @param aString log error string. 64 | */ 65 | -(void)logError:(NSString *)aString; 66 | 67 | /* 68 | * To get the instance of SafeKitLog. 69 | */ 70 | +(SafeKitLog *)shareInstance; 71 | @end 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitLog.m: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitLog.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-14. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "SafeKitLog.h" 10 | #import "NSException+SafeKit.h" 11 | #import "SafeKitConfig.h" 12 | 13 | SafeKitLog *SafeKitLogInstance; 14 | 15 | @interface SafeKitConsolePrinter : SafeKitPrinter 16 | 17 | @end 18 | 19 | @implementation SafeKitLog 20 | @synthesize printer = _printer; 21 | 22 | - (id)init 23 | { 24 | self = [super init]; 25 | if (self) { 26 | self.printer = [[SafeKitConsolePrinter alloc]init]; 27 | } 28 | return self; 29 | } 30 | 31 | - (id)initWithPrinter:(SafeKitPrinter *)printer 32 | { 33 | self = [super init]; 34 | if (self) { 35 | self.printer = printer; 36 | } 37 | return self; 38 | } 39 | 40 | +(SafeKitLog *)shareInstance{ 41 | if (!SafeKitLogInstance) { 42 | SafeKitLogInstance = [[SafeKitLog alloc]init]; 43 | } 44 | return SafeKitLogInstance; 45 | } 46 | 47 | -(void)log:(NSString *)aString{ 48 | 49 | [self.printer print:aString]; 50 | } 51 | 52 | -(void)logInfo:(NSString *)aString{ 53 | if ((getSafeKitLogType() & SafeKitLogTypeInfo) != 0) { 54 | [self log:aString]; 55 | } 56 | } 57 | 58 | -(void)logWarning:(NSString *)aString{ 59 | if ((getSafeKitLogType() & SafeKitLogTypeWarning) != 0) { 60 | [self log:aString]; 61 | 62 | //show stack trace 63 | @try { 64 | NSException *e = [NSException exceptionWithName:@"SafeKit" reason:@"WarningStackTrace" userInfo:nil]; 65 | @throw e; 66 | } 67 | @catch (NSException *exception) { 68 | [exception printStackTrace]; 69 | } 70 | } 71 | } 72 | 73 | -(void)logError:(NSString *)aString{ 74 | if ((getSafeKitLogType() & SafeKitLogTypeError) != 0) { 75 | [self log:aString]; 76 | 77 | //show stack trace 78 | @try { 79 | NSException *e = [NSException exceptionWithName:@"SafeKit" reason:@"ErrorStackTrace" userInfo:nil]; 80 | @throw e; 81 | } 82 | @catch (NSException *exception) { 83 | [exception printStackTrace]; 84 | } 85 | } 86 | } 87 | @end 88 | 89 | @implementation SafeKitPrinter 90 | -(void)print:(NSString *)aString{ 91 | 92 | } 93 | @end 94 | 95 | 96 | @implementation SafeKitConsolePrinter 97 | -(void)print:(NSString *)aString{ 98 | if (!aString) { 99 | return; 100 | } 101 | NSLog(@"%@",aString); 102 | } 103 | @end 104 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitMacro.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitMacro.h 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-24. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #if __has_feature(objc_arc) 10 | #define SK_AUTORELEASE(exp) exp 11 | #define SK_RELEASE(exp) exp 12 | #define SK_RETAIN(exp) exp 13 | #else 14 | #define SK_AUTORELEASE(exp) [exp autorelease] 15 | #define SK_RELEASE(exp) [exp release] 16 | #define SK_RETAIN(exp) [exp retain] 17 | #endif 18 | -------------------------------------------------------------------------------- /Classes/SafeCore/SafeKitMacro.m: -------------------------------------------------------------------------------- 1 | // 2 | // SafeKitMacro.m 3 | // DurexKitExample 4 | // 5 | // Created by zhangyu on 14-3-24. 6 | // Copyright (c) 2014年 zhangyu. All rights reserved. 7 | // 8 | 9 | #import "SafeKitMacro.h" 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Minlison 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MLSDurexKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "MLSDurexKit" 3 | s.version = "1.0.0" 4 | s.summary = "防止崩溃容错处理" 5 | s.description = <<-DESC 6 | Hack并exchange系统方法,拦截崩溃,例如字典set nil 等 7 | DESC 8 | 9 | s.homepage = "https://www.minlison.cn" 10 | s.license = "MIT" 11 | s.author = { "Minlison" => "yuanhang.1991@163.com" } 12 | s.platform = :ios, "8.0" 13 | s.source = { :git => "https://github.com/Minlison/MLSDurexKit.git", :tag => "v#{s.version}" } 14 | s.requires_arc = true 15 | s.documentation_url = "https://www.minlison.cn" 16 | s.static_framework = true 17 | 18 | mrc_files = "Classes/MRC/*.{h,m}" 19 | s.subspec 'MRC' do |ss| 20 | ss.source_files = mrc_files 21 | ss.public_header_files = "Classes/MRC/*.h" 22 | end 23 | s.subspec 'Core' do |ss| 24 | ss.exclude_files = mrc_files 25 | ss.source_files = "Classes/**/*.{h,m}" 26 | ss.public_header_files = "Classes/**/*.h" 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1F360540234EC87E006377DC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F36053F234EC87E006377DC /* AppDelegate.m */; }; 11 | 1F360546234EC87E006377DC /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F360545234EC87E006377DC /* ViewController.m */; }; 12 | 1F360549234EC87E006377DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F360547234EC87E006377DC /* Main.storyboard */; }; 13 | 1F36054B234EC87F006377DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F36054A234EC87F006377DC /* Assets.xcassets */; }; 14 | 1F36054E234EC87F006377DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1F36054C234EC87F006377DC /* LaunchScreen.storyboard */; }; 15 | 1F360551234EC87F006377DC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F360550234EC87F006377DC /* main.m */; }; 16 | EA15B28B7BA9BF485DC45204 /* Pods_MLSDurexKitDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C76BAA859639B4F2C0860D07 /* Pods_MLSDurexKitDemo.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 1F36053B234EC87E006377DC /* MLSDurexKitDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MLSDurexKitDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 1F36053E234EC87E006377DC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 1F36053F234EC87E006377DC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 1F360544234EC87E006377DC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 1F360545234EC87E006377DC /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 1F360548234EC87E006377DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 1F36054A234EC87F006377DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 1F36054D234EC87F006377DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 1F36054F234EC87F006377DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 1F360550234EC87F006377DC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 377F576A840ABB5D0948365A /* Pods-MLSDurexKitDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MLSDurexKitDemo.debug.xcconfig"; path = "Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo.debug.xcconfig"; sourceTree = ""; }; 31 | 6291B8828F58CDE75FDBD5B5 /* Pods-MLSDurexKitDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MLSDurexKitDemo.release.xcconfig"; path = "Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo.release.xcconfig"; sourceTree = ""; }; 32 | C76BAA859639B4F2C0860D07 /* Pods_MLSDurexKitDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MLSDurexKitDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 1F360538234EC87E006377DC /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | EA15B28B7BA9BF485DC45204 /* Pods_MLSDurexKitDemo.framework in Frameworks */, 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 1F360532234EC87E006377DC = { 48 | isa = PBXGroup; 49 | children = ( 50 | 1F36053D234EC87E006377DC /* MLSDurexKitDemo */, 51 | 1F36053C234EC87E006377DC /* Products */, 52 | 4A4C4E5CD5F87404CB1E276A /* Pods */, 53 | D79412A1FD1AFA3E862FC26C /* Frameworks */, 54 | ); 55 | sourceTree = ""; 56 | }; 57 | 1F36053C234EC87E006377DC /* Products */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 1F36053B234EC87E006377DC /* MLSDurexKitDemo.app */, 61 | ); 62 | name = Products; 63 | sourceTree = ""; 64 | }; 65 | 1F36053D234EC87E006377DC /* MLSDurexKitDemo */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 1F36053E234EC87E006377DC /* AppDelegate.h */, 69 | 1F36053F234EC87E006377DC /* AppDelegate.m */, 70 | 1F360544234EC87E006377DC /* ViewController.h */, 71 | 1F360545234EC87E006377DC /* ViewController.m */, 72 | 1F360547234EC87E006377DC /* Main.storyboard */, 73 | 1F36054A234EC87F006377DC /* Assets.xcassets */, 74 | 1F36054C234EC87F006377DC /* LaunchScreen.storyboard */, 75 | 1F36054F234EC87F006377DC /* Info.plist */, 76 | 1F360550234EC87F006377DC /* main.m */, 77 | ); 78 | path = MLSDurexKitDemo; 79 | sourceTree = ""; 80 | }; 81 | 4A4C4E5CD5F87404CB1E276A /* Pods */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 377F576A840ABB5D0948365A /* Pods-MLSDurexKitDemo.debug.xcconfig */, 85 | 6291B8828F58CDE75FDBD5B5 /* Pods-MLSDurexKitDemo.release.xcconfig */, 86 | ); 87 | name = Pods; 88 | path = Pods; 89 | sourceTree = ""; 90 | }; 91 | D79412A1FD1AFA3E862FC26C /* Frameworks */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | C76BAA859639B4F2C0860D07 /* Pods_MLSDurexKitDemo.framework */, 95 | ); 96 | name = Frameworks; 97 | sourceTree = ""; 98 | }; 99 | /* End PBXGroup section */ 100 | 101 | /* Begin PBXNativeTarget section */ 102 | 1F36053A234EC87E006377DC /* MLSDurexKitDemo */ = { 103 | isa = PBXNativeTarget; 104 | buildConfigurationList = 1F360554234EC87F006377DC /* Build configuration list for PBXNativeTarget "MLSDurexKitDemo" */; 105 | buildPhases = ( 106 | A6921EDC177935925D8E04EA /* [CP] Check Pods Manifest.lock */, 107 | 1F360537234EC87E006377DC /* Sources */, 108 | 1F360538234EC87E006377DC /* Frameworks */, 109 | 1F360539234EC87E006377DC /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = MLSDurexKitDemo; 116 | productName = MLSDurexKitDemo; 117 | productReference = 1F36053B234EC87E006377DC /* MLSDurexKitDemo.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | 1F360533234EC87E006377DC /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | LastUpgradeCheck = 1110; 127 | ORGANIZATIONNAME = minlison; 128 | TargetAttributes = { 129 | 1F36053A234EC87E006377DC = { 130 | CreatedOnToolsVersion = 11.1; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = 1F360536234EC87E006377DC /* Build configuration list for PBXProject "MLSDurexKitDemo" */; 135 | compatibilityVersion = "Xcode 9.3"; 136 | developmentRegion = en; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = 1F360532234EC87E006377DC; 143 | productRefGroup = 1F36053C234EC87E006377DC /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 1F36053A234EC87E006377DC /* MLSDurexKitDemo */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 1F360539234EC87E006377DC /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 1F36054E234EC87F006377DC /* LaunchScreen.storyboard in Resources */, 158 | 1F36054B234EC87F006377DC /* Assets.xcassets in Resources */, 159 | 1F360549234EC87E006377DC /* Main.storyboard in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXShellScriptBuildPhase section */ 166 | A6921EDC177935925D8E04EA /* [CP] Check Pods Manifest.lock */ = { 167 | isa = PBXShellScriptBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | ); 171 | inputFileListPaths = ( 172 | ); 173 | inputPaths = ( 174 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 175 | "${PODS_ROOT}/Manifest.lock", 176 | ); 177 | name = "[CP] Check Pods Manifest.lock"; 178 | outputFileListPaths = ( 179 | ); 180 | outputPaths = ( 181 | "$(DERIVED_FILE_DIR)/Pods-MLSDurexKitDemo-checkManifestLockResult.txt", 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | shellPath = /bin/sh; 185 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 186 | showEnvVarsInLog = 0; 187 | }; 188 | /* End PBXShellScriptBuildPhase section */ 189 | 190 | /* Begin PBXSourcesBuildPhase section */ 191 | 1F360537234EC87E006377DC /* Sources */ = { 192 | isa = PBXSourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 1F360546234EC87E006377DC /* ViewController.m in Sources */, 196 | 1F360540234EC87E006377DC /* AppDelegate.m in Sources */, 197 | 1F360551234EC87F006377DC /* main.m in Sources */, 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | /* End PBXSourcesBuildPhase section */ 202 | 203 | /* Begin PBXVariantGroup section */ 204 | 1F360547234EC87E006377DC /* Main.storyboard */ = { 205 | isa = PBXVariantGroup; 206 | children = ( 207 | 1F360548234EC87E006377DC /* Base */, 208 | ); 209 | name = Main.storyboard; 210 | sourceTree = ""; 211 | }; 212 | 1F36054C234EC87F006377DC /* LaunchScreen.storyboard */ = { 213 | isa = PBXVariantGroup; 214 | children = ( 215 | 1F36054D234EC87F006377DC /* Base */, 216 | ); 217 | name = LaunchScreen.storyboard; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXVariantGroup section */ 221 | 222 | /* Begin XCBuildConfiguration section */ 223 | 1F360552234EC87F006377DC /* Debug */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_ANALYZER_NONNULL = YES; 228 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 230 | CLANG_CXX_LIBRARY = "libc++"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_ENABLE_OBJC_WEAK = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INFINITE_RECURSION = YES; 244 | CLANG_WARN_INT_CONVERSION = YES; 245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 247 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 249 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 250 | CLANG_WARN_STRICT_PROTOTYPES = YES; 251 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 252 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 253 | CLANG_WARN_UNREACHABLE_CODE = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | COPY_PHASE_STRIP = NO; 256 | DEBUG_INFORMATION_FORMAT = dwarf; 257 | ENABLE_STRICT_OBJC_MSGSEND = YES; 258 | ENABLE_TESTABILITY = YES; 259 | GCC_C_LANGUAGE_STANDARD = gnu11; 260 | GCC_DYNAMIC_NO_PIC = NO; 261 | GCC_NO_COMMON_BLOCKS = YES; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_PREPROCESSOR_DEFINITIONS = ( 264 | "DEBUG=1", 265 | "$(inherited)", 266 | ); 267 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 269 | GCC_WARN_UNDECLARED_SELECTOR = YES; 270 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 271 | GCC_WARN_UNUSED_FUNCTION = YES; 272 | GCC_WARN_UNUSED_VARIABLE = YES; 273 | IPHONEOS_DEPLOYMENT_TARGET = 13.1; 274 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 275 | MTL_FAST_MATH = YES; 276 | ONLY_ACTIVE_ARCH = YES; 277 | SDKROOT = iphoneos; 278 | }; 279 | name = Debug; 280 | }; 281 | 1F360553234EC87F006377DC /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ALWAYS_SEARCH_USER_PATHS = NO; 285 | CLANG_ANALYZER_NONNULL = YES; 286 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 288 | CLANG_CXX_LIBRARY = "libc++"; 289 | CLANG_ENABLE_MODULES = YES; 290 | CLANG_ENABLE_OBJC_ARC = YES; 291 | CLANG_ENABLE_OBJC_WEAK = YES; 292 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 293 | CLANG_WARN_BOOL_CONVERSION = YES; 294 | CLANG_WARN_COMMA = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 297 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 298 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INFINITE_RECURSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 304 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 305 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 306 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 307 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 308 | CLANG_WARN_STRICT_PROTOTYPES = YES; 309 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 310 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 311 | CLANG_WARN_UNREACHABLE_CODE = YES; 312 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 313 | COPY_PHASE_STRIP = NO; 314 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 315 | ENABLE_NS_ASSERTIONS = NO; 316 | ENABLE_STRICT_OBJC_MSGSEND = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu11; 318 | GCC_NO_COMMON_BLOCKS = YES; 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | IPHONEOS_DEPLOYMENT_TARGET = 13.1; 326 | MTL_ENABLE_DEBUG_INFO = NO; 327 | MTL_FAST_MATH = YES; 328 | SDKROOT = iphoneos; 329 | VALIDATE_PRODUCT = YES; 330 | }; 331 | name = Release; 332 | }; 333 | 1F360555234EC87F006377DC /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | baseConfigurationReference = 377F576A840ABB5D0948365A /* Pods-MLSDurexKitDemo.debug.xcconfig */; 336 | buildSettings = { 337 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 338 | CODE_SIGN_STYLE = Automatic; 339 | DEVELOPMENT_TEAM = FCF8X89TDD; 340 | INFOPLIST_FILE = MLSDurexKitDemo/Info.plist; 341 | LD_RUNPATH_SEARCH_PATHS = ( 342 | "$(inherited)", 343 | "@executable_path/Frameworks", 344 | ); 345 | PRODUCT_BUNDLE_IDENTIFIER = cn.minlison.MLSDurexKitDemo; 346 | PRODUCT_NAME = "$(TARGET_NAME)"; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | }; 349 | name = Debug; 350 | }; 351 | 1F360556234EC87F006377DC /* Release */ = { 352 | isa = XCBuildConfiguration; 353 | baseConfigurationReference = 6291B8828F58CDE75FDBD5B5 /* Pods-MLSDurexKitDemo.release.xcconfig */; 354 | buildSettings = { 355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 356 | CODE_SIGN_STYLE = Automatic; 357 | DEVELOPMENT_TEAM = FCF8X89TDD; 358 | INFOPLIST_FILE = MLSDurexKitDemo/Info.plist; 359 | LD_RUNPATH_SEARCH_PATHS = ( 360 | "$(inherited)", 361 | "@executable_path/Frameworks", 362 | ); 363 | PRODUCT_BUNDLE_IDENTIFIER = cn.minlison.MLSDurexKitDemo; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | }; 367 | name = Release; 368 | }; 369 | /* End XCBuildConfiguration section */ 370 | 371 | /* Begin XCConfigurationList section */ 372 | 1F360536234EC87E006377DC /* Build configuration list for PBXProject "MLSDurexKitDemo" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | 1F360552234EC87F006377DC /* Debug */, 376 | 1F360553234EC87F006377DC /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | 1F360554234EC87F006377DC /* Build configuration list for PBXNativeTarget "MLSDurexKitDemo" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | 1F360555234EC87F006377DC /* Debug */, 385 | 1F360556234EC87F006377DC /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | /* End XCConfigurationList section */ 391 | }; 392 | rootObject = 1F360533234EC87E006377DC /* Project object */; 393 | } 394 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MLSDurexKitDemo 4 | // 5 | // Created by yuanhang on 2019/10/10. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | @property (nullable, nonatomic, strong) UIWindow *window; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MLSDurexKitDemo 4 | // 5 | // Created by yuanhang on 2019/10/10. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 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 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 21 | self.window.rootViewController = ViewController.new; 22 | [self.window makeKeyAndVisible]; 23 | return YES; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/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 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/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 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MLSDurexKitDemo 4 | // 5 | // Created by yuanhang on 2019/10/10. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // MLSDurexKitDemo 4 | // 5 | // Created by yuanhang on 2019/10/10. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = UIColor.whiteColor; 20 | NSMutableArray *array = [NSMutableArray array]; 21 | [array addObject:nil]; 22 | } 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/MLSDurexKitDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MLSDurexKitDemo 4 | // 5 | // Created by yuanhang on 2019/10/10. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | #import 12 | int main(int argc, char * argv[]) { 13 | NSString * appDelegateClassName; 14 | @autoreleasepool { 15 | // Setup code that might create autoreleased objects goes here. 16 | appDelegateClassName = NSStringFromClass([AppDelegate class]); 17 | setSafeKitLogType(SafeKitLogTypeInfo | SafeKitLogTypeError | SafeKitLogTypeWarning); 18 | } 19 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 20 | } 21 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/cocoapods/Specs.git' 2 | source 'https://github.com/Minlison/Specs.git' 3 | 4 | platform :ios, '9.0' 5 | install! 'cocoapods', 6 | #deterministic_uuids: false, 7 | #disable_input_output_paths: true, 8 | #generate_multiple_pod_projects: true, 9 | #incremental_installation: true 10 | 11 | use_frameworks! 12 | inhibit_all_warnings! 13 | target 'MLSDurexKitDemo' do 14 | # Comment the next line if you don't want to use dynamic frameworks 15 | use_frameworks! 16 | 17 | # Pods for MLSDurexKitDemo 18 | pod 'MLSDurexKit', :path => '../' 19 | end 20 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MLSDurexKit (1.0.0): 3 | - MLSDurexKit/Core (= 1.0.0) 4 | - MLSDurexKit/MRC (= 1.0.0) 5 | - MLSDurexKit/Core (1.0.0) 6 | - MLSDurexKit/MRC (1.0.0) 7 | 8 | DEPENDENCIES: 9 | - MLSDurexKit (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | MLSDurexKit: 13 | :path: "../" 14 | 15 | SPEC CHECKSUMS: 16 | MLSDurexKit: e583beab6f0ffc0377378b01168d272e05cc138f 17 | 18 | PODFILE CHECKSUM: 910e7ec17ede251f4a21750ed74b827a5f6a8d95 19 | 20 | COCOAPODS: 1.7.5 21 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Local Podspecs/MLSDurexKit.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MLSDurexKit", 3 | "version": "1.0.0", 4 | "summary": "防止崩溃容错处理", 5 | "description": "Hack并exchange系统方法,拦截崩溃,例如字典set nil 等", 6 | "homepage": "https://www.minlison.cn", 7 | "license": "MIT", 8 | "authors": { 9 | "Minlison": "yuanhang.1991@163.com" 10 | }, 11 | "platforms": { 12 | "ios": "8.0" 13 | }, 14 | "source": { 15 | "git": "https://github.com/Minlison/MLSDurexKit.git", 16 | "tag": "1.0.0" 17 | }, 18 | "requires_arc": true, 19 | "documentation_url": "https://www.minlison.cn", 20 | "static_framework": true, 21 | "subspecs": [ 22 | { 23 | "name": "MRC", 24 | "source_files": "Classes/MRC/*.{h,m}", 25 | "public_header_files": "Classes/MRC/*.h" 26 | }, 27 | { 28 | "name": "Core", 29 | "exclude_files": "Classes/MRC/*.{h,m}", 30 | "source_files": "Classes/**/*.{h,m}", 31 | "public_header_files": "Classes/**/*.h" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MLSDurexKit (1.0.0): 3 | - MLSDurexKit/Core (= 1.0.0) 4 | - MLSDurexKit/MRC (= 1.0.0) 5 | - MLSDurexKit/Core (1.0.0) 6 | - MLSDurexKit/MRC (1.0.0) 7 | 8 | DEPENDENCIES: 9 | - MLSDurexKit (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | MLSDurexKit: 13 | :path: "../" 14 | 15 | SPEC CHECKSUMS: 16 | MLSDurexKit: e583beab6f0ffc0377378b01168d272e05cc138f 17 | 18 | PODFILE CHECKSUM: 910e7ec17ede251f4a21750ed74b827a5f6a8d95 19 | 20 | COCOAPODS: 1.7.5 21 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MLSDurexKit : NSObject 3 | @end 4 | @implementation PodsDummy_MLSDurexKit 5 | @end 6 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Foundation+SafeKit.h" 14 | #import "NSArray+SafeKit.h" 15 | #import "NSDictionary+SafeKit.h" 16 | #import "NSMutableArray+SafeKit.h" 17 | #import "NSMutableDictionary+SafeKit.h" 18 | #import "NSMutableString+SafeKit.h" 19 | #import "NSObject+SafeKit.h" 20 | #import "NSString+SafeKit.h" 21 | #import "MLSDurexKit.h" 22 | #import "NSException+SafeKit.h" 23 | #import "NSObject+Swizzle.h" 24 | #import "SafeKitConfig.h" 25 | #import "SafeKitCore.h" 26 | #import "SafeKitLog.h" 27 | #import "SafeKitMacro.h" 28 | #import "NSMutableArray+SafeKitMRC.h" 29 | 30 | FOUNDATION_EXPORT double MLSDurexKitVersionNumber; 31 | FOUNDATION_EXPORT const unsigned char MLSDurexKitVersionString[]; 32 | 33 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module MLSDurexKit { 2 | umbrella header "MLSDurexKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/MLSDurexKit/MLSDurexKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MLSDurexKit 5 | 6 | MIT License 7 | 8 | Copyright (c) 2019 Minlison 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo-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 | MIT License 18 | 19 | Copyright (c) 2019 Minlison 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | MLSDurexKit 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Generated by CocoaPods - https://cocoapods.org 49 | Title 50 | 51 | Type 52 | PSGroupSpecifier 53 | 54 | 55 | StringsTable 56 | Acknowledgements 57 | Title 58 | Acknowledgements 59 | 60 | 61 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MLSDurexKitDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MLSDurexKitDemo 5 | @end 6 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MLSDurexKitDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MLSDurexKitDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit/MLSDurexKit.framework/Headers" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit/MLSDurexKit.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "MLSDurexKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MLSDurexKitDemo { 2 | umbrella header "Pods-MLSDurexKitDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /MLSDurexKitDemo/Pods/Target Support Files/Pods-MLSDurexKitDemo/Pods-MLSDurexKitDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit/MLSDurexKit.framework/Headers" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit/MLSDurexKit.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/MLSDurexKit" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "MLSDurexKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MLSDurexKit 2 | DurexKit 防崩溃拦截 3 | -------------------------------------------------------------------------------- /docs/html/Categories/NSArray+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSArray(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSArray(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSArray+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSDictionary+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSDictionary(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSDictionary(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSDictionary+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSException+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSException(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 75 | 76 |
77 |
78 |
79 |
80 |

NSException(SafeKit) Category Reference

81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 |
Declared inNSException+SafeKit.h
89 | 90 | 91 | 92 | 93 | 94 | 95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 |
103 |
104 | 105 |

– printStackTrace 106 |

107 | 108 |
109 |
110 | 111 |
112 | 113 | 114 |
- (void)printStackTrace
115 | 116 | 117 |
118 |
119 |
120 | 121 |

– printStackTrace: 122 |

123 | 124 |
125 |
126 | 127 |
128 | 129 | 130 |
- (void)printStackTrace:(NSString *)reasonStr
131 | 132 | 133 |
134 |
135 |
136 |
137 | 138 |
139 | 140 | 141 | 142 | 143 |
144 | 145 |
146 | 154 |
155 |
156 |
157 |
158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /docs/html/Categories/NSMutableArray+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSMutableArray(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSMutableArray(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSMutableArray+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSMutableArray+SafeKitMRC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSMutableArray(SafeKitMRC) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSMutableArray(SafeKitMRC) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSMutableArray+SafeKitMRC.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSMutableDictionary+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSMutableDictionary(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSMutableDictionary(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSMutableDictionary+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSMutableString+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSMutableString(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSMutableString(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSMutableString+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSObject+SafeKit_KVO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSObject(SafeKit_KVO) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSObject(SafeKit_KVO) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSObject+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSObject+SafeKit_Perform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSObject(SafeKit_Perform) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSObject(SafeKit_Perform) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSObject+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Categories/NSObject+Swizzle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSObject(Swizzle) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 77 | 78 |
79 |
80 |
81 |
82 |

NSObject(Swizzle) Category Reference

83 | 84 | 85 |
86 | 87 | 88 | 89 | 90 |
Declared inNSObject+Swizzle.h
91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 |
105 |
106 | 107 |

+ safe_swizzleMethod:tarSel: 108 |

109 | 110 |
111 |
112 | 113 |
114 | 115 | 116 |
+ (void)safe_swizzleMethod:(SEL)srcSel tarSel:(SEL)tarSel
117 | 118 | 119 |
120 |
121 |
122 | 123 |

+ safe_swizzleMethod:tarClass:tarSel: 124 |

125 | 126 |
127 |
128 | 129 |
130 | 131 | 132 |
+ (void)safe_swizzleMethod:(SEL)srcSel tarClass:(NSString *)tarClassName tarSel:(SEL)tarSel
133 | 134 | 135 |
136 |
137 |
138 | 139 |

+ safe_swizzleMethod:srcSel:tarClass:tarSel: 140 |

141 | 142 |
143 |
144 | 145 |
146 | 147 | 148 |
+ (void)safe_swizzleMethod:(Class)srcClass srcSel:(SEL)srcSel tarClass:(Class)tarClass tarSel:(SEL)tarSel
149 | 150 | 151 |
152 |
153 |
154 |
155 | 156 |
157 | 158 | 159 | 160 | 161 |
162 | 163 |
164 | 172 |
173 |
174 |
175 |
176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /docs/html/Categories/NSString+SafeKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSString(SafeKit) Category Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 65 | 66 |
67 |
68 |
69 |
70 |

NSString(SafeKit) Category Reference

71 | 72 | 73 |
74 | 75 | 76 | 77 | 78 |
Declared inNSString+SafeKit.h
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 |
91 | 99 |
100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/Classes/SafeKitLog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SafeKitLog Class Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 93 | 94 |
95 |
96 |
97 |
98 |

SafeKitLog Class Reference

99 | 100 | 101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 |
Inherits fromNSObject
Declared inSafeKitLog.h
110 | 111 | 112 | 113 | 114 | 115 | 116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 |
124 |
125 | 126 |

  printer 127 |

128 | 129 |
130 |
131 | 132 |
133 | 134 | 135 |
@property (nonatomic, strong) SafeKitPrinter *printer
136 | 137 | 138 |
139 |
140 |
141 | 142 |

– initWithPrinter: 143 |

144 | 145 |
146 |
147 | 148 |
149 | 150 | 151 |
- (id)initWithPrinter:(SafeKitPrinter *)printer
152 | 153 | 154 |
155 |
156 |
157 | 158 |

– log: 159 |

160 | 161 |
162 |
163 | 164 |
165 | 166 | 167 |
- (void)log:(NSString *)aString
168 | 169 | 170 |
171 |
172 |
173 | 174 |

– logInfo: 175 |

176 | 177 |
178 |
179 | 180 |
181 | 182 | 183 |
- (void)logInfo:(NSString *)aString
184 | 185 | 186 |
187 |
188 |
189 | 190 |

– logWarning: 191 |

192 | 193 |
194 |
195 | 196 |
197 | 198 | 199 |
- (void)logWarning:(NSString *)aString
200 | 201 | 202 |
203 |
204 |
205 | 206 |

– logError: 207 |

208 | 209 |
210 |
211 | 212 |
213 | 214 | 215 |
- (void)logError:(NSString *)aString
216 | 217 | 218 |
219 |
220 |
221 | 222 |

+ shareInstance 223 |

224 | 225 |
226 |
227 | 228 |
229 | 230 | 231 |
+ (SafeKitLog *)shareInstance
232 | 233 | 234 |
235 |
236 |
237 |
238 | 239 |
240 | 241 | 242 | 243 | 244 |
245 | 246 |
247 | 255 |
256 |
257 |
258 |
259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /docs/html/Classes/SafeKitPrinter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SafeKitPrinter Class Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 73 | 74 |
75 |
76 |
77 |
78 |

SafeKitPrinter Class Reference

79 | 80 | 81 |
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 |
Inherits fromNSObject
Declared inSafeKitLog.h
90 | 91 | 92 | 93 | 94 | 95 | 96 |
97 | 98 | 99 | 100 | 101 | 102 | 103 |
104 |
105 | 106 |

– print: 107 |

108 | 109 |
110 |
111 | 112 |
113 | 114 | 115 |
- (void)print:(NSString *)aString
116 | 117 | 118 |
119 |
120 |
121 |
122 | 123 |
124 | 125 | 126 | 127 | 128 |
129 | 130 |
131 | 139 |
140 |
141 |
142 |
143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /docs/html/Constants/SafeKitObjectPerformExceptionCatch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SafeKitObjectPerformExceptionCatch Constants Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 57 | 58 |
59 |
60 |
61 |
62 |

SafeKitObjectPerformExceptionCatch Constants Reference

63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 |
Declared inSafeKitConfig.h
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |

SafeKitObjectPerformExceptionCatch

79 | 80 |
81 | 82 | 83 |

Definition

84 | typedef NS_ENUM(NSInteger, SafeKitObjectPerformExceptionCatch ) {
85 | 86 |    SafeKitObjectPerformExceptionCatchOn,
87 | 88 |    SafeKitObjectPerformExceptionCatchOff,
89 | 90 | };
91 | 92 |
93 | 94 |
95 |

Constants

96 |
97 | 98 |
SafeKitObjectPerformExceptionCatchOn
99 |
100 | 101 | 102 |

103 | Declared In SafeKitConfig.h. 104 |

105 | 106 |
107 | 108 |
SafeKitObjectPerformExceptionCatchOff
109 |
110 | 111 | 112 |

113 | Declared In SafeKitConfig.h. 114 |

115 | 116 |
117 | 118 |
119 |
120 | 121 | 122 | 123 | 124 |
125 | 126 |
127 | 135 |
136 |
137 |
138 |
139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /docs/html/css/scss/_index.scss: -------------------------------------------------------------------------------- 1 | .index-container { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | 6 | @media (max-width: $mobile-max-width) { 7 | flex-direction: column; 8 | } 9 | 10 | .index-column { 11 | flex: 1 1 33%; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/html/css/scss/_layout.scss: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | .clear { 6 | clear: both; 7 | } 8 | 9 | .clearfix { 10 | &:before, &:after { 11 | clear: both; 12 | display: table; 13 | content: ""; 14 | } 15 | } 16 | 17 | .xcode .hide-in-xcode { 18 | display: none; 19 | } 20 | 21 | body { 22 | font: 62.5% $body-font; 23 | background: $body-background; 24 | } 25 | 26 | h1, h2, h3 { 27 | font-weight: 300; 28 | color: #808080; 29 | } 30 | 31 | h1 { 32 | font-size: 2em; 33 | color: #000; 34 | } 35 | 36 | h4 { 37 | font-size: 13px; 38 | line-height: 1.5; 39 | margin: 21px 0 0 0; 40 | } 41 | 42 | a { 43 | color: $tint-color; 44 | text-decoration: none; 45 | } 46 | 47 | pre, code { 48 | font-family: $code-font; 49 | word-wrap: break-word; 50 | } 51 | 52 | pre > code, .method-declaration code { 53 | display: inline-block; 54 | font-size: .85em; 55 | padding: 4px 0 4px 10px; 56 | border-left: 5px solid rgba(0, 155, 51, .2); 57 | 58 | &:before { 59 | content: "Objective-C"; 60 | display: block; 61 | 62 | font: 9px/1 $body-font; 63 | color: #009b33; 64 | text-transform: uppercase; 65 | letter-spacing: 2px; 66 | padding-bottom: 6px; 67 | } 68 | } 69 | 70 | pre > code { 71 | font-size: inherit; 72 | } 73 | 74 | table, th, td { 75 | border: 1px solid #e9e9e9; 76 | } 77 | 78 | table { 79 | width: 100%; 80 | } 81 | 82 | th, td { 83 | padding: 7px; 84 | 85 | > :first-child { 86 | margin-top: 0; 87 | } 88 | 89 | > :last-child { 90 | margin-bottom: 0; 91 | } 92 | } 93 | 94 | .container { 95 | @extend .clearfix; 96 | 97 | max-width: 980px; 98 | padding: 0 10px; 99 | margin: 0 auto; 100 | 101 | @media (max-width: $mobile-max-width) { 102 | padding: 0; 103 | } 104 | } 105 | 106 | header { 107 | position: fixed; 108 | top: 0; 109 | left: 0; 110 | width: 100%; 111 | z-index: 2; 112 | 113 | background: #414141; 114 | color: #fff; 115 | font-size: 1.1em; 116 | line-height: 25px; 117 | letter-spacing: .05em; 118 | 119 | #library-title { 120 | float: left; 121 | } 122 | 123 | #developer-home { 124 | float: right; 125 | } 126 | 127 | h1 { 128 | font-size: inherit; 129 | font-weight: inherit; 130 | margin: 0; 131 | } 132 | 133 | p { 134 | margin: 0; 135 | } 136 | 137 | h1, a { 138 | color: inherit; 139 | } 140 | 141 | @media (max-width: $mobile-max-width) { 142 | position: absolute; 143 | 144 | .container { 145 | padding: 0 10px; 146 | } 147 | } 148 | } 149 | 150 | aside { 151 | position: fixed; 152 | top: 25px; 153 | left: 0; 154 | width: 100%; 155 | height: 25px; 156 | z-index: 2; 157 | 158 | font-size: 1.1em; 159 | 160 | @media (max-width: $mobile-max-width) { 161 | position: absolute; 162 | } 163 | 164 | #header-buttons { 165 | background: rgba(255, 255, 255, .8); 166 | margin: 0 1px; 167 | padding: 0; 168 | list-style: none; 169 | text-align: right; 170 | line-height: 32px; 171 | 172 | li { 173 | display: inline-block; 174 | cursor: pointer; 175 | padding: 0 10px; 176 | } 177 | 178 | label, select { 179 | cursor: inherit; 180 | } 181 | 182 | #on-this-page { 183 | position: relative; 184 | 185 | .chevron { 186 | display: inline-block; 187 | width: 14px; 188 | height: 4px; 189 | position: relative; 190 | 191 | .chevy { 192 | background: #878787; 193 | height: 2px; 194 | position: absolute; 195 | width: 10px; 196 | 197 | &.chevron-left { 198 | left: 0; 199 | transform: rotateZ(45deg) scale(0.6); 200 | } 201 | 202 | &.chevron-right { 203 | right: 0; 204 | transform: rotateZ(-45deg) scale(0.6); 205 | } 206 | } 207 | } 208 | 209 | #jump-to { 210 | opacity: 0; 211 | font-size: 16px; 212 | 213 | position: absolute; 214 | top: 5px; 215 | left: 0; 216 | width: 100%; 217 | height: 100%; 218 | } 219 | } 220 | } 221 | } 222 | 223 | article { 224 | margin-top: 25px; 225 | 226 | #content { 227 | @extend .clearfix; 228 | 229 | background: $content-background; 230 | border: 1px solid $content-border; 231 | padding: 15px 25px 30px 25px; 232 | 233 | font-size: 1.4em; 234 | line-height: 1.45; 235 | 236 | position: relative; 237 | 238 | @media (max-width: $mobile-max-width) { 239 | padding: 15px 10px 20px 10px; 240 | } 241 | 242 | .navigation-top { 243 | position: absolute; 244 | top: 15px; 245 | right: 25px; 246 | } 247 | 248 | .title { 249 | margin: 21px 0 0 0; 250 | padding: 15px 0; 251 | } 252 | 253 | p { 254 | color: #414141; 255 | margin: 0 0 15px 0; 256 | } 257 | 258 | th, td { 259 | p:last-child { 260 | margin-bottom: 0; 261 | } 262 | } 263 | 264 | main { 265 | ul { 266 | list-style: none; 267 | margin-left: 24px; 268 | margin-bottom: 12px; 269 | padding: 0; 270 | 271 | li { 272 | position: relative; 273 | padding-left: 1.3em; 274 | 275 | &:before { 276 | content: "\02022"; 277 | 278 | color: #414141; 279 | font-size: 1.08em; 280 | line-height: 1; 281 | 282 | position: absolute; 283 | left: 0; 284 | padding-top: 2px; 285 | } 286 | } 287 | } 288 | } 289 | 290 | footer { 291 | @extend .clearfix; 292 | 293 | .footer-copyright { 294 | margin: 70px 25px 10px 0; 295 | } 296 | 297 | p { 298 | font-size: .71em; 299 | color: #a0a0a0; 300 | } 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /docs/html/css/scss/_normalize.scss: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | Normalize.scss settings 3 | ========================================================================== */ 4 | /** 5 | * Includes legacy browser support IE6/7 6 | * 7 | * Set to false if you want to drop support for IE6 and IE7 8 | */ 9 | 10 | $legacy_browser_support: false !default; 11 | 12 | /* Base 13 | ========================================================================== */ 14 | 15 | /** 16 | * 1. Set default font family to sans-serif. 17 | * 2. Prevent iOS text size adjust after orientation change, without disabling 18 | * user zoom. 19 | * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using 20 | * `em` units. 21 | */ 22 | 23 | html { 24 | font-family: sans-serif; /* 1 */ 25 | -ms-text-size-adjust: 100%; /* 2 */ 26 | -webkit-text-size-adjust: 100%; /* 2 */ 27 | @if $legacy_browser_support { 28 | *font-size: 100%; /* 3 */ 29 | } 30 | } 31 | 32 | /** 33 | * Remove default margin. 34 | */ 35 | 36 | body { 37 | margin: 0; 38 | } 39 | 40 | /* HTML5 display definitions 41 | ========================================================================== */ 42 | 43 | /** 44 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 45 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 46 | * and Firefox. 47 | * Correct `block` display not defined for `main` in IE 11. 48 | */ 49 | 50 | article, 51 | aside, 52 | details, 53 | figcaption, 54 | figure, 55 | footer, 56 | header, 57 | hgroup, 58 | main, 59 | menu, 60 | nav, 61 | section, 62 | summary { 63 | display: block; 64 | } 65 | 66 | /** 67 | * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. 68 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 69 | */ 70 | 71 | audio, 72 | canvas, 73 | progress, 74 | video { 75 | display: inline-block; /* 1 */ 76 | vertical-align: baseline; /* 2 */ 77 | @if $legacy_browser_support { 78 | *display: inline; 79 | *zoom: 1; 80 | } 81 | } 82 | 83 | /** 84 | * Prevents modern browsers from displaying `audio` without controls. 85 | * Remove excess height in iOS 5 devices. 86 | */ 87 | 88 | audio:not([controls]) { 89 | display: none; 90 | height: 0; 91 | } 92 | 93 | /** 94 | * Address `[hidden]` styling not present in IE 8/9/10. 95 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 96 | */ 97 | 98 | [hidden], 99 | template { 100 | display: none; 101 | } 102 | 103 | /* Links 104 | ========================================================================== */ 105 | 106 | /** 107 | * Remove the gray background color from active links in IE 10. 108 | */ 109 | 110 | a { 111 | background-color: transparent; 112 | } 113 | 114 | /** 115 | * Improve readability when focused and also mouse hovered in all browsers. 116 | */ 117 | 118 | a { 119 | &:active, &:hover { 120 | outline: 0; 121 | }; 122 | } 123 | 124 | /* Text-level semantics 125 | ========================================================================== */ 126 | 127 | /** 128 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 129 | */ 130 | 131 | abbr[title] { 132 | border-bottom: 1px dotted; 133 | } 134 | 135 | /** 136 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 137 | */ 138 | 139 | b, 140 | strong { 141 | font-weight: bold; 142 | } 143 | 144 | @if $legacy_browser_support { 145 | blockquote { 146 | margin: 1em 40px; 147 | } 148 | } 149 | 150 | /** 151 | * Address styling not present in Safari and Chrome. 152 | */ 153 | 154 | dfn { 155 | font-style: italic; 156 | } 157 | 158 | /** 159 | * Address variable `h1` font-size and margin within `section` and `article` 160 | * contexts in Firefox 4+, Safari, and Chrome. 161 | */ 162 | 163 | h1 { 164 | font-size: 2em; 165 | margin: 0.67em 0; 166 | } 167 | 168 | @if $legacy_browser_support { 169 | h2 { 170 | font-size: 1.5em; 171 | margin: 0.83em 0; 172 | } 173 | 174 | h3 { 175 | font-size: 1.17em; 176 | margin: 1em 0; 177 | } 178 | 179 | h4 { 180 | font-size: 1em; 181 | margin: 1.33em 0; 182 | } 183 | 184 | h5 { 185 | font-size: 0.83em; 186 | margin: 1.67em 0; 187 | } 188 | 189 | h6 { 190 | font-size: 0.67em; 191 | margin: 2.33em 0; 192 | } 193 | } 194 | 195 | /** 196 | * Addresses styling not present in IE 8/9. 197 | */ 198 | 199 | mark { 200 | background: #ff0; 201 | color: #000; 202 | } 203 | 204 | @if $legacy_browser_support { 205 | 206 | /** 207 | * Addresses margins set differently in IE 6/7. 208 | */ 209 | 210 | p, 211 | pre { 212 | *margin: 1em 0; 213 | } 214 | 215 | /* 216 | * Addresses CSS quotes not supported in IE 6/7. 217 | */ 218 | 219 | q { 220 | *quotes: none; 221 | } 222 | 223 | /* 224 | * Addresses `quotes` property not supported in Safari 4. 225 | */ 226 | 227 | q:before, 228 | q:after { 229 | content: ''; 230 | content: none; 231 | } 232 | } 233 | 234 | /** 235 | * Address inconsistent and variable font size in all browsers. 236 | */ 237 | 238 | small { 239 | font-size: 80%; 240 | } 241 | 242 | /** 243 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 244 | */ 245 | 246 | sub, 247 | sup { 248 | font-size: 75%; 249 | line-height: 0; 250 | position: relative; 251 | vertical-align: baseline; 252 | } 253 | 254 | sup { 255 | top: -0.5em; 256 | } 257 | 258 | sub { 259 | bottom: -0.25em; 260 | } 261 | 262 | @if $legacy_browser_support { 263 | 264 | /* ========================================================================== 265 | Lists 266 | ========================================================================== */ 267 | 268 | /* 269 | * Addresses margins set differently in IE 6/7. 270 | */ 271 | 272 | dl, 273 | menu, 274 | ol, 275 | ul { 276 | *margin: 1em 0; 277 | } 278 | 279 | dd { 280 | *margin: 0 0 0 40px; 281 | } 282 | 283 | /* 284 | * Addresses paddings set differently in IE 6/7. 285 | */ 286 | 287 | menu, 288 | ol, 289 | ul { 290 | *padding: 0 0 0 40px; 291 | } 292 | 293 | /* 294 | * Corrects list images handled incorrectly in IE 7. 295 | */ 296 | 297 | nav ul, 298 | nav ol { 299 | *list-style: none; 300 | *list-style-image: none; 301 | } 302 | 303 | } 304 | 305 | /* Embedded content 306 | ========================================================================== */ 307 | 308 | /** 309 | * 1. Remove border when inside `a` element in IE 8/9/10. 310 | * 2. Improves image quality when scaled in IE 7. 311 | */ 312 | 313 | img { 314 | border: 0; 315 | @if $legacy_browser_support { 316 | *-ms-interpolation-mode: bicubic; /* 2 */ 317 | } 318 | } 319 | 320 | /** 321 | * Correct overflow not hidden in IE 9/10/11. 322 | */ 323 | 324 | svg:not(:root) { 325 | overflow: hidden; 326 | } 327 | 328 | /* Grouping content 329 | ========================================================================== */ 330 | 331 | /** 332 | * Address margin not present in IE 8/9 and Safari. 333 | */ 334 | 335 | figure { 336 | margin: 1em 40px; 337 | } 338 | 339 | /** 340 | * Address differences between Firefox and other browsers. 341 | */ 342 | 343 | hr { 344 | -moz-box-sizing: content-box; 345 | box-sizing: content-box; 346 | height: 0; 347 | } 348 | 349 | /** 350 | * Contain overflow in all browsers. 351 | */ 352 | 353 | pre { 354 | overflow: auto; 355 | } 356 | 357 | /** 358 | * Address odd `em`-unit font size rendering in all browsers. 359 | * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. 360 | */ 361 | 362 | code, 363 | kbd, 364 | pre, 365 | samp { 366 | font-family: monospace, monospace; 367 | @if $legacy_browser_support { 368 | _font-family: 'courier new', monospace; 369 | } 370 | font-size: 1em; 371 | } 372 | 373 | /* Forms 374 | ========================================================================== */ 375 | 376 | /** 377 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 378 | * styling of `select`, unless a `border` property is set. 379 | */ 380 | 381 | /** 382 | * 1. Correct color not being inherited. 383 | * Known issue: affects color of disabled elements. 384 | * 2. Correct font properties not being inherited. 385 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 386 | * 4. Improves appearance and consistency in all browsers. 387 | */ 388 | 389 | button, 390 | input, 391 | optgroup, 392 | select, 393 | textarea { 394 | color: inherit; /* 1 */ 395 | font: inherit; /* 2 */ 396 | margin: 0; /* 3 */ 397 | @if $legacy_browser_support { 398 | vertical-align: baseline; /* 3 */ 399 | *vertical-align: middle; /* 3 */ 400 | } 401 | } 402 | 403 | /** 404 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 405 | */ 406 | 407 | button { 408 | overflow: visible; 409 | } 410 | 411 | /** 412 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 413 | * All other form control elements do not inherit `text-transform` values. 414 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 415 | * Correct `select` style inheritance in Firefox. 416 | */ 417 | 418 | button, 419 | select { 420 | text-transform: none; 421 | } 422 | 423 | /** 424 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 425 | * and `video` controls. 426 | * 2. Correct inability to style clickable `input` types in iOS. 427 | * 3. Improve usability and consistency of cursor style between image-type 428 | * `input` and others. 429 | * 4. Removes inner spacing in IE 7 without affecting normal text inputs. 430 | * Known issue: inner spacing remains in IE 6. 431 | */ 432 | 433 | button, 434 | html input[type="button"], /* 1 */ 435 | input[type="reset"], 436 | input[type="submit"] { 437 | -webkit-appearance: button; /* 2 */ 438 | cursor: pointer; /* 3 */ 439 | @if $legacy_browser_support { 440 | *overflow: visible; /* 4 */ 441 | } 442 | } 443 | 444 | /** 445 | * Re-set default cursor for disabled elements. 446 | */ 447 | 448 | button[disabled], 449 | html input[disabled] { 450 | cursor: default; 451 | } 452 | 453 | /** 454 | * Remove inner padding and border in Firefox 4+. 455 | */ 456 | 457 | button::-moz-focus-inner, 458 | input::-moz-focus-inner { 459 | border: 0; 460 | padding: 0; 461 | } 462 | 463 | /** 464 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 465 | * the UA stylesheet. 466 | */ 467 | 468 | input { 469 | line-height: normal; 470 | } 471 | 472 | /** 473 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 474 | * 2. Remove excess padding in IE 8/9/10. 475 | * Known issue: excess padding remains in IE 6. 476 | */ 477 | 478 | input[type="checkbox"], 479 | input[type="radio"] { 480 | box-sizing: border-box; /* 1 */ 481 | padding: 0; /* 2 */ 482 | @if $legacy_browser_support { 483 | *height: 13px; /* 3 */ 484 | *width: 13px; /* 3 */ 485 | } 486 | } 487 | 488 | /** 489 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 490 | * `font-size` values of the `input`, it causes the cursor style of the 491 | * decrement button to change from `default` to `text`. 492 | */ 493 | 494 | input[type="number"]::-webkit-inner-spin-button, 495 | input[type="number"]::-webkit-outer-spin-button { 496 | height: auto; 497 | } 498 | 499 | /** 500 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 501 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 502 | * (include `-moz` to future-proof). 503 | */ 504 | 505 | input[type="search"] { 506 | -webkit-appearance: textfield; /* 1 */ 507 | -moz-box-sizing: content-box; 508 | -webkit-box-sizing: content-box; /* 2 */ 509 | box-sizing: content-box; 510 | } 511 | 512 | /** 513 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 514 | * Safari (but not Chrome) clips the cancel button when the search input has 515 | * padding (and `textfield` appearance). 516 | */ 517 | 518 | input[type="search"]::-webkit-search-cancel-button, 519 | input[type="search"]::-webkit-search-decoration { 520 | -webkit-appearance: none; 521 | } 522 | 523 | /** 524 | * Define consistent border, margin, and padding. 525 | */ 526 | 527 | fieldset { 528 | border: 1px solid #c0c0c0; 529 | margin: 0 2px; 530 | padding: 0.35em 0.625em 0.75em; 531 | } 532 | 533 | /** 534 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 535 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 536 | * 3. Corrects text not wrapping in Firefox 3. 537 | * 4. Corrects alignment displayed oddly in IE 6/7. 538 | */ 539 | 540 | legend { 541 | border: 0; /* 1 */ 542 | padding: 0; /* 2 */ 543 | @if $legacy_browser_support { 544 | white-space: normal; /* 3 */ 545 | *margin-left: -7px; /* 4 */ 546 | } 547 | } 548 | 549 | /** 550 | * Remove default vertical scrollbar in IE 8/9/10/11. 551 | */ 552 | 553 | textarea { 554 | overflow: auto; 555 | } 556 | 557 | /** 558 | * Don't inherit the `font-weight` (applied by a rule above). 559 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 560 | */ 561 | 562 | optgroup { 563 | font-weight: bold; 564 | } 565 | 566 | /* Tables 567 | ========================================================================== */ 568 | 569 | /** 570 | * Remove most spacing between table cells. 571 | */ 572 | 573 | table { 574 | border-collapse: collapse; 575 | border-spacing: 0; 576 | } 577 | 578 | td, 579 | th { 580 | padding: 0; 581 | } 582 | -------------------------------------------------------------------------------- /docs/html/css/scss/_object.scss: -------------------------------------------------------------------------------- 1 | .section-specification { 2 | table { 3 | width: auto; 4 | 5 | th { 6 | text-align: left; 7 | } 8 | } 9 | } 10 | 11 | .method-title { 12 | margin-left: -15px; 13 | margin-bottom: 8px; 14 | transition: margin-left .3s ease-out; 15 | 16 | .section-method.hide & { 17 | margin-left: 0; 18 | } 19 | 20 | code { 21 | font-weight: 400; 22 | font-size: .85em; 23 | } 24 | } 25 | 26 | .method-info { 27 | background: $object-background; 28 | border-bottom: 1px solid $object-border; 29 | margin: 0 -25px; 30 | padding: 20px 25px 0 25px; 31 | transition: height .3s ease-out; 32 | 33 | position: relative; 34 | 35 | .pointy-thing { 36 | background: $content-background; 37 | height: 10px; 38 | border-bottom: 1px solid $object-border; 39 | margin: -20px -25px 16px -25px; 40 | 41 | &:before { 42 | display: inline-block; 43 | content: ""; 44 | 45 | background: $object-background; 46 | border: 1px solid $object-border; 47 | border-bottom: 0; 48 | border-right: 0; 49 | 50 | position: absolute; 51 | left: 21px; 52 | top: 3px; 53 | width: 12px; 54 | height: 12px; 55 | transform: rotate(45deg); 56 | } 57 | } 58 | 59 | .method-subsection { 60 | margin-bottom: 15px; 61 | 62 | .argument-name { 63 | width: 1px; 64 | text-align: right; 65 | 66 | code { 67 | color: #808080; 68 | font-style: italic; 69 | font-weight: 400; 70 | } 71 | } 72 | } 73 | } 74 | 75 | .section-method { 76 | &.hide .method-info { 77 | height: 0 !important; 78 | overflow: hidden; 79 | display: none; 80 | } 81 | 82 | &.hide.animating .method-info { 83 | display: block; 84 | } 85 | 86 | &.animating .method-info { 87 | overflow: hidden; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /docs/html/css/scss/_print.scss: -------------------------------------------------------------------------------- 1 | @media print { 2 | body { 3 | background: #fff; 4 | padding: 8px; 5 | } 6 | 7 | header { 8 | position: static; 9 | background: #fff; 10 | color: #000; 11 | } 12 | 13 | aside { 14 | display: none; 15 | } 16 | 17 | .container { 18 | max-width: none; 19 | padding: 0; 20 | } 21 | 22 | article { 23 | margin-top: 0; 24 | 25 | #content { 26 | border: 0; 27 | background: #fff; 28 | padding: 15px 0 0 0; 29 | 30 | .title { 31 | margin-top: 0; 32 | padding-top: 0; 33 | } 34 | } 35 | } 36 | 37 | .method-info { 38 | &, & .pointy-thing { 39 | background: #fff; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /docs/html/css/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $body-font: -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; 2 | $code-font: "Source Code Pro", Monaco, Menlo, Consolas, monospace; 3 | 4 | $body-background: #f2f2f2; 5 | $content-background: #fff; 6 | $content-border: #e9e9e9; 7 | $tint-color: #08c; 8 | $object-background: #f9f9f9; 9 | $object-border: #e9e9e9; 10 | 11 | $mobile-max-width: 650px; 12 | -------------------------------------------------------------------------------- /docs/html/css/scss/_xcode.scss: -------------------------------------------------------------------------------- 1 | .xcode { 2 | header, aside { 3 | display: none; 4 | } 5 | 6 | .container { 7 | padding: 0; 8 | } 9 | 10 | article { 11 | margin-top: 0; 12 | 13 | #content { 14 | border: 0; 15 | margin: 0; 16 | } 17 | } 18 | 19 | .method-info { 20 | &, .section-method.hide & { 21 | max-height: auto; 22 | overflow: visible; 23 | 24 | &.hiding { 25 | display: block; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/html/css/scss/style.scss: -------------------------------------------------------------------------------- 1 | @import "variables", "normalize", "layout", "index", "object", "print", "xcode"; 2 | -------------------------------------------------------------------------------- /docs/html/css/style.css: -------------------------------------------------------------------------------- 1 | html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{box-sizing:border-box}.clear{clear:both}.clearfix:before,.container:before,article #content:before,article #content footer:before,.clearfix:after,.container:after,article #content:after,article #content footer:after{clear:both;display:table;content:""}.xcode .hide-in-xcode{display:none}body{font:62.5% -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;background:#f2f2f2}h1,h2,h3{font-weight:300;color:gray}h1{font-size:2em;color:#000}h4{font-size:13px;line-height:1.5;margin:21px 0 0}a{color:#08c;text-decoration:none}pre,code{font-family:Source Code Pro,Monaco,Menlo,Consolas,monospace;word-wrap:break-word}pre>code,.method-declaration code{display:inline-block;font-size:.85em;padding:4px 0 4px 10px;border-left:5px solid rgba(0,155,51,.2)}pre>code:before,.method-declaration code:before{content:"Objective-C";display:block;font:9px/1 -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;color:#009b33;text-transform:uppercase;letter-spacing:2px;padding-bottom:6px}pre>code{font-size:inherit}table,th,td{border:1px solid #e9e9e9}table{width:100%}th,td{padding:7px}th>:first-child,td>:first-child{margin-top:0}th>:last-child,td>:last-child{margin-bottom:0}.container{max-width:980px;padding:0 10px;margin:0 auto}@media(max-width:650px){.container{padding:0}}header{position:fixed;top:0;left:0;width:100%;z-index:2;background:#414141;color:#fff;font-size:1.1em;line-height:25px;letter-spacing:.05em}header #library-title{float:left}header #developer-home{float:right}header h1{font-size:inherit;font-weight:inherit;margin:0}header p{margin:0}header h1,header a{color:inherit}@media(max-width:650px){header{position:absolute}header .container{padding:0 10px}}aside{position:fixed;top:25px;left:0;width:100%;height:25px;z-index:2;font-size:1.1em}aside #header-buttons{background:rgba(255,255,255,.8);margin:0 1px;padding:0;list-style:none;text-align:right;line-height:32px}aside #header-buttons li{display:inline-block;cursor:pointer;padding:0 10px}aside #header-buttons label,aside #header-buttons select{cursor:inherit}aside #header-buttons #on-this-page{position:relative}aside #header-buttons #on-this-page .chevron{display:inline-block;width:14px;height:4px;position:relative}aside #header-buttons #on-this-page .chevron .chevy{background:#878787;height:2px;position:absolute;width:10px}aside #header-buttons #on-this-page .chevron .chevy.chevron-left{left:0;-webkit-transform:rotateZ(45deg) scale(.6);transform:rotateZ(45deg) scale(.6)}aside #header-buttons #on-this-page .chevron .chevy.chevron-right{right:0;-webkit-transform:rotateZ(-45deg) scale(.6);transform:rotateZ(-45deg) scale(.6)}aside #header-buttons #on-this-page #jump-to{opacity:0;filter:alpha(opacity=0);font-size:16px;position:absolute;top:5px;left:0;width:100%;height:100%}article{margin-top:25px}article #content{background:#fff;border:1px solid #e9e9e9;padding:15px 25px 30px;font-size:1.4em;line-height:1.45;position:relative}@media(max-width:650px){article #content{padding:15px 10px 20px}}article #content .navigation-top{position:absolute;top:15px;right:25px}article #content .title{margin:21px 0 0;padding:15px 0}article #content p{color:#414141;margin:0 0 15px}article #content th p:last-child,article #content td p:last-child{margin-bottom:0}article #content main ul{list-style:none;margin-left:24px;margin-bottom:12px;padding:0}article #content main ul li{position:relative;padding-left:1.3em}article #content main ul li:before{content:"\02022";color:#414141;font-size:1.08em;line-height:1;position:absolute;left:0;padding-top:2px}article #content footer .footer-copyright{margin:70px 25px 10px 0}article #content footer p{font-size:.71em;color:#a0a0a0}.index-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}@media(max-width:650px){.index-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}}.index-container .index-column{-webkit-box-flex:1;-webkit-flex:1 1 33%;-ms-flex:1 1 33%;flex:1 1 33%}.section-specification table{width:auto}.section-specification table th{text-align:left}.method-title{margin-left:-15px;margin-bottom:8px;-webkit-transition:margin-left .3s ease-out;transition:margin-left .3s ease-out}.section-method.hide .method-title{margin-left:0}.method-title code{font-weight:400;font-size:.85em}.method-info{background:#f9f9f9;border-bottom:1px solid #e9e9e9;margin:0 -25px;padding:20px 25px 0;-webkit-transition:height .3s ease-out;transition:height .3s ease-out;position:relative}.method-info .pointy-thing{background:#fff;height:10px;border-bottom:1px solid #e9e9e9;margin:-20px -25px 16px}.method-info .pointy-thing:before{display:inline-block;content:"";background:#f9f9f9;border:1px solid #e9e9e9;border-bottom:0;border-right:0;position:absolute;left:21px;top:3px;width:12px;height:12px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.method-info .method-subsection{margin-bottom:15px}.method-info .method-subsection .argument-name{width:1px;text-align:right}.method-info .method-subsection .argument-name code{color:gray;font-style:italic;font-weight:400}.section-method.hide .method-info{height:0!important;overflow:hidden;display:none}.section-method.hide.animating .method-info{display:block}.section-method.animating .method-info{overflow:hidden}@media print{body{background:#fff;padding:8px}header{position:static;background:#fff;color:#000}aside{display:none}.container{max-width:none;padding:0}article{margin-top:0}article #content{border:0;background:#fff;padding:15px 0 0}article #content .title{margin-top:0;padding-top:0}.method-info,.method-info .pointy-thing{background:#fff}}.xcode header,.xcode aside{display:none}.xcode .container{padding:0}.xcode article{margin-top:0}.xcode article #content{border:0;margin:0}.xcode .section-method.hide .method-info,.xcode .section-method.hide.animating .method-info,.xcode .section-method.animating .method-info{height:auto!important;overflow:visible;display:block}.xcode .section-method.hide .method-title{margin-left:-15px} 2 | /*# sourceMappingURL=to.css.map */ -------------------------------------------------------------------------------- /docs/html/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSDurexKit Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 36 | 37 |
38 |
39 |
40 |
41 |

MLSDurexKit Hierarchy

42 | 43 | 44 |
45 |

Class Hierarchy

46 | 47 | 60 | 61 |
62 | 63 | 64 | 65 |
66 | 67 | 68 |

Constant References

69 | 74 | 75 | 76 |

Category References

77 | 102 | 103 |
104 | 105 | 106 |
107 | 115 |
116 |
117 |
118 |
119 |
120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/html/img/button_bar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSDurexKit/ffd382d5648976cd6e3ae35d994615fd3d1f4b6e/docs/html/img/button_bar_background.png -------------------------------------------------------------------------------- /docs/html/img/disclosure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSDurexKit/ffd382d5648976cd6e3ae35d994615fd3d1f4b6e/docs/html/img/disclosure.png -------------------------------------------------------------------------------- /docs/html/img/disclosure_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSDurexKit/ffd382d5648976cd6e3ae35d994615fd3d1f4b6e/docs/html/img/disclosure_open.png -------------------------------------------------------------------------------- /docs/html/img/library_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSDurexKit/ffd382d5648976cd6e3ae35d994615fd3d1f4b6e/docs/html/img/library_background.png -------------------------------------------------------------------------------- /docs/html/img/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSDurexKit/ffd382d5648976cd6e3ae35d994615fd3d1f4b6e/docs/html/img/title_background.png -------------------------------------------------------------------------------- /docs/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSDurexKit Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSDurexKit 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 36 | 37 |
38 |
39 |
40 |
41 |

MLSDurexKit Reference

42 | 43 | 44 | 45 |
46 | 47 | 48 | 49 |
50 |

Class References

51 | 58 |
59 | 60 | 61 | 62 |
63 | 64 | 65 | 66 |

Constant References

67 | 72 | 73 | 74 | 75 |

Category References

76 | 101 | 102 |
103 | 104 |
105 | 106 |
107 | 115 |
116 |
117 |
118 |
119 |
120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/html/js/script.js: -------------------------------------------------------------------------------- 1 | function $() { 2 | return document.querySelector.apply(document, arguments); 3 | } 4 | 5 | if (navigator.userAgent.indexOf("Xcode") != -1) { 6 | document.documentElement.classList.add("xcode"); 7 | } 8 | 9 | var jumpTo = $("#jump-to"); 10 | 11 | if (jumpTo) { 12 | jumpTo.addEventListener("change", function(e) { 13 | location.hash = this.options[this.selectedIndex].value; 14 | }); 15 | } 16 | 17 | function hashChanged() { 18 | if (/^#\/\/api\//.test(location.hash)) { 19 | var element = document.querySelector("a[name='" + location.hash.substring(1) + "']"); 20 | 21 | if (!element) { 22 | return; 23 | } 24 | 25 | element = element.parentNode; 26 | 27 | element.classList.remove("hide"); 28 | fixScrollPosition(element); 29 | } 30 | } 31 | 32 | function fixScrollPosition(element) { 33 | var scrollTop = element.offsetTop - 150; 34 | document.documentElement.scrollTop = scrollTop; 35 | document.body.scrollTop = scrollTop; 36 | } 37 | 38 | [].forEach.call(document.querySelectorAll(".section-method"), function(element) { 39 | element.classList.add("hide"); 40 | 41 | element.querySelector(".method-title a").addEventListener("click", function(e) { 42 | var info = element.querySelector(".method-info"), 43 | infoContainer = element.querySelector(".method-info-container"); 44 | 45 | element.classList.add("animating"); 46 | info.style.height = (infoContainer.clientHeight + 40) + "px"; 47 | fixScrollPosition(element); 48 | element.classList.toggle("hide"); 49 | 50 | setTimeout(function() { 51 | element.classList.remove("animating"); 52 | info.style.height = "auto"; 53 | }, 300); 54 | }); 55 | }); 56 | 57 | window.addEventListener("hashchange", hashChanged); 58 | hashChanged(); 59 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSArray+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSArray(SafeKit) Category Reference 2 | 3 |   **Declared in** NSArray+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSDictionary+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSDictionary(SafeKit) Category Reference 2 | 3 |   **Declared in** NSDictionary+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSException+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSException(SafeKit) Category Reference 2 | 3 |   **Declared in** NSException+SafeKit.h 4 | 5 | ## Tasks 6 | 7 | ### 8 | 9 | [– printStackTrace](#//api/name/printStackTrace) 10 | 11 | [– printStackTrace:](#//api/name/printStackTrace:) 12 | 13 | 14 | ## Instance Methods 15 | 16 | 17 | ### printStackTrace 18 | 19 | `- (void)printStackTrace` 20 | 21 | 22 | ### printStackTrace: 23 | 24 | `- (void)printStackTrace:(NSString *)*reasonStr*` 25 | 26 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSMutableArray+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSMutableArray(SafeKit) Category Reference 2 | 3 |   **Declared in** NSMutableArray+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSMutableArray+SafeKitMRC.md: -------------------------------------------------------------------------------- 1 | # NSMutableArray(SafeKitMRC) Category Reference 2 | 3 |   **Declared in** NSMutableArray+SafeKitMRC.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSMutableDictionary+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSMutableDictionary(SafeKit) Category Reference 2 | 3 |   **Declared in** NSMutableDictionary+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSMutableString+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSMutableString(SafeKit) Category Reference 2 | 3 |   **Declared in** NSMutableString+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSObject+SafeKit_KVO.md: -------------------------------------------------------------------------------- 1 | # NSObject(SafeKit_KVO) Category Reference 2 | 3 |   **Declared in** NSObject+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSObject+SafeKit_Perform.md: -------------------------------------------------------------------------------- 1 | # NSObject(SafeKit_Perform) Category Reference 2 | 3 |   **Declared in** NSObject+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSObject+Swizzle.md: -------------------------------------------------------------------------------- 1 | # NSObject(Swizzle) Category Reference 2 | 3 |   **Declared in** NSObject+Swizzle.h 4 | 5 | ## Tasks 6 | 7 | ### 8 | 9 | [+ safe_swizzleMethod:tarSel:](#//api/name/safe_swizzleMethod:tarSel:) 10 | 11 | [+ safe_swizzleMethod:tarClass:tarSel:](#//api/name/safe_swizzleMethod:tarClass:tarSel:) 12 | 13 | [+ safe_swizzleMethod:srcSel:tarClass:tarSel:](#//api/name/safe_swizzleMethod:srcSel:tarClass:tarSel:) 14 | 15 | 16 | ## Class Methods 17 | 18 | 19 | ### safe_swizzleMethod:srcSel:tarClass:tarSel: 20 | 21 | `+ (void)safe_swizzleMethod:(Class)*srcClass* srcSel:(SEL)*srcSel* tarClass:(Class)*tarClass* tarSel:(SEL)*tarSel*` 22 | 23 | 24 | ### safe_swizzleMethod:tarClass:tarSel: 25 | 26 | `+ (void)safe_swizzleMethod:(SEL)*srcSel* tarClass:(NSString *)*tarClassName* tarSel:(SEL)*tarSel*` 27 | 28 | 29 | ### safe_swizzleMethod:tarSel: 30 | 31 | `+ (void)safe_swizzleMethod:(SEL)*srcSel* tarSel:(SEL)*tarSel*` 32 | 33 | -------------------------------------------------------------------------------- /docs/markdown/Categories/NSString+SafeKit.md: -------------------------------------------------------------------------------- 1 | # NSString(SafeKit) Category Reference 2 | 3 |   **Declared in** NSString+SafeKit.h 4 | 5 | -------------------------------------------------------------------------------- /docs/markdown/Classes/SafeKitLog.md: -------------------------------------------------------------------------------- 1 | # SafeKitLog Class Reference 2 | 3 |   **Inherits from** NSObject 4 |   **Declared in** SafeKitLog.h 5 | 6 | ## Tasks 7 | 8 | ### 9 | 10 | [  printer](#//api/name/printer) *property* 11 | 12 | [– initWithPrinter:](#//api/name/initWithPrinter:) 13 | 14 | [– log:](#//api/name/log:) 15 | 16 | [– logInfo:](#//api/name/logInfo:) 17 | 18 | [– logWarning:](#//api/name/logWarning:) 19 | 20 | [– logError:](#//api/name/logError:) 21 | 22 | [+ shareInstance](#//api/name/shareInstance) 23 | 24 | ## Properties 25 | 26 | 27 | ### printer 28 | 29 | `@property (nonatomic, strong) SafeKitPrinter *printer` 30 | 31 | 32 | ## Class Methods 33 | 34 | 35 | ### shareInstance 36 | 37 | `+ (SafeKitLog *)shareInstance` 38 | 39 | 40 | ## Instance Methods 41 | 42 | 43 | ### initWithPrinter: 44 | 45 | `- (id)initWithPrinter:(SafeKitPrinter *)*printer*` 46 | 47 | 48 | ### log: 49 | 50 | `- (void)log:(NSString *)*aString*` 51 | 52 | 53 | ### logError: 54 | 55 | `- (void)logError:(NSString *)*aString*` 56 | 57 | 58 | ### logInfo: 59 | 60 | `- (void)logInfo:(NSString *)*aString*` 61 | 62 | 63 | ### logWarning: 64 | 65 | `- (void)logWarning:(NSString *)*aString*` 66 | 67 | -------------------------------------------------------------------------------- /docs/markdown/Classes/SafeKitPrinter.md: -------------------------------------------------------------------------------- 1 | # SafeKitPrinter Class Reference 2 | 3 |   **Inherits from** NSObject 4 |   **Declared in** SafeKitLog.h 5 | 6 | ## Tasks 7 | 8 | ### 9 | 10 | [– print:](#//api/name/print:) 11 | 12 | 13 | ## Instance Methods 14 | 15 | 16 | ### print: 17 | 18 | `- (void)print:(NSString *)*aString*` 19 | 20 | -------------------------------------------------------------------------------- /docs/markdown/Constants/SafeKitObjectPerformExceptionCatch.md: -------------------------------------------------------------------------------- 1 | # SafeKitObjectPerformExceptionCatch Constants Reference 2 | 3 |   **Declared in** SafeKitConfig.h 4 | 5 | ### SafeKitObjectPerformExceptionCatch 6 | 7 | #### Definition 8 | typedef NS_ENUM(NSInteger, SafeKitObjectPerformExceptionCatch ) { 9 | 10 | SafeKitObjectPerformExceptionCatchOn, 11 | 12 | SafeKitObjectPerformExceptionCatchOff, 13 | 14 | }; 15 | 16 | #### Constants 17 | 18 | SafeKitObjectPerformExceptionCatchOn 19 | 20 |    Declared In `SafeKitConfig.h`. 21 | 22 | SafeKitObjectPerformExceptionCatchOff 23 | 24 |    Declared In `SafeKitConfig.h`. 25 | 26 | --------------------------------------------------------------------------------