
Swift Uikit
- 60 installs
- 9 repo stars
- Updated January 5, 2026
- pluginagentmarketplace/custom-plugin-swift
Helps with ai & agent building tasks.
About
swift-uikit is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- swift-uikit
- AI & Agent Building
- AI-coding skill
Swift Uikit by the numbers
- 60 all-time installs (skills.sh)
- Ranked #6,460 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-swift --skill swift-uikitAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 60 |
|---|---|
| repo stars | ★ 9 |
| Last updated | January 5, 2026 |
| Repository | pluginagentmarketplace/custom-plugin-swift ↗ |
What it does
Helps with ai & agent building tasks.
Files
UIKit Skill
Comprehensive UIKit framework knowledge for building traditional iOS user interfaces.
Prerequisites
- Xcode 15+ installed
- iOS 15+ deployment target recommended
- Understanding of MVC/MVVM patterns
Parameters
parameters:
layout_approach:
type: string
enum: [programmatic, storyboard, xib]
default: programmatic
accessibility_enabled:
type: boolean
default: true
dynamic_type_support:
type: boolean
default: trueTopics Covered
View Controllers
| Type | Purpose | Use Case |
|---|---|---|
UIViewController | Base controller | Custom screens |
UINavigationController | Stack navigation | Hierarchical flow |
UITabBarController | Tab-based | Main sections |
UISplitViewController | Master-detail | iPad layouts |
UIPageViewController | Page swiping | Onboarding |
Auto Layout
| Constraint Type | Description |
|---|---|
| Leading/Trailing | Horizontal edges (respects RTL) |
| Top/Bottom | Vertical edges |
| CenterX/CenterY | Center alignment |
| Width/Height | Size constraints |
| Aspect Ratio | Proportional sizing |
Table & Collection Views
| Component | Purpose |
|---|---|
| UITableView | Vertical scrolling lists |
| UICollectionView | Flexible grid layouts |
| DiffableDataSource | Automatic diffing (iOS 13+) |
| CompositionalLayout | Complex layouts (iOS 13+) |
Code Examples
Programmatic View Controller
final class ProfileViewController: UIViewController {
// MARK: - UI Components
private lazy var avatarImageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFill
imageView.clipsToBounds = true
imageView.layer.cornerRadius = 50
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.accessibilityLabel = "Profile picture"
return imageView
}()
private lazy var nameLabel: UILabel = {
let label = UILabel()
label.font = .preferredFont(forTextStyle: .title1)
label.adjustsFontForContentSizeCategory = true
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private lazy var bioLabel: UILabel = {
let label = UILabel()
label.font = .preferredFont(forTextStyle: .body)
label.adjustsFontForContentSizeCategory = true
label.numberOfLines = 0
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
setupConstraints()
}
// MARK: - Setup
private func setupUI() {
view.backgroundColor = .systemBackground
view.addSubview(avatarImageView)
view.addSubview(nameLabel)
view.addSubview(bioLabel)
}
private func setupConstraints() {
NSLayoutConstraint.activate([
avatarImageView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 32),
avatarImageView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
avatarImageView.widthAnchor.constraint(equalToConstant: 100),
avatarImageView.heightAnchor.constraint(equalToConstant: 100),
nameLabel.topAnchor.constraint(equalTo: avatarImageView.bottomAnchor, constant: 16),
nameLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
nameLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
bioLabel.topAnchor.constraint(equalTo: nameLabel.bottomAnchor, constant: 8),
bioLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
bioLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20)
])
}
// MARK: - Configuration
func configure(with user: User) {
nameLabel.text = user.name
bioLabel.text = user.bio
// Load avatar image
}
}Modern Collection View with Diffable Data Source
final class ProductGridViewController: UIViewController {
enum Section { case main }
private var collectionView: UICollectionView!
private var dataSource: UICollectionViewDiffableDataSource<Section, Product>!
override func viewDidLoad() {
super.viewDidLoad()
configureCollectionView()
configureDataSource()
}
private func configureCollectionView() {
let layout = createCompositionalLayout()
collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: layout)
collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
collectionView.backgroundColor = .systemBackground
view.addSubview(collectionView)
}
private func createCompositionalLayout() -> UICollectionViewLayout {
let itemSize = NSCollectionLayoutSize(
widthDimension: .fractionalWidth(0.5),
heightDimension: .estimated(200)
)
let item = NSCollectionLayoutItem(layoutSize: itemSize)
item.contentInsets = NSDirectionalEdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8)
let groupSize = NSCollectionLayoutSize(
widthDimension: .fractionalWidth(1.0),
heightDimension: .estimated(200)
)
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
let section = NSCollectionLayoutSection(group: group)
return UICollectionViewCompositionalLayout(section: section)
}
private func configureDataSource() {
let cellRegistration = UICollectionView.CellRegistration<ProductCell, Product> { cell, indexPath, product in
cell.configure(with: product)
}
dataSource = UICollectionViewDiffableDataSource<Section, Product>(collectionView: collectionView) {
collectionView, indexPath, product in
collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: product)
}
}
func applySnapshot(products: [Product], animatingDifferences: Bool = true) {
var snapshot = NSDiffableDataSourceSnapshot<Section, Product>()
snapshot.appendSections([.main])
snapshot.appendItems(products)
dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
}
}Custom UIView with Intrinsic Size
final class TagView: UIView {
private let label: UILabel = {
let label = UILabel()
label.font = .preferredFont(forTextStyle: .caption1)
label.adjustsFontForContentSizeCategory = true
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private let padding = UIEdgeInsets(top: 4, left: 8, bottom: 4, right: 8)
override var intrinsicContentSize: CGSize {
let labelSize = label.intrinsicContentSize
return CGSize(
width: labelSize.width + padding.left + padding.right,
height: labelSize.height + padding.top + padding.bottom
)
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
private func setup() {
backgroundColor = .systemBlue
layer.cornerRadius = 8
addSubview(label)
NSLayoutConstraint.activate([
label.topAnchor.constraint(equalTo: topAnchor, constant: padding.top),
label.leadingAnchor.constraint(equalTo: leadingAnchor, constant: padding.left),
label.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -padding.right),
label.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -padding.bottom)
])
}
func configure(text: String, color: UIColor = .systemBlue) {
label.text = text
label.textColor = .white
backgroundColor = color
invalidateIntrinsicContentSize()
}
}Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| "Unable to simultaneously satisfy constraints" | Conflicting constraints | Lower priority on flexible constraints |
| Cell not appearing | Missing registration | Use CellRegistration or register before dequeue |
| Keyboard covers text field | No keyboard handling | Observe keyboard notifications |
| Content compressed | Missing hugging priority | Set content hugging priority higher |
| View not responding to touches | Overlapping views | Check view hierarchy, userInteractionEnabled |
Debug Commands
// Print view hierarchy
po view.recursiveDescription()
// Print Auto Layout issues
po view.constraintsAffectingLayout(for: .horizontal)
// Check if on main thread
assert(Thread.isMainThread, "UI updates must be on main thread")Validation Rules
validation:
- rule: accessibility_labels
severity: warning
check: All interactive elements must have accessibility labels
- rule: dynamic_type_support
severity: warning
check: Use preferredFont and adjustsFontForContentSizeCategory
- rule: safe_area_constraints
severity: info
check: Content should respect safe area layout guidesUsage
Skill("swift-uikit")Related Skills
swift-ios-basics- iOS fundamentalsswift-swiftui- Modern alternativeswift-architecture- App architecture
# swift-uikit Configuration
# Category: frontend
# Generated: 2025-12-30
skill:
name: swift-uikit
version: "1.0.0"
category: frontend
settings:
# Default settings for swift-uikit
enabled: true
log_level: info
# Category-specific defaults
validation:
strict_mode: false
auto_fix: false
output:
format: markdown
include_examples: true
# Environment-specific overrides
environments:
development:
log_level: debug
validation:
strict_mode: false
production:
log_level: warn
validation:
strict_mode: true
# Integration settings
integrations:
# Enable/disable integrations
git: true
linter: true
formatter: true
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "swift-uikit Configuration Schema",
"type": "object",
"properties": {
"skill": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"category": {
"type": "string",
"enum": [
"api",
"testing",
"devops",
"security",
"database",
"frontend",
"algorithms",
"machine-learning",
"cloud",
"containers",
"general"
]
}
},
"required": [
"name",
"version"
]
},
"settings": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"log_level": {
"type": "string",
"enum": [
"debug",
"info",
"warn",
"error"
]
}
}
}
},
"required": [
"skill"
]
}import UIKit
class {{CLASS_NAME}}ViewController: UIViewController {
// MARK: - UI Elements
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = .preferredFont(forTextStyle: .headline)
return label
}()
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
setupConstraints()
}
// MARK: - Setup
private func setupUI() {
view.backgroundColor = .systemBackground
view.addSubview(titleLabel)
}
private func setupConstraints() {
NSLayoutConstraint.activate([
titleLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor),
titleLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
}
}
UIKit Guide
Auto Layout Programmatically
// Anchors
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
view.topAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.topAnchor, constant: 16),
view.leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: 16),
view.trailingAnchor.constraint(equalTo: superview.trailingAnchor, constant: -16)
])Table View
class MyTableViewController: UITableViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
cell.textLabel?.text = items[indexPath.row]
return cell
}
}Swift Uikit Patterns
Design Patterns
Pattern 1: Input Validation
Always validate input before processing:
def validate_input(data):
if data is None:
raise ValueError("Data cannot be None")
if not isinstance(data, dict):
raise TypeError("Data must be a dictionary")
return TruePattern 2: Error Handling
Use consistent error handling:
try:
result = risky_operation()
except SpecificError as e:
logger.error(f"Operation failed: {e}")
handle_error(e)
except Exception as e:
logger.exception("Unexpected error")
raisePattern 3: Configuration Loading
Load and validate configuration:
import yaml
def load_config(config_path):
with open(config_path) as f:
config = yaml.safe_load(f)
validate_config(config)
return configAnti-Patterns to Avoid
❌ Don't: Swallow Exceptions
# BAD
try:
do_something()
except:
pass✅ Do: Handle Explicitly
# GOOD
try:
do_something()
except SpecificError as e:
logger.warning(f"Expected error: {e}")
return default_valueCategory-Specific Patterns: Frontend
Recommended Approach
1. Start with the simplest implementation 2. Add complexity only when needed 3. Test each addition 4. Document decisions
Common Integration Points
- Configuration:
assets/config.yaml - Validation:
scripts/validate.py - Documentation:
references/GUIDE.md
---
Pattern library for swift-uikit skill
#!/usr/bin/env python3
"""
Validation script for swift-uikit skill.
Category: frontend
"""
import os
import sys
import yaml
import json
from pathlib import Path
def validate_config(config_path: str) -> dict:
"""
Validate skill configuration file.
Args:
config_path: Path to config.yaml
Returns:
dict: Validation result with 'valid' and 'errors' keys
"""
errors = []
if not os.path.exists(config_path):
return {"valid": False, "errors": ["Config file not found"]}
try:
with open(config_path, 'r') as f:
config = yaml.safe_load(f)
except yaml.YAMLError as e:
return {"valid": False, "errors": [f"YAML parse error: {e}"]}
# Validate required fields
if 'skill' not in config:
errors.append("Missing 'skill' section")
else:
if 'name' not in config['skill']:
errors.append("Missing skill.name")
if 'version' not in config['skill']:
errors.append("Missing skill.version")
# Validate settings
if 'settings' in config:
settings = config['settings']
if 'log_level' in settings:
valid_levels = ['debug', 'info', 'warn', 'error']
if settings['log_level'] not in valid_levels:
errors.append(f"Invalid log_level: {settings['log_level']}")
return {
"valid": len(errors) == 0,
"errors": errors,
"config": config if not errors else None
}
def validate_skill_structure(skill_path: str) -> dict:
"""
Validate skill directory structure.
Args:
skill_path: Path to skill directory
Returns:
dict: Structure validation result
"""
required_dirs = ['assets', 'scripts', 'references']
required_files = ['SKILL.md']
errors = []
# Check required files
for file in required_files:
if not os.path.exists(os.path.join(skill_path, file)):
errors.append(f"Missing required file: {file}")
# Check required directories
for dir in required_dirs:
dir_path = os.path.join(skill_path, dir)
if not os.path.isdir(dir_path):
errors.append(f"Missing required directory: {dir}/")
else:
# Check for real content (not just .gitkeep)
files = [f for f in os.listdir(dir_path) if f != '.gitkeep']
if not files:
errors.append(f"Directory {dir}/ has no real content")
return {
"valid": len(errors) == 0,
"errors": errors,
"skill_name": os.path.basename(skill_path)
}
def main():
"""Main validation entry point."""
skill_path = Path(__file__).parent.parent
print(f"Validating swift-uikit skill...")
print(f"Path: {skill_path}")
# Validate structure
structure_result = validate_skill_structure(str(skill_path))
print(f"\nStructure validation: {'PASS' if structure_result['valid'] else 'FAIL'}")
if structure_result['errors']:
for error in structure_result['errors']:
print(f" - {error}")
# Validate config
config_path = skill_path / 'assets' / 'config.yaml'
if config_path.exists():
config_result = validate_config(str(config_path))
print(f"\nConfig validation: {'PASS' if config_result['valid'] else 'FAIL'}")
if config_result['errors']:
for error in config_result['errors']:
print(f" - {error}")
else:
print("\nConfig validation: SKIPPED (no config.yaml)")
# Summary
all_valid = structure_result['valid']
print(f"\n==================================================")
print(f"Overall: {'VALID' if all_valid else 'INVALID'}")
return 0 if all_valid else 1
if __name__ == "__main__":
sys.exit(main())
Related skills
AI & Agent Buildingagents