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
import UIKit | |
func createView(_ closure: () -> Void) -> UIView { | |
closure() | |
return UIView() | |
} | |
let exampleClosure: () -> Void = { print("Hello, World!") } | |
let exampleView = createView(exampleClosure) |
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 is intended to be dropped in a Playground. | |
import Foundation | |
let json = | |
""" | |
{ | |
"name": "Casey's Corner", | |
"menu": [ | |
{ |
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
<NSData *data> = [<NSString* string> str dataUsingEncoding: NSUTF8StringEncoding]; |
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
rm -rf <subdir-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
find . -type f |
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
if ( [<NSString *stringToSearchThrough> rangeOfString: <NSString *stringToSearchFor> | |
options: NSCaseInsensitiveSearch].location != NSNotFound ) |
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
[<NSString* string> componentsSeparatedByString: <NSString* separator>] |
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
if ( (NSNull*)<id something> != [NSNull null] ) |
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
[<UIView* otherView> convertPoint: <CGPoint pointToTranslate> fromView: <UIView* pointSuperview>] | |
or | |
[<UIView* otherView> convertRect: <CGRect rectToTranslate> fromView: <UIView* rectSuperview> ] |
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
CGRectContainsPoint(<CGRect rect>, <CGPoint point>) |
NewerOlder