View gist:43738be7c848db1866fc25d9b95d93ba
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
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5322e\) \ | |
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport |
View gist:25184374c761d94c3dfe5b2185eb2647
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
call ((NSWindow *)[(NSArray *)[[NSApplication sharedApplication] windows] lastObject]).collectionBehavior = 1<<7|1<<8|1<<11 |
View fullsim
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
#!/usr/bin/env bash | |
lldb -n Simulator \ | |
-o "expr ((NSWindow *)[(NSArray *)[[NSApplication sharedApplication] windows] setValue:@(1<<7|1<<8|1<<11) forKey:@\"collectionBehavior\"]);" \ | |
-o "set set auto-confirm true" \ | |
-o quit |
View PropertyWrappers.swift
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
@propertyWrapper | |
/// Wrapper used to easily encode a `Date` to and decode a `Date` from an ISO 8601 formatted date string. | |
struct ISO8601Date: Codable { | |
var wrappedValue: Date | |
init(wrappedValue: Date) { | |
self.wrappedValue = wrappedValue | |
} | |
init(from decoder: Decoder) throws { |
View gist:990b784b661de63485670cfda32a9e10
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
struct NameDisplayView: View { | |
@State var name: String = "unknown" | |
@State var showNameChange = false | |
var body: some View { | |
VStack { | |
Text("Your name is \(name)") | |
Divider() | |
Button("Change") { | |
self.showNameChange = true |
View ContentView.swift
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
struct ContentView: View { | |
var body: some View { | |
NavigationView { | |
List { | |
NavigationLink(destination: Text("Top Level")) { | |
Text("Top Level Link") | |
} | |
NavigationLink(destination: detailView) { | |
Text("Show Sub Links") |