forked from Xcode-Snippets/Objective-C
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converting snippets into new format with YAML front-matter
- Loading branch information
Showing
31 changed files
with
172 additions
and
187 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Documents Directory Path | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Function or Method | ||
--- | ||
title: "Documents Directory Path" | ||
completion-scope: Function or Method | ||
--- | ||
|
||
NSURL *documentsDirectoryURL = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]]; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// ImageView | ||
// Create & Initialize UIImageView with Named Image | ||
// | ||
// Platform: iOS | ||
// Language: Objective-C | ||
// Completion Scope: Code Expression | ||
--- | ||
title: "ImageView" | ||
summary: "Create & Initialize UIImageView with Named Image" | ||
platform: iOS | ||
completion-scope: Code Expression | ||
--- | ||
|
||
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"<#image name#>"]] |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Library Directory Path | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Function or Method | ||
--- | ||
title: "Library Directory Path" | ||
completion-scope: Function or Method | ||
--- | ||
|
||
[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) firstObject]; |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// #pragma Mark | ||
// Dividers and labels to organize your code into sections | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scopes: Top Level, Class Implementation, Class Interface Methods | ||
--- | ||
title: "#pragma Mark" | ||
summary: "Dividers and labels to organize your code into sections" | ||
completion-scopes: | ||
- Top Level | ||
- Class Implementation | ||
- Class Interface Methods | ||
--- | ||
|
||
#pragma mark - <#Section#> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// NSLocalizedString | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Code Expression | ||
--- | ||
title: "NSLocalizedString" | ||
completion-scope: Code Expression | ||
--- | ||
|
||
NSLocalizedString(@"<#Message#>", <#Comment#>) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
// Shared Singleton | ||
// Class method that returns a singleton instance | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Class Implementation | ||
--- | ||
title: "Shared Singleton" | ||
summary: "Class method that returns a singleton instance" | ||
completion-scope: Class Implementation | ||
--- | ||
|
||
+ (instancetype)shared<#name#> { | ||
static <#class#> *_shared<#name#> = nil; | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
_shared<#name#> = <#initializer#>; | ||
}); | ||
|
||
return _shared<#name#>; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Log Stack Trace | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Function or Method | ||
--- | ||
title: "Log Stack Trace" | ||
completion-scope: Function or Method | ||
--- | ||
|
||
NSLog(@"Call Stack: %@", [NSThread callStackSymbols]); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// __strong self | ||
// Declare strong reference to weak reference | ||
// | ||
// Platform: All | ||
// Language: Objective-C | ||
// Completion Scope: Function or Method | ||
--- | ||
title: "__strong self" | ||
summary: "Declare strong reference to weak reference" | ||
completion-scope: Function or Method | ||
--- | ||
|
||
__strong __typeof(<#weakSelf#>)strongSelf = <#weakSelf#>; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// UIControlEventTouchUpInside | ||
// | ||
// Platform: iOS | ||
// Language: Objective-C | ||
// Completion Scope: Code Expression | ||
--- | ||
title: "UIControlEventTouchUpInside" | ||
platform: iOS | ||
completion-scope: Code Expression | ||
--- | ||
|
||
UIControlEventTouchUpInside |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// UITableViewDelegate | ||
// Placeholders for required UITableViewDelegate protocol methods | ||
// | ||
// Platform: iOS | ||
// Language: Objective-C | ||
// Completion Scope: Class Implementation | ||
--- | ||
title: "UITableViewDelegate" | ||
summary: "Placeholders for required UITableViewDelegate protocol methods" | ||
platform: iOS | ||
completion-scope: Class Implementation | ||
--- | ||
|
||
#pragma mark - UITableViewDelegate | ||
|
||
- (void)tableView:(UITableView *)tableView | ||
didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
- (void)tableView:(UITableView *)tableView | ||
didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
<#statements#> | ||
} |
Oops, something went wrong.