Ios uikit

From KilimcininKorOglu/cli-tweaks · View interactive version

Ios uikit is an AI agent skill from the GitHub repository KilimcininKorOglu/cli-tweaks. Programmatic UIKit development, review and improvement: Auto Layout, table and collection views, navigation, Core Animation, networking, architecture, and 20 reference documents with production-ready patterns.

How to use this skill

Skill file

Programmatic UIKit Development

Build, review, and improve programmatic UIKit applications following production-ready patterns. All UI is built in code — no Storyboards.

Usage

/ios-uikit review     # Review existing UIKit code for issues
/ios-uikit build      # Implement new UIKit feature
/ios-uikit improve    # Modernize existing UIKit code
/ios-uikit            # Auto-detect mode from context

Operating Rules

Modes

Review Mode (`/ios-uikit review`)

  1. Read the code under review and identify which topics apply
  2. Run the Topic Router below for each relevant topic
  3. Check for retain cycles (missing weak delegates, missing [weak self])
  4. Verify Auto Layout completeness (unambiguous constraints, no warnings)
  5. Flag deprecated patterns (e.g., manual beginUpdates/endUpdates when Diffable is available)
  6. Check for missing @MainActor on UI-updating async code
  7. Flag completion handler patterns where async/await would be cleaner

Build Mode (`/ios-uikit build`)

  1. Design data flow first: identify service, view model, view controller, and view layers
  2. Structure views for composition (extracted views + child view controllers)
  3. Apply correct animation patterns (constraint-based, Core Animation, or UIView)
  4. Use protocol-delegate for sustained relationships; closures for one-shot callbacks
  5. Add proper loading/error states
  6. Include accessibility identifiers and VoiceOver support

Improve Mode (`/ios-uikit improve`)

  1. Audit current implementation against the Topic Router topics
  2. Extract large view controllers into child VCs and custom views
  3. Replace inline UI creation with factory functions
  4. Migrate legacy table/collection view data sources to Diffable where appropriate
  5. Migrate completion handlers to async/await where possible
  6. Add @MainActor annotations to ViewModel and UI-updating code
  7. Add proper error handling with Result types or throws

Topic Router

Consult the reference file for each topic relevant to the current task:

| Topic | Reference |

|------------------------|----------------------------------------|

| UITableView | references/uitableview.md |

| UICollectionView | references/uicollectionview.md |

| UINavigationController | references/uinavigationcontroller.md |

| UIScrollView | references/uiscrollview.md |

| Core Animation | references/core-animation.md |

| Core Graphics | references/core-graphics.md |

| Auto Layout Animation | references/auto-layout-animation.md |

| Communication Patterns | references/communication-patterns.md |

| Architecture Patterns | references/architecture-patterns.md |

| View Extraction | references/view-extraction.md |

| Navigation Patterns | references/navigation-patterns.md |

| Design Patterns (UI) | references/design-patterns.md |

| Networking | references/networking.md |

| Factory Functions | references/factory-patterns.md |

| Nib / XIB Patterns | references/nib-patterns.md |

| NSAttributedString | references/nsattributedstring.md |

| Gesture Recognizers | references/gesture-recognizers.md |

| Custom Controls | references/custom-controls.md |

| Currency Formatting | references/currency-formatting.md |

| Deep Linking | references/deep-linking.md |

Correctness Checklist

Hard rules — violations are always bugs:

Layout

Memory

Table / Collection Views

Threading

Child View Controllers

Animation

Networking

Quick Diagnostics

| Symptom | Likely Cause | Reference |

|---------|-------------|-----------|

| View doesn't appear | Missing translatesAutoresizingMaskIntoConstraints = false | references/view-extraction.md |

| Table view crashes on insert | Data source count mismatch with batch updates | references/uitableview.md |

| Animation snaps to final state | Model layer not updated after CA animation | references/core-animation.md |

| Retain cycle / memory leak | Missing weak on delegate or [weak self] | references/communication-patterns.md |

| Scroll view doesn't scroll | Missing content size or broken constraint chain | references/uiscrollview.md |

| Shadow clipped by view | masksToBounds = true on layer | references/core-animation.md |

| Gradient/shadow wrong size | Set bounds-dependent layers in viewDidLayoutSubviews | references/core-animation.md |

| Collection view empty | Forgot to register cell or data source nil | references/uicollectionview.md |

| Core Data threading crash | Accessing managed object on wrong queue | references/networking.md |

| Nav bar title missing | Not setting title or navigationItem.title | references/uinavigationcontroller.md |

| Async callback UI freeze | Missing @MainActor or DispatchQueue.main dispatch | references/architecture-patterns.md |

| Combine subscription no fire | Subscriber deallocated — store in cancellables | references/communication-patterns.md |

Modern Swift Notes

When working with UIKit in modern Swift (2025+):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.