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
#define MAC_PLATFORM (TARGET_OS_MAC && !TARGET_OS_IPHONE) | |
#define IOS_PLATFORM (TARGET_OS_MAC && TARGET_OS_IPHONE) | |
#define IOS_DEVICE (IOS_PLATFORM && TARGET_OS_EMBEDDED) | |
#define IOS_SIMULATOR (IOS_PLATFORM && TARGET_IPHONE_SIMULATOR) |
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
+ (instancetype)sharedInstance { | |
static dispatch_once_t onceToken; | |
static id sharedInstance; | |
dispatch_once(&onceToken, ^{ | |
sharedInstance = [[self alloc] init]; | |
}); | |
return sharedInstance; | |
} |
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
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock | |
defaults delete com.apple.Dock autohide-delay && killall Dock |
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
# Xcode | |
.DS_Store | |
xcuserdata | |
*.xccheckout |
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
-com.apple.CoreData.ConcurrencyDebug 1 | |
-com.apple.CoreData.SQLDebug 3 | |
-com.apple.CoreData.SQLDebug 2 | |
-com.apple.CoreData.SQLDebug 1 | |
-com.apple.CoreData.SyntaxColoredLogging YES | |
-com.apple.CoreData.MigrationDebug |
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
func foo(x:UnsafeMutablePointer<Void>) -> UnsafeMutablePointer<Void> { | |
print("Hello World") | |
return nil | |
} | |
let thread:UnsafeMutablePointer<pthread_t> = nil | |
// | |
pthread_create(thread, nil, foo, nil) | |
pthread_join(thread.memory, nil) |
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
var chars:[Int8] = Array(count:128, repeatedValue:0) | |
let error = pthread_getname_np(pthread, &chars, chars.count) | |
assert(error == 0, "Could not retrieve thread name") | |
let characters = chars.filter { $0 != 0 }.map { UInt8($0) }.map(UnicodeScalar.init).map(Character.init) | |
let name = String(characters) |
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
protocol Foo { | |
var title:String { get } | |
func rant(value:Int) -> String | |
} | |
let bar = @mock(Foo) | |
bar.rant = { value in | |
fail(value != 13) | |
return "mocked" |
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
public protocol Command { | |
associatedtype Input | |
associatedtype Output | |
func execute(input:Input) -> Output | |
} | |
public final class Signal<Input, Output> : Command { | |
private let block:(Input) -> Output |
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
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator | |
VALID_ARCHS[sdk=iphone*] = arm64 armv7 armv7s | |
VALID_ARCHS[sdk=macosx*] = i386 x86_64 | |
LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = @executable_path/Frameworks @loader_path/Frameworks | |
LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = @executable_path/Frameworks @loader_path/Frameworks | |
LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = @executable_path/Frameworks @loader_path/Frameworks | |
LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = @executable_path/../Frameworks @loader_path/Frameworks |
OlderNewer