Skip to content

Instantly share code, notes, and snippets.

@frankfka
frankfka / MacDevSetup.md
Last active March 23, 2026 22:48
My Application Stack for MacOS Setup

Environment Setup

  • Finder
    • View -> Show all the bars
    • Preferences -> play around
  • xCode & command line tools
  • Homebrew
  • NVM
  • Yarn (npm install -g yarn) & Bun
  • Python (Pyenv)
  • Install virtualenv plugin
@frankfka
frankfka / iOSMultiSegmentPickerSwiftUI.swift
Created July 14, 2020 15:01
Multi-Segment Picker in SwiftUI
import SwiftUI
import PlaygroundSupport
struct MultiSegmentPickerViewModel {
typealias Label = String
typealias Selection = Binding<Int>
typealias PickerDisplayValues = [String]
let segments: [(Label, Selection, PickerDisplayValues)]
}
@frankfka
frankfka / iOSCustomSegmentedControlSwiftUI.swift
Created May 17, 2020 16:47
Custom Segmented Picker / Segmented Control in SwiftUI
import SwiftUI
extension View {
func eraseToAnyView() -> AnyView {
AnyView(self)
}
}
struct SizePreferenceKey: PreferenceKey {
typealias Value = CGSize
@frankfka
frankfka / iOSActivityRingSwiftUI.swift
Created April 29, 2020 05:22
iOS Activity Ring in SwiftUI
import SwiftUI
import PlaygroundSupport
extension Double {
func toRadians() -> Double {
return self * Double.pi / 180
}
func toCGFloat() -> CGFloat {
return CGFloat(self)