This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gist 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSURL *documentsDirectoryURL = [NSURL fileURLWithPath: | |
| [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]]; | |
| NSLog(@"%@",documentsDirectoryURL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface ViewController: UIViewController { | |
| UIView *_demoView; | |
| BOOL _gameCenterAvailable; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dispatch_group_t groupName = dispatch_group_create(); | |
| dispatch_group_enter(groupName); | |
| dispatch_group_leave(groupName); | |
| dispatch_group_notify(groupName, dispatch_get_main_queue(), ^(void){}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dates: [NSDate] | |
| var words: Set<String> | |
| var cachedData: [NSURL: NSData] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @property (nonatomic, readonly, copy) NSArray<__kindof NSURL* > *urlArray; | |
| NSURL *getOneURL = self.urlArray.lastObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @property (copy, readonly) NSArray * _Nonnull allItems; | |
| @property (nonatomic, strong, nonnull) Person *personNameA; | |
| @property (nonatomic, copy, readonly, nullable) NSString *personName; | |
| + (nullable NSString *)sayHello:(nonnull NSString *)message; | |
| - (AAPLListItem * _Nullable)itemWithName:(NSString * _Nonnull)name; | |
| - (void)takesNullableParameter:(nullable id)value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Person { | |
| var residence: Residence? //Optional default nil value | |
| } | |
| class Residence { | |
| var numberOfRooms = 1 | |
| } | |
| let jay = Person() //jay has a residence property value nil | |
| //runtime error, can't send message to nil | |
| let roomCount = john.residence!.numberOfRooms //unwrap optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @property (nonatomic, strong) NSArray <NSURL *> *demoArray; | |
| - (void)demoMethod { | |
| NSURL *url1 = [NSURL URLWithString:@"http:www.urldemo1.com"]; | |
| NSURL *url2 = [NSURL URLWithString:@"http:www.urldemo2.com"]; | |
| self.demoArray = @[url1, url2]; | |
| } |
NewerOlder