Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Josh Hrach JoshHrach

🏠
Working from home
View GitHub Profile
View ContentView.swift
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")
View gist:990b784b661de63485670cfda32a9e10
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
@JoshHrach
JoshHrach / PropertyWrappers.swift
Created Apr 9, 2020
Sample Property Wrappers
View PropertyWrappers.swift
@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 {
@JoshHrach
JoshHrach / fullsim
Created Nov 23, 2016 — forked from chrisfsampaio/fullsim
LLDB 'script' to enable full screen mode in the iOS Simulator
View fullsim
#!/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 gist:25184374c761d94c3dfe5b2185eb2647
call ((NSWindow *)[(NSArray *)[[NSApplication sharedApplication] windows] lastObject]).collectionBehavior = 1<<7|1<<8|1<<11
View gist:43738be7c848db1866fc25d9b95d93ba
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