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
#!/bin/bash | |
# Assumes you're in the directory with the `.xcodeproj` | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
rm -rf *.xcodeproj/xcuserdata/ |
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
//: Playground - noun: a place where people can play | |
import Cocoa | |
protocol Feed { | |
var url: String {get} | |
} | |
protocol Folder { | |
typealias FeedType |
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
func foo(completion: ((String) -> Void)?) { | |
completion?("Heyo!!") | |
} | |
foo { println($0) } // prints "Heyo" | |
foo(nil) // doesn't crash |
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
@interface ClassWithLazyProperty () | |
@property (nonatomic) LazyPropertyType *lazyProperty; | |
@end | |
@implementation ClassWithLazyProperty | |
- (LazyPropertyType *)lazyProperty | |
{ | |
return _lazyProperty ?: (_lazyProperty = ({ | |
LazyPropertyType *property = [LazyPropertyType new]; | |
// setup property |