Skip to content

Instantly share code, notes, and snippets.

View OOXXXX's full-sized avatar
🎯
Focusing

Patrick OOXXXX

🎯
Focusing
View GitHub Profile
@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
@OOXXXX
OOXXXX / index.html
Created February 29, 2020 05:27
Night & Day
<div class="layout">
<div class="day-label">Day</div>
<label class="container">
<input id="input" type="checkbox" checked="checked">
<span class="checkmark">
<svg id="toggle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 34" width="60" height="34">
<defs>
@Harry-Harrison
Harry-Harrison / ContentView.swift
Last active July 11, 2023 10:42
Haptic Feedback Vibrations in SwiftUI
// This prints a list of buttons that on tap will fire a different type of haptic vibration
import SwiftUI
struct ContentView: View {
let generator = UINotificationFeedbackGenerator()
var body: some View {
VStack(alignment: .center, spacing: 30.0) {
Button(action: {