Created
January 5, 2013 21:59
-
-
Save subdigital/4463913 to your computer and use it in GitHub Desktop.
What are your favorite Xcode Snippets? Add them in the comments.
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
// Property Nonatomic Strong | |
// Platform: All | |
// Completion Scopes: ClassInterfaceMethods | |
@property (nonatomic, strong) <# class_name #> *<# variable_name #>; |
These are some of the snippet I use with Dash, I normally use two empty spaces at the end of each snippet to avoid disambiguations
enum
typedef NS_ENUM(__type__, __name__) {
@cursor
};
ifnotkind
if (!__variable__ || ![__variable__ isKindOfClass:[__class__ class]]) {
@cursor
}
log
NSLog(@"@cursor");
errorDomain
#define __NAMEERRORDOMAIN__ @"__NAMEERRORDOMAIN__"
typedef NS_ENUM(__TYPEERRORDOMAIN__, __NAMEERRORCODE__) {
__ERROR1__,
__ERROR2__
};
s
@""
doc
//! __Description__
//! @param __param1Name__ __param1Description__
//! @return __returnDescription__
safeselfblock
__block typeof(self) blockSafeSelf = self;
These are great ideas. My favorite ones:
nss
NSString
nsf
[NSString stringWithFormat:@"<#format#>", <#values#>]
nsl
NSLocalizedString(@"<#key#>", @"<#comment#>")
Quick log (qlog)
NSLog(@"<#message#>");
Log file and method name (method):
NSLog(@"%s", __PRETTY_FUNCTION__);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
weakself