Skip to content

Instantly share code, notes, and snippets.

View atrinh0's full-sized avatar
🐾

An Huggins atrinh0

🐾
View GitHub Profile
@atrinh0
atrinh0 / checklist.md
Last active September 23, 2021 16:06 — forked from DreamingInBinary/Best in Class iOS Checklist
Best in Class iOS Checklist 🧐

A Best in Class Checklist

A boiled down checklist adapted from this post, created by @jordanmorgan10.

To use this, create a Github Issue in your own repo, and simply copy and paste this text.

iOS Core Technology

Things any iOS app can benefit from

@atrinh0
atrinh0 / underdogdev_combine.swift
Last active April 25, 2021 17:21
Combine walkthrough
import Foundation
import Combine
import UIKit
import PlaygroundSupport
struct Image: Decodable {
let url: String
}
let stackView = UIStackView(frame: CGRect(x: 0, y: 0, width: 200, height: 600))
@atrinh0
atrinh0 / alignment_guides.swift
Last active June 10, 2021 09:40
SwiftUI Alignment Guides (aligning vertical to horizontal)
import SwiftUI
extension VerticalAlignment {
struct VertAlignName: AlignmentID {
static func defaultValue(in d: ViewDimensions) -> CGFloat {
d[.top]
}
}
static let vertAlignName = VerticalAlignment(VertAlignName.self)
}
@atrinh0
atrinh0 / pluraliser.swift
Last active June 10, 2021 09:40
Pluraliser
import SwiftUI
struct ContentView: View {
let animals = ["bear",
"buffalo",
"cow",
"fish",
"fox",
"goose",
"ox",
@atrinh0
atrinh0 / pluraliser_issues.swift
Last active June 1, 2024 20:38
Foundation Pluraliser Potential Issues
import SwiftUI
struct ContentView: View {
// sample of data was compiled using the following sources:
// https://birdgei.com/2011/08/30/list-of-100-irregular-plural-nouns-in-english/
// https://www.grammarly.com/blog/plural-nouns/
// https://www.thoughtco.com/irregular-plural-nouns-in-english-1692634
// https://www.ef.co.uk/english-resources/english-grammar/singular-and-plural-nouns/
// google
@atrinh0
atrinh0 / picker_menu.swift
Created June 27, 2021 17:44
Picker Menu Style Label Issue
import SwiftUI
struct ContentView: View {
let options: [String] = ["ascending", "descending", "highest", "lowest"]
@State private var selectedOption = "ascending"
var body: some View {
NavigationView {
VStack {
Text("Image label")
@atrinh0
atrinh0 / flag_quiz.swift
Created August 14, 2021 13:57
Flag Quiz Concept
import SwiftUI
struct ContentView: View {
var body: some View {
VStack(alignment: .leading) {
HStack {
Image(systemName: "xmark")
.font(Font.title.weight(.bold))
.foregroundColor(.gray)
ZStack(alignment: .leading) {
@atrinh0
atrinh0 / heatmap_issue.swift
Last active August 13, 2022 14:16
Swift Charts - Heat Map compilation issue
import SwiftUI
import Charts
struct ContentView: View {
@State private var grid = Grid(numRows: 10, numCols: 10)
var body: some View {
if #available(iOS 16.0, *) {
VStack {
Spacer()
@atrinh0
atrinh0 / chart_scroll_issue.swift
Last active September 19, 2022 14:36
Swift Charts - Scrolling performance
import SwiftUI
import Charts
@available(iOS 16.0, *)
struct ContentView: View {
@State private var selection: HashableItem?
var body: some View {
// MARK: - 1. Baseline performance test
// Scrolling is smooth, CPU averages around 10% when scrolling
@atrinh0
atrinh0 / chart_opacity_glitch.swift
Created June 18, 2022 15:01
Swift Chart - Foreground style negative opacity glitch
import SwiftUI
import Charts
@available(iOS 16.0, *)
struct ContentView: View {
@State private var opacity = -0.5
var body: some View {
VStack {
Chart(SalesData.last30Days, id: \.day) {