# Uikit Interaction

> Route UIKit interaction, animation, transition, and SwiftUI-interop implementation tasks to the correct Knowledge Contracts — gesture recognizers and their coordination, Core Animation layers, UIView and property-animator animation, custom and interactive view controller transitions, and the UIViewRepresentable/UIHostingController boundary. Use when writing or reviewing code that adds a gesture to a UIKit view, animates a view or layer, replaces a modal presentation's animation, drives a dismissal from a pan, wraps a UIKit view for SwiftUI, or embeds a SwiftUI view in a UIKit screen. Screen scaffolding (lifecycle, Auto Layout, navigation, diffable lists) is out of scope here — see the uikit skill. Triggers on UIGestureRecognizer, UIPanGestureRecognizer, UITapGestureRecognizer, addGestureRecognizer, UIGestureRecognizerDelegate, shouldRecognizeSimultaneouslyWith, require(toFail:), CALayer, CABasicAnimation, presentation layer, isRemovedOnCompletion, fillMode, UIView.animate, UIViewPropertyAnimator, startAnimati

- Skill: `caglarbaranbora/uikit-interaction` (Agent Skill)
- Install (CLI): `npx skillmds@latest add caglarbaranbora/uikit-interaction`
- Raw SKILL.md: https://api.skillmd.com/api/skills/caglarbaranbora/uikit-interaction/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: caglarbaranbora (https://skillmd.com/u/caglarbaranbora)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/caglarbaranbora/uikit-interaction

---


# UIKit — Interaction Skill

## Purpose

Route the UIKit tasks that act on a screen that already exists — touch
handling, animation, the transition between two screens, and the boundary
where UIKit and SwiftUI meet — to the minimum required UIKit Knowledge
Contracts.

## Routing

Load only the contracts relevant to the task. All paths relative to
knowledge/uikit/.

-   Touch -> gesture-recognizers.md (attaching, state, coordinate spaces), gesture-recognizer-coordination.md (delegate, simultaneous recognition, require(toFail:))
-   Animation -> uiview-animation.md (UIView.animate, UIViewPropertyAnimator, animating constraints), core-animation-layers.md (CALayer, CABasicAnimation, presentation vs model layer)
-   Transitions -> custom-view-controller-transitions.md (animator object, containerView, completeTransition), interactive-transitions.md (UIPercentDrivenInteractiveTransition, gesture-driven dismissal)
-   SwiftUI interop -> swiftui-view-representable.md (UIViewRepresentable, Coordinator), swiftui-hosting-controller.md (UIHostingController, sizingOptions, safeAreaRegions)

Never load more than the contracts relevant to the specific question.
For view controller lifecycle, Auto Layout, navigation, and diffable
lists, route to `skill.uikit.foundations` instead. For animation and
gestures written in SwiftUI rather than UIKit, route to
`skill.swiftui.interaction` instead.

## Stop Conditions

Stop and report if the requested topic has no matching Knowledge
Contract in knowledge/uikit/ — do not guess or fall back to general
knowledge.

-   When to animate, and which gesture a control should use — owned by
    `human-interface-guidelines`
-   Accessibility of a custom gesture or an animation preference such as
    Reduce Motion — owned by `accessibility`
-   `UIViewPropertyAnimator` as a scroll-linked scrubbing engine, Metal or
    `CAEmitterLayer` effects, and `UIKit Dynamics` — Excluded
-   Storyboard segues and `IBAction`-driven transitions — Excluded

