home / skills / partme-ai / full-stack-skills / ios-swift

ios-swift skill

/skills/ios-swift

This skill helps you develop iOS apps with Swift by guiding view controllers, navigation, lifecycle, and component implementation.

npx playbooks add skill partme-ai/full-stack-skills --skill ios-swift

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
684 B
---
name: ios-swift
description: Provides comprehensive guidance for iOS development with Swift including view controllers, views, navigation, lifecycle, and iOS app development. Use when the user asks about iOS Swift, needs to create iOS applications, implement iOS components, or work with Swift in iOS.
license: Complete terms in LICENSE.txt
---

## When to use this skill

Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]

## How to use this skill

[待完善:根据具体工具添加使用指南]

## Best Practices

[待完善:根据具体工具添加最佳实践]

## Keywords

[待完善:根据具体工具添加关键词]

Overview

This skill provides practical, hands-on guidance for building iOS apps with Swift. It covers view controllers, views, navigation patterns, lifecycle events, and common iOS components. The guidance focuses on actionable code patterns, architecture choices, and troubleshooting tips to speed development.

How this skill works

The skill inspects common iOS development needs and offers targeted solutions: code snippets, lifecycle explanations, and navigation examples. It recommends patterns for view controller composition, state handling, and integrating UIKit and SwiftUI. It also suggests debugging steps and performance considerations for UI and networking.

When to use it

  • When starting a new iOS app or prototype with Swift
  • When implementing view controllers, custom views, or complex navigation flows
  • When migrating or integrating UIKit with SwiftUI
  • When debugging lifecycle issues, memory leaks, or layout problems
  • When optimizing UI performance, threading, or network handling

Best practices

  • Prefer small, single-responsibility view controllers and extract view logic into separate view or view-model types
  • Use Auto Layout constraints and safe areas; prefer stack views for predictable layouts
  • Adopt a clear navigation pattern (Coordinator, Router, or SwiftUI NavigationStack) to decouple navigation from view controllers
  • Manage state explicitly and choose Combine or async/await for asynchronous flows; avoid heavy work on the main thread
  • Write unit tests for view models and UI tests for critical flows; profile with Instruments for memory and CPU hotspots

Example use cases

  • Create a master-detail app with UINavigationController and custom table view cells
  • Implement a login flow with async/await networking, secure keychain storage, and error handling
  • Migrate a portion of a UIKit app to SwiftUI while sharing a view model between frameworks
  • Build a tabbed app with deep linking and state restoration across launches
  • Fix a retain cycle caused by closures capturing self in view controllers

FAQ

Should I use UIKit or SwiftUI for a new app?

Choose SwiftUI for fast UI iteration and modern APIs; pick UIKit if you need mature third-party libraries or intricate custom controls. You can mix both and migrate gradually.

How do I debug view controller lifecycle issues?

Use breakpoints and print lifecycle methods (viewDidLoad/viewWillAppear/viewDidAppear). Inspect view hierarchy in Debug View Hierarchy and watch for retained instances in Instruments to find leaks.