swiftui-patterns
Skill66 starsChanged 6 months agoMITView on GitHub
SwiftUI UI patterns, state management, navigation, animations, and performance optimization.
15 other projects use a version of this.
Adopted by
Most recently taken up by
- templetongroup/radianttheir own version, first seen Sep 17, 2026
- SamuelNDCE/claude-super-skill-librarytheir own version, first seen Aug 1, 2026
- dpearson2699/swift-ios-skillstheir own version, first seen Jul 13, 2026
- robinebers/openusagetheir own version, first seen Jul 8, 2026
- georgekhananaev/claude-skills-vaulttheir own version, first seen May 25, 2026
- openai/pluginstheir own version, first seen May 13, 2026
Used with
Projects with it also use swift-protocol-di-testing, swift-actor-persistence and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
InfopibeSkillswift-protocol-di-testing
Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.
Also in 5 projects that use this
InfopibeSkillswift-actor-persistence
Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.
Also in 5 projects that use this
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 4 projects that use this
FaisalAlqarniSkillspringboot-tdd
Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.
Also in 4 projects that use this
FaisalAlqarniSkilldjango-verification
Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
Also in 4 projects that use this
- +7 more from Infopibe
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- openai/plugins★ 7.3ksame name
- robinebers/openusage★ 4.3ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- dpearson2699/swift-ios-skills★ 1.2ksame name
- loulanyue/awesome-claude-notes★ 272same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- Jamkris/everything-gemini-code★ 87same name
- georgekhananaev/claude-skills-vault★ 28same name
- Infopibe/everything-claude-code★ 8same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rules/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/everything-mobile.mdcCursor rule
- accessibility-patternsSkill
- analytics-patternsSkill
- android-patternsSkill
- app-lifecycleSkill
- ci-cd-patternsSkill
- combine-frameworkSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- core-dataSkill
- coroutines-patternsSkill
- deep-linkingSkill
- expect-actualSkill
- feature-builderSkill
- feature-flagsSkill
- gradle-patternsSkill
- image-loadingSkill
- ios-testingSkill
- jetpack-composeSkill
- kmp-diSkill
- kmp-navigationSkill
- kmp-networkingSkill
- kmp-repositoriesSkill
- koin-patternsSkill
- ktor-patternsSkill
- liquid-glassSkill
- localization-patternsSkill
- m3-expressiveSkill
- mobile-checkpointSkill
- mobile-compactionSkill
- mobile-instinct-v1Skill
- mobile-instinct-v2Skill
- mobile-memorySkill
- mobile-securitySkill
- mobile-testingSkill
- mobile-verificationSkill
- mvi-architectureSkill
- navigation-composeSkill
- offline-firstSkill
- pagination-patternsSkill
- push-notificationsSkill
- room-patternsSkill
- shared-coroutinesSkill
- shared-modelsSkill
- sqldelight-patternsSkill
- swift-patternsSkill
The file
Files
SwiftUI Patterns
Modern SwiftUI patterns for iOS 17+ development.
View Composition
Small, Focused Views
// ✅ Good: Single responsibility
struct AvatarView: View {
let imageURL: URL?
let size: CGFloat
var body: some View {
AsyncImage(url: imageURL) { image in
image.resizable()
} placeholder: {
Color.gray.opacity(0.2)
}
.frame(width: size, height: size)
.clipShape(Circle())
}
}
struct UserRow: View {
let user: User
var body: some View {
HStack {
AvatarView(imageURL: user.avatarURL, size: 48)
VStack(alignment: .leading) {
Text(user.name).font(.headline)
Text(user.email).font(.caption).foregroundStyle(.secondary)
}
}
}
}State Management
@Observable (iOS 17+)
@Observable
class HomeViewModel {
var items: [Item] = []
var isLoading = false
func loadItems() async {
isLoading = true
items = await api.fetchItems()
isLoading = false
}
}
struct HomeView: View {
@State private var viewModel = HomeViewModel()
var body: some View {
List {
if viewModel.isLoading {
ProgressView()
} else {
ForEach(viewModel.items) { item in
Text(item.title)
}
}
}
.task {
await viewModel.loadItems()
}
}
}Performance Patterns
Lazy Containers
// ✅ LazyVStack for long lists
ScrollView {
LazyVStack(spacing: 16) {
ForEach(items) { item in
ItemCard(item: item)
}
}
}
// ✅ LazyHStack for horizontal lists
ScrollView(.horizontal) {
LazyHStack(spacing: 12) {
ForEach(users) { user in
UserAvatar(user: user)
}
}
}Equatable Views
struct ItemRow: View, Equatable {
let item: Item
static func == (lhs: Self, rhs: Self) -> Bool {
lhs.item.id == rhs.item.id
}
var body: some View {
HStack {
Text(item.title)
Text(item.price)
}
}
}Navigation
NavigationStack
enum Route: Hashable {
case home
case detail(String)
case profile(userId: String)
}
struct AppNavigation: View {
@State private var path: [Route] = []
var body: some View {
NavigationStack(path: $path) {
HomeView()
.navigationDestination(for: Route.self) { route in
switch route {
case .home:
HomeView()
case .detail(let id):
DetailView(id: id)
case .profile(let userId):
ProfileView(userId: userId)
}
}
}
}
}Sheet Presentation
struct RootView: View {
@State private var presentedItem: Item?
@State private var showingSettings = false
var body: some View {
List(items) { item in
Button(item.title) { presentedItem = item }
}
.sheet(item: $presentedItem) { item in
DetailSheet(item: item)
}
.sheet(isPresented: $showingSettings) {
SettingsView()
}
}
}Gestures
Custom Gestures
struct SwipeToDismiss: ViewModifier {
@State private var offset: CGFloat = 0
func body(content: Content) -> some View {
content
.offset(x: offset)
.gesture(
DragGesture()
.onChanged { value in
if value.translation.width < 0 {
offset = value.translation.width
}
}
.onEnded { value in
if value.translation.width < -100 {
// Dismiss action
}
offset = 0
}
)
}
}Animations
Spring Animations
struct AnimatedButton: View {
@State private var isPressed = false
var body: some View {
Circle()
.fill(isPressed ? Color.blue : Color.gray)
.frame(width: 80, height: 80)
.scaleEffect(isPressed ? 0.9 : 1.0)
.animation(.spring(response: 0.3, dampingFraction: 0.6), value: isPressed)
.onTapGesture {
withAnimation {
isPressed.toggle()
}
}
}
}Phase Animations
struct StaggerAnimation: View {
let items: [String]
var body: some View {
VStack {
ForEach(Array(items.enumerated()), id: \.offset) { index, item in
Text(item)
.transition(.scale.combined(with: .opacity))
}
}
}
}
// Usage with stagger
.transition(.asymmetric(
insertion: .scale.combined(with: .opacity),
removal: .opacity
))Custom Modifiers
struct CardModifier: ViewModifier {
var backgroundColor: Color = .white
var cornerRadius: CGFloat = 12
var shadowRadius: CGFloat = 4
func body(content: Content) -> some View {
content
.padding()
.background(backgroundColor)
.clipShape(RoundedRectangle(cornerRadius: cornerRadius))
.shadow(radius: shadowRadius)
}
}
extension View {
func cardStyle(
backgroundColor: Color = .white,
cornerRadius: CGFloat = 12,
shadowRadius: CGFloat = 4
) -> some View {
modifier(CardModifier(
backgroundColor: backgroundColor,
cornerRadius: cornerRadius,
shadowRadius: shadowRadius
))
}
}Shapes & Styles
Custom Shapes
struct BlobShape: Shape {
var cornerRadius: CGFloat = 40
var animatableData: CGFloat = cornerRadius
func path(in rect: CGRect) -> Path {
var path = Path()
let points = [
CGPoint(x: 0, y: 0),
CGPoint(x: rect.width, y: 0),
CGPoint(x: rect.width, y: rect.height),
CGPoint(x: 0, y: rect.height)
]
// Create blob shape
return path
}
}
// Usage
BlobShape(cornerRadius: 50)
.fill(Color.blue.gradient)Gradients
Circle()
.fill(
LinearGradient(
colors: [.blue, .purple],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
// Angular gradient
Circle()
.fill(AngularGradient(
colors: [.red, .yellow, .green, .blue, .red],
center: .center
))Grid Layouts
LazyVGrid(
columns: [
GridItem(.adaptive(minimum: 100), spacing: 16)
],
spacing: 16
) {
ForEach(items) { item in
ItemCell(item: item)
}
}Remember: SwiftUI views are values. Compose them, transform them, and let the framework handle rendering.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

