Skip to content

Instantly share code, notes, and snippets.

View atrinh0's full-sized avatar
🐾

An Huggins atrinh0

🐾
View GitHub Profile
@dduan
dduan / SwiftChartPong.swift
Last active January 19, 2024 13:51
Pong Game implemented with Swift Charts.
import SwiftUI
import Charts
import Combine
import Foundation
final class GameState: ObservableObject {
struct Player {
var position: Int
var halfSize: Int = 150
@PimCoumans
PimCoumans / AnimationSequece.swift
Last active January 17, 2024 09:32
Simple way to chain and group multiple UIView animations
import UIKit
protocol StepAnimatable {
/// Start a sequence where you add each step in the `addSteps` closure. Use the provided `AnimationSequence` object
/// to add each step which should either be an actual animation or a delay.
/// The `completion` closure is executed when the last animation has finished.
/// - Parameters:
/// - addSteps: Closure used to add steps to the provided `AnimationSequence` object
/// - completion: Executed when the last animation has finished.
import SwiftUI
let width : CGFloat = 82.0
let height : CGFloat = 82.0
struct ContentView: View {
@State private var toggle = false
var body: some View {
VStack {
Spacer()
ZStack {
Image(systemName: "heart.fill")
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

//
// ContentView.swift
// HelloStartupAnimation
//
// Created by Apple Design Dev on 1/26/22.
//
import SwiftUI
import PureSwiftUI
// A URLSession extension that fetches data from a URL and decodes to some Decodable type.
// Usage: let user = try await URLSession.shared.decode(UserData.self, from: someURL)
// Note: this requires Swift 5.5.
extension URLSession {
func decode<T: Decodable>(
_ type: T.Type = T.self,
from url: URL,
keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys,
dataDecodingStrategy: JSONDecoder.DataDecodingStrategy = .deferredToData,
dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active January 29, 2024 18:18
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), 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_
- [ ] iCloud Sync
- [ ] Focus Filter Support