# uikit-app-modernization

Updates legacy UIKit codebases for scene lifecycles and dynamic multi-window environments. It removes shared-state calls like UIScreen.main across Swift and Objective-C files.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 689 installs · ★ 352
- Author: superagents-lab
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/superagents-lab/xcode27-skills/tree/HEAD/uikit-app-modernization/SKILL.md
- Updated: 2026-06-09
- HTML: https://affpapa.org/en/nevibecode/skills/uikit-app-modernization

## What it does

This skill targets legacy UIKit applications that need multi-window and scene lifecycle support on modern iOS. It scans both Swift and Objective-C code to replace global APIs such as `UIScreen.main`, `interfaceOrientation`, and symmetric `safeAreaInsets` with context-specific alternatives. Dynamic measurements remain dynamic, as hardcoded literal fallbacks are forbidden.

The skill relies on an atomic deprecate-and-forward pattern whenever method signatures require adjustments. It introduces an updated method overload while keeping the older variant in place as a deprecated forwarder. Control flow branches like `if/else` and `switch` are preserved to prevent unintended execution bugs. If a substitution introduces breaking changes across modules, the skill asks for confirmation instead of guessing.

Strict atomic requirements prevent half-finished migrations: generating a partial diff or a vague placeholder comment counts as a failure. The rule set keeps edits focused strictly on target lines without altering neighboring whitespace.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add superagents-lab/xcode27-skills --skill uikit-app-modernization -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/uikit-app-modernization/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/uikit-app-modernization/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add superagents-lab/xcode27-skills --skill uikit-app-modernization -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/uikit-app-modernization/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add superagents-lab/xcode27-skills --skill uikit-app-modernization -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/uikit-app-modernization/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install superagents-lab/xcode27-skills uikit-app-modernization
```

2. **Manually: put the files in place**
- File: `.github/skills/uikit-app-modernization/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add superagents-lab/xcode27-skills --skill uikit-app-modernization -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/superagents-lab/xcode27-skills --path uikit-app-modernization
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/uikit-app-modernization/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add superagents-lab/xcode27-skills --skill uikit-app-modernization -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/superagents-lab/xcode27-skills/tree/HEAD/uikit-app-modernization/SKILL.md

## When to use it
- eliminate deprecated UIScreen.main and UIScreen.mainScreen references
- transition app lifecycle code to modern scene-based lifecycle
- correct asymmetric safe area calculations using modern insets
- introduce updated method overloads while retaining backward-compatible wrappers

## Example prompts
- Migrate all UIScreen.main usages in this view controller to modern trait APIs
- Update the layout logic to handle asymmetric safeAreaInsets properly
- Refactor orientation checks away from interfaceOrientation in this module

## Similar
- [uikit-max](https://affpapa.org/en/nevibecode/skills/uikit-max.md) — skill · 736 installs
- [swiftui-uikit-interop](https://affpapa.org/en/nevibecode/skills/swiftui-uikit-interop.md) — skill · 4100 installs
- [uikit](https://affpapa.org/en/nevibecode/skills/uikit.md) — skill · 455 installs
- [axiom-uikit](https://affpapa.org/en/nevibecode/skills/axiom-uikit.md) — skill · 1200 installs
- [xcode-compilation-analyzer](https://affpapa.org/en/nevibecode/skills/xcode-compilation-analyzer.md) — skill · 3400 installs
- [swift-architecture-skill](https://affpapa.org/en/nevibecode/skills/swift-architecture-skill.md) — skill · 2000 installs

From the same set: [superagents-lab/xcode27-skills](https://affpapa.org/en/nevibecode/by/superagents-lab/xcode27-skills.md) — 7 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
