Skip to content

Instantly share code, notes, and snippets.

View wonkwh's full-sized avatar
πŸ’­
I may be slow to respond.

wonkwh wonkwh

πŸ’­
I may be slow to respond.
View GitHub Profile
@Frankacy
Frankacy / DataProviding.swift
Last active October 15, 2021 10:48
Swift data provider/presenter
//
// DataProviding.swift
// GenericsDataSource
//
// Created by Frank Courville on 2019-05-09.
// Copyright Β© 2019 iOS Coach Frank. All rights reserved.
//
import UIKit
@AliSoftware
AliSoftware / Bindings.swift
Last active August 5, 2025 14:50
Re-implementation of @binding and @State (from SwiftUI) myself to better understand it
/*:
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI
The only purpose of this code is to implement those wrappers myself
just to understand how they work internally and why they are needed,
⚠️ This is not supposed to be a reference implementation nor cover all
subtleties of the real Binding and State types.
The only purpose of this playground is to show how re-implementing
them myself has helped me understand the whole thing better
@scottmatthewman
scottmatthewman / AdaptsToSoftwareKeyboard.swift
Last active April 19, 2024 12:56
An example of using Combine to automatically adapt a SwiftUI scrollable view to accommodate an iOS onscreen keyboard
import SwiftUI
import Combine
struct AdaptsToSoftwareKeyboard: ViewModifier {
@State var currentHeight: CGFloat = 0
func body(content: Content) -> some View {
content
.padding(.bottom, currentHeight)
.edgesIgnoringSafeArea(.bottom)
struct CardHeading: View {
@State private var touchZoom: Bool = false
var body: some View {
VStack(spacing: 0) {
Image("banner")
.resizable()
.aspectRatio(contentMode: ContentMode.fill)
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: 400)
.clipped()
@danielmartin
danielmartin / BetterXcodeJumpToCounterpartSwift.org
Last active March 13, 2025 11:08
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
@longfin
longfin / writing.md
Last active October 31, 2024 05:50
μ—”μ§€λ‹ˆμ–΄λ₯Ό μœ„ν•œ κΈ€μ“°κΈ°

이 글은 Heinrich Hartmann λ‹˜μ΄ μž‘μ„±ν•˜μ‹  글을 ν•œκ΅­μ–΄λ‘œ λ²ˆμ—­ν•œ κ²ƒμž…λ‹ˆλ‹€. 원문은 https://www.heinrichhartmann.com/posts/writing/ μ—μ„œ ν™•μΈν•˜μ‹€ 수 μžˆμŠ΅λ‹ˆλ‹€.


κΈ€μ“°κΈ°λŠ” 큰 μ‘°μ§μ—μ„œ 영ν–₯λ ₯을 λ°œνœ˜ν•˜λŠ” 데 μ€‘μš”ν•©λ‹ˆλ‹€. κ²½λ ₯ μžˆλŠ” μ†Œν”„νŠΈμ›¨μ–΄ μ—”μ§€λ‹ˆμ–΄λ‘œμ„œμ˜ κΈ€μ“°κΈ°λŠ” 직무 λ²”μœ„λ₯Ό ν™•μž₯ν•˜κ³  κ²½λ ₯을 λ°œμ „μ‹œν‚€κΈ° μœ„ν•΄ νšλ“ν•΄μ•Ό ν•˜λŠ” κ°€μž₯ μ€‘μš”ν•œ κΈ°μˆ μž…λ‹ˆλ‹€.

κΈ€μ“°κΈ°λŠ” μ–΄λ ΅μŠ΅λ‹ˆλ‹€. λ§Žμ€ μ†Œν”„νŠΈμ›¨μ–΄ μ—”μ§€λ‹ˆμ–΄λ“€μ΄ 글쓰기와 μ”¨λ¦„ν•˜μ£ . 저도 개인적으둜 문학에 λŒ€ν•œ 관심이 μ—†κΈ° λ•Œλ¬Έμ— κΈ€μ“°κΈ°κ°€ μžμ—°μŠ€λŸ½μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.

-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()