Skip to content

Instantly share code, notes, and snippets.

@nteissler
nteissler / Day16.swift
Created June 4, 2024 16:17
An demo of preferredCompactColumn
import SwiftUI
struct Day16: View {
@State private var sidebarSelection: Int?
@State private var path = NavigationPath()
/// Acts as a floor on what column is on top when collapsed
@State private var topColumn: NavigationSplitViewColumn = .content
@State private var vis: NavigationSplitViewVisibility = .all
var body: some View {
@nteissler
nteissler / Day8.swift
Created May 28, 2024 04:22
Day 8 of 21 Days of SwiftUI Navigation on Mastodon
import SwiftUI
struct Day8: View {
@State private var path: [String] = []
@State var presentedItem: Int? = nil
var body: some View {
NavigationStack(path: $path) {
List {
NavigationLink("Value-destination Link", value: "Hello")
@nteissler
nteissler / tmux.md
Created February 8, 2021 16:44 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@nteissler
nteissler / Patterns.swift
Last active August 24, 2018 05:41
Pro Pattern Matching
import UIKit
// Swift 4.2 Xcode 10
//: ## Optional Patterns
func aLegacyObjcFunction() -> String! {
return "I wasn't annotated with modern objc conventions!"
}
func myFunction() -> String {