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
import AppKit | |
let menubar = NSMenu() | |
let appMenuItem = NSMenuItem() | |
menubar.addItem(appMenuItem) | |
let appMenu = NSMenu() | |
let quitMenuItem = NSMenuItem(title:"Quit Cocoa", action:#selector(NSApplication.terminate), keyEquivalent:"q") | |
appMenu.addItem(quitMenuItem) | |
appMenuItem.submenu = appMenu |
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
let a = "AVERY" | |
let b = "GARVEY" | |
let foo = Array(a.characters) | |
let bar = Array(b.characters) | |
print("\(a) --> \(b)\n") | |
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
internal struct DirectionalSequence<Elements : CollectionType where Elements.Index : Strideable> { | |
private let elements:Elements | |
private var reversed:Bool | |
// MARK: - | |
internal init(_ elements:Elements, reversed:Bool) { | |
(self.elements, self.reversed) = (elements, reversed) |
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 struct Urn { | |
public enum Namespace : String { | |
case SoundCloud = "soundcloud" | |
} | |
public enum Collection : String { | |
case Playlists = "playlists" | |
case Tracks = "tracks" |
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 |
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
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
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
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
-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 |
NewerOlder