Skip to content

Instantly share code, notes, and snippets.

View Rspoon3's full-sized avatar

Ricky Rspoon3

View GitHub Profile
@Rspoon3
Rspoon3 / WidthEqualiser.swift
Created December 4, 2020 21:52
Setting equal widths in swiftUI.
import SwiftUI
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {
Form{
ForEach(0..<115){ i in
Row(place: i, width: $width)
}
struct OAuthToken: Codable {
let idToken: String
let refreshToken: String
let expirationTimestamp: Double
var expirationDate: Date{
Date(timeIntervalSince1970: expirationTimestamp / 1000)
}
var isValid: Bool{
@Rspoon3
Rspoon3 / LazyVGridStutter.swift
Last active August 20, 2020 23:36
Scrolling stutters in a LazyVGrid on iOs 14, beta 5 due to the cell's context menu. If you comment it out, scrolling performance dramatically increases.
struct ContentView: View{
@State private var selection: Int? = nil
var body: some View{
NavigationView{
List{
Text("Does")
Text("Not")
Text("Matter")
Text("For")