Skip to content

Instantly share code, notes, and snippets.

//
// SFSymbolImage.swift
// SFSymbolVariableValueAnimationWrong
//
// Created by Matthew Young on 12/22/22.
//
import SwiftUI
struct AnimatableVariableValueModifier: Animatable, ViewModifier {
@romyios
romyios / swiftuitext.swift
Created July 20, 2022 18:31
This is so nice! It's always a pain in the ass to do this stuff
// https://stackoverflow.com/a/72067001/1492368
struct TextFieldTest: View {
@FocusState private var emailFocused: Bool
@FocusState private var passwordFocused: Bool
@State private var username: String = ""
@State private var password: String = ""
var body: some View {
@romyios
romyios / avoidtheform.swift
Last active July 20, 2022 17:31
swiftui legos
struct ContentView: View {
var body: some View {
ZStack {
Color(uiColor: UIColor.systemGray6)
VStack {
Text("Hello")
List {
Section {
Text("G")
Text("Long item here Long item here Long item here Long item here")
@romyios
romyios / CustomCellListViewController.swift
Last active August 31, 2021 00:36
From apple's modernizing collection view
private class CustomListCell: ItemListCell {
private func defaultListContentConfiguration() -> UIListContentConfiguration { return .subtitleCell() }
private lazy var listContentView = UIListContentView(configuration: defaultListContentConfiguration())
private let categoryIconView = UIImageView()
private let categoryLabel = UILabel()
private var customViewConstraints: (categoryLabelLeading: NSLayoutConstraint,
categoryLabelTrailing: NSLayoutConstraint,
categoryIconTrailing: NSLayoutConstraint)?
@romyios
romyios / Apple_mobile_device_types.txt
Created July 14, 2020 17:20 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
@romyios
romyios / git.md
Last active June 2, 2020 17:32
list of git branches ordered by most recent commit