Skip to content

Instantly share code, notes, and snippets.

View vml933's full-sized avatar

Mark Lin vml933

View GitHub Profile
@harryworld
harryworld / ui-rule.mdc
Created May 21, 2025 22:20
Cursor Rules for iOS app development using modern SwiftUI (iOS 17 or later)
# UI framework rules for SwiftUI
1. State Management:
- Use `@Observable` for reference types holding business logic and app state.
- Use `@Bindable` properties within @Observable classes so SwiftUI views can bind directly to them.
- Avoid `@State` for view model observation, rely on `let model: MyModel` instead.
- Pass dependencies via initialisers rather than as global singletons.
- Use `@Environment` for app-wide or large-scope states.
- `@State` is only for view-local state.
- Use `@Binding` only if necessary
@wotjd
wotjd / AsyncStream+Extension.swift
Last active August 4, 2025 06:46
some utility operators for AsyncStream inspired by RxSwift
import Foundation
extension AsyncStream {
init(
_ elementType: Element.Type = Element.self,
bufferingPolicy limit: AsyncStream<Element>.Continuation.BufferingPolicy = .unbounded,
_ build: @escaping (AsyncStream<Element>.Continuation) async -> Void
) {
self = AsyncStream(elementType, bufferingPolicy: limit) { continuation in
Task { await build(continuation) }
@iamchiwon
iamchiwon / ASAuthorizationControllerProxy.swift
Last active July 6, 2023 07:37
 Sign in with Apple + Rx
import AuthenticationServices
import RxCocoa
import RxSwift
import UIKit
@available(iOS 13.0, *)
extension ASAuthorizationController: HasDelegate {
public typealias Delegate = ASAuthorizationControllerDelegate
}
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active January 22, 2026 18:25
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active March 13, 2026 09:04
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
arm64 : 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