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
| PHFetchResult *result = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum | |
| subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary | |
| options:nil]; | |
| PHAssetCollection *assetCollection = result.firstObject; | |
| NSLog(@"%@", assetCollection.localizedTitle); | |
| // Camera Roll |
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
| CTTelephonyNetworkInfo *telephonyNetworkInfo = [[CTTelephonyNetworkInfo alloc] init]; | |
| CTCarrier *carrier = telephonyNetworkInfo.subscriberCellularProvider; | |
| NSLog(@"%@", carrier); | |
| NSLog(@"%@", telephonyNetworkInfo.currentRadioAccessTechnology); | |
| [telephonyNetworkInfo setSubscriberCellularProviderDidUpdateNotifier:^(CTCarrier *carrier) { | |
| NSLog(@"%@", carrier); | |
| }]; | |
| [[NSNotificationCenter defaultCenter] addObserverForName:CTRadioAccessTechnologyDidChangeNotification | |
| object:nil | |
| queue:[NSOperationQueue mainQueue] |
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
| CTCallCenter *callCenter = [[CTCallCenter alloc] init]; | |
| [callCenter setCallEventHandler:^(CTCall *call) { | |
| NSLog(@"%@", call.callState); | |
| NSLog(@"%@", call.callID); | |
| }]; |
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
| osascript -e 'tell application "System Events" | |
| keystroke "username" | |
| keystroke tab | |
| keystroke "password" | |
| keystroke return | |
| end tell' |
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
| # launch application | |
| tell application "TextEdit" to run |
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
| tell application "Finder" to close windows |
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
| EKEventStore *eventStore = [[EKEventStore alloc] init]; | |
| [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { | |
| [eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) { | |
| NSLog(@"%@", eventStore.sources); | |
| }]; | |
| }]; |
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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| // UINavigationBar title | |
| [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]}]; | |
| // UIBarButtonItem title | |
| [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]} | |
| forState:UIControlStateNormal]; | |
| // UITabBarItem title | |
| [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]} | |
| forState:UIControlStateNormal]; |