📌 For AI/Cursor Context:
- Project Type: Swift iOS app using Clean Architecture
- Package Manager: Swift Package Manager (SPM) - MANDATORY for all features
- Required External Dependencies: AugmentedSUICoordinator and Resolver - MUST be added as SPM dependencies
- Critical Rule: Every component (Screen, Repository, UseCase) MUST be an SPM package with
Package.swift- Dependency Rule: Dependencies point inward only (Presentation → UseCase → Repository → Data)
- Quick Start: See 🚀 Quick Start section below
- SPM Templates: See 📦 Package Templates section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol CancelableTask: Sendable { | |
| var hashValue: Int { get } | |
| func cancel() | |
| } | |
| extension Task: CancelableTask {} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let hashTable = NSHashTable<NSMutableData>(options: .copyIn) | |
| var str: NSMutableData? = NSMutableData.init() | |
| hashTable.add(str) | |
| str = nil | |
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let hashTable = NSHashTable<NSString>.weakObjects() | |
| var str: NSMutableString? = NSMutableString.init(string: "dasdasdas") | |
| hashTable.add(str) | |
| str = nil | |
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Test: NSObject { | |
| deinit { | |
| print("deinit") | |
| } | |
| } | |
| let tests = NSHashTable<Test>.weakObjects() | |
| var test: Test? = Test() | |
| tests.add(test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class Test { | |
| deinit { | |
| print("Deinited") | |
| } | |
| } | |
| let hashTable: NSHashTable<Test> = .weakObjects() | |
| var optionalInstance: Test? = Test() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import Combine | |
| protocol UIControlPublishable: UIControl {} | |
| extension UIControlPublishable { | |
| func publisher(for event: UIControl.Event) -> UIControl.InteractionPublisher<Self> { | |
| return InteractionPublisher(control: self, event: event) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) | |
| extension Publisher where Self.Failure == Never { | |
| func assign(to failablePublished: CurrentValuePublished<Self.Output,Self.Failure>) -> AnyCancellable { | |
| self.assign(to: \.wrappedValue, on: failablePublished) | |
| } | |
| } | |
| @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| infix operator ->>: DefaultPrecedence | |
| public protocol Castable { | |
| func forceCast<U>(to type: U.Type) -> U | |
| func AS<U>(to type: U.Type) -> U? |
NewerOlder