用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/JohnNuwan/EVA_CORE --skill swift-ios命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | swift-ios |
| description | Développement iOS natif avec Swift — SwiftUI, UIKit, Xcode, frameworks Apple, performance, déploiement |
Développement d'applications iOS natives avec Swift, couvrant SwiftUI et UIKit, les frameworks système Apple, l'optimisation des performances, et le déploiement sur l'App Store.
// Protocol-oriented programming
protocol Repository {
associatedtype T
func fetch(id: String) async throws -> T
func save(_ item: T) async throws
}
// Value semantics avec structs
struct User: Identifiable, Codable {
let id: UUID
var name: String
var email: String
var createdAt: Date
}
// Result builders pour DSL
@resultBuilder
struct ViewBuilder {
static func buildBlock<Content: View>(_ content: Content) -> Content
}
@MainActorwithCheckedContinuation, withUnsafeContinuation@Published, @State, @Binding, @Environment, @AppStorageJSONEncoder.KeyEncodingStrategy@Observable, #Predicate, macros customsome), any existential@Observable
final class AppViewModel {
var users: [User] = []
var isLoading = false
@MainActor
func loadUsers() async {
isLoading = true
defer { isLoading = false }
users = try await api.fetchUsers()
}
}
struct UserListView: View {
@State private var viewModel = AppViewModel()
var body: some View {
List(viewModel.users) { user in
UserRow(user: user)
}
.task { await viewModel.loadUsers() }
.refreshable { await viewModel.loadUsers() }
.overlay {
if viewModel.isLoading { ProgressView() }
}
}
}
.navigationDestination| Pattern | Usage | Scope |
|---|---|---|
@State | Valeurs locales | View |
@Binding | Two-way binding | Parent → Child |
@Observable (iOS 17+) | Observable object | ViewModel |
@Environment | Valeurs partagées | App tree |
@AppStorage | UserDefaults | Persistence |
| SwiftData / CoreData | Persistance | Model layer |
.withAnimation — animation explicite.animation — value-based animationmatchedGeometryEffect — transitions fluidesPhaseAnimator (iOS 17+) — animations séquencéesKeyframeAnimator (iOS 17+) — animations keyframeAnyTransition.asymmetricstruct MapView: UIViewRepresentable {
let coordinate: CLLocationCoordinate2D
func makeUIView(context: Context) -> MKMapView {
MKMapView()
}
func updateUIView(_ uiView: MKMapView, context: Context) {
uiView.setRegion(MKCoordinateRegion(center: coordinate, span: .init(latitudeDelta: 0.05, longitudeDelta: 0.05)), animated: true)
}
}
UIViewControllerTransitioningDelegateURLSessionConfiguration.background, cachingURLSessionWebSocketTaskSecItemAdd, SecItemCopyMatching.xcstrings.leading/.trailing au lieu de .left/.right| Framework | Usage |
|---|---|
| CoreLocation | GPS, geofencing, CLMonitor |
| MapKit | Cartes, annotations, routage |
| CloudKit | Sync iCloud, CKContainer |
| NotificationCenter | Notifications locales/push |
| CoreBluetooth | BLE central/peripheral |
| HealthKit | Santé, HKWorkout, HKSample |
| AVFoundation | Audio, vidéo, capture |
| Vision | Détection faciale, OCR, tracking |
| CoreML | ML on-device, .mlpackage |
| WidgetKit | Widgets, Live Activities |
| StoreKit | In-app purchases, subscriptions |
| WeatherKit | Données météo (iOS 16+) |
| Accelerate | DSP, vectorisation, BNNS |
| Metal | GPU compute, shaders |
# xcodebuild ligne de commande
xcodebuild -project App.xcodeproj -scheme App -destination 'platform=iOS Simulator,name=iPhone 16 Pro' test
# Build avec code signing
xcodebuild -workspace App.xcworkspace -scheme App archive -archivePath build/App.xcarchive
# Export IPA
xcodebuild -exportArchive -archivePath build/App.xcarchive -exportPath build/ -exportOptionsPlist ExportOptions.plist
// Package.swift
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.10.0"),
.package(url: "https://github.com/onevcat/Kingfisher", from: "8.0.0")
]
[weak self] dans les closuresEquatableView, @ViewBuilder lazyURLCacheCGSize caching, GeometryReader minimalBGTaskScheduler pour les tâches différées-dead_strip, Swift compiler optimizationsfinal class UserViewModelTests: XCTestCase {
var sut: UserViewModel!
var mockAPI: MockAPIClient!
override func setUp() {
mockAPI = MockAPIClient()
sut = UserViewModel(api: mockAPI)
}
func testLoadUsersSuccess() async throws {
mockAPI.stub(.fetchUsers, return: [.mock])
await sut.loadUsers()
XCTAssertEqual(sut.users.count, 1)
XCTAssertFalse(sut.isLoading)
}
}
func testLoginFlow() {
let app = XCUIApplication()
app.launch()
let emailField = app.textFields["email"]
emailField.tap()
emailField.typeText("user@example.com")
app.buttons["Connexion"].tap()
XCTAssertTrue(app.staticTexts["Dashboard"].waitForExistence(timeout: 5))
}
assertSnapshot(of: view, as: .image)lane :deploy do
match(type: "appstore")
build_app(
scheme: "App",
export_method: "app-store"
)
upload_to_app_store(
skip_metadata: true,
skip_screenshots: true
)
end
- name: Build & Test
run: |
xcodebuild test \
-scheme App \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
-resultBundlePath TestResults.xcresult
security import@MainActor sur les mises à jour UI → crash[weak self] → leakForEach sans .id → animations casséesBGTaskScheduler 30s max#available(iOS 17, *)