Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am frankfka on github.
  • I am gpvalidator (https://keybase.io/gpvalidator) on keybase.
  • I have a public key ASDyZ-vlurO2MaRi5rQriZ4pQZF55pkQRajvOxHGY-bkdwo

To claim this, I am signing this object:

@frankfka
frankfka / MacDevSetup.md
Last active December 19, 2021 07:02
My Application Stack for MacOS Setup

Environment Setup

  • Finder
    • View -> Show all the bars
    • Preferences -> play around
  • Touch bar
    • Keyboard -> Touch Bar -> persistent
  • Battery -> show percentage
  • xCode & command line tools
  • Homebrew
  • NVM & Node 16
@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)