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 |
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 |
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 |
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 { |
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 |
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") |
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 ThirdPartyDemoView: View { | |
@State private var shouldAdd = true | |
@State private var currentValue = 0 | |
var body: some View { | |
ThirdPartyReader { proxy in | |
Text("\(currentValue)") | |
ThirdPartyView(shouldAdd: shouldAdd) | |
.viewChangedValueTo { view, newValue in | |
currentValue = newValue |