agentsclimarketplace

Uikit

Skill G1Joshi/Agent-Skills/skills/mobile/uikit

UIKit imperative iOS UI framework. Use for iOS development.From its SKILL.md

Install
npx -y skills add G1Joshi/Agent-Skills --skill uikit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 12 stars12 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.8 KB, 735 tokens by cl100k_base, as published. Nobody here has run it

UIKit

UIKit is the traditional, imperative framework for building iOS user interfaces. While SwiftUI is the future, UIKit remains essential for maintaining existing apps and unrestricted access to the OS.

When to Use

  • Maintaining legacy iOS codebases (Objective-C or Swift).
  • Fine-grained control over view hierarchy performance not yet possible in SwiftUI.
  • Using third-party libraries that haven't migrated to SwiftUI ViewRepresentables.

Quick Start

// Programmatic UIKit (No Storyboards) in SceneDelegate
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options: UIScene.ConnectionOptions) {
    guard let windowScene = (scene as? UIWindowScene) else { return }
    window = UIWindow(windowScene: windowScene)
    window?.rootViewController = UINavigationController(rootViewController: HomeViewController())
    window?.makeKeyAndVisible()
}

class HomeViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .systemBackground
        title = "UIKit Home"

        let button = UIButton(type: .system)
        button.setTitle("Tap Me", for: .normal)
        button.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(button)

        NSLayoutConstraint.activate([
            button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            button.centerYAnchor.constraint(equalTo: view.centerYAnchor)
        ])
    }
}

Core Concepts

View Controller Lifecycle

Understanding viewDidLoad, viewWillAppear, viewDidLayoutSubviews is critical for managing state and layout updates correctly in the imperative model.

Auto Layout

The layout engine based on constraints. Use NSLayoutConstraint or library wrappers (SnapKit) to define rules (e.g., "A is 10px below B").

Delegates & Data Sources

Common pattern for handling events (UITableViewDelegate) and providing data (UITableViewDataSource).

Common Patterns

Diffable Data Source

Modern replacement for reloadData().

  • Uses NSDiffableDataSourceSnapshot to animate changes automatically and safely.
  • eliminates "Index out of range" crashes during updates.

Compositional Layout

Modern API for building complex collection view layouts (grids, carousels) without subclassing UICollectionViewLayout.

Coordinator Pattern

Moving navigation logic out of ViewControllers to improve reusability and testing.

Best Practices

Do:

  • Use Diffable Data Sources for Lists and Collections.
  • Use Compositional Layouts instead of FlowLayouts.
  • Use View Binding mechanisms (like Combine) to update UI, rather than manually setting properties everywhere.

Don't:

  • Don't use massive Storyboards (merge conflicts hell).
  • Don't force layoutIfNeeded() unless animating changes.
  • Don't forget [weak self] in closures to avoid memory leaks (Retain Cycles).

Troubleshooting

ErrorCauseSolution
Unsatisfiable ConstraintsConflicting Auto Layout rules.Check console log for breaking constraint IDs; simplify rules.
TableView Updates CrashInconsistent data vs rows.Use Diffable Data Source or ensure data model updates before insertRows.
Retain CycleStrong reference loop.Use Memory Graph Debugger; verify [weak self].

References

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.