mirror of
https://github.com/wshobson/agents.git
synced 2026-03-18 09:37:15 +00:00
style: format all files with prettier
This commit is contained in:
@@ -27,6 +27,7 @@ Master iOS Human Interface Guidelines (HIG) and SwiftUI patterns to build polish
|
||||
**Depth**: Visual layers and motion convey hierarchy and enable navigation
|
||||
|
||||
**Platform Considerations:**
|
||||
|
||||
- **iOS**: Touch-first, compact displays, portrait orientation
|
||||
- **iPadOS**: Larger canvas, multitasking, pointer support
|
||||
- **visionOS**: Spatial computing, eye/hand input
|
||||
@@ -34,6 +35,7 @@ Master iOS Human Interface Guidelines (HIG) and SwiftUI patterns to build polish
|
||||
### 2. SwiftUI Layout System
|
||||
|
||||
**Stack-Based Layouts:**
|
||||
|
||||
```swift
|
||||
// Vertical stack with alignment
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
@@ -55,6 +57,7 @@ HStack {
|
||||
```
|
||||
|
||||
**Grid Layouts:**
|
||||
|
||||
```swift
|
||||
// Adaptive grid that fills available width
|
||||
LazyVGrid(columns: [
|
||||
@@ -80,6 +83,7 @@ LazyVGrid(columns: [
|
||||
### 3. Navigation Patterns
|
||||
|
||||
**NavigationStack (iOS 16+):**
|
||||
|
||||
```swift
|
||||
struct ContentView: View {
|
||||
@State private var path = NavigationPath()
|
||||
@@ -101,6 +105,7 @@ struct ContentView: View {
|
||||
```
|
||||
|
||||
**TabView:**
|
||||
|
||||
```swift
|
||||
struct MainTabView: View {
|
||||
@State private var selectedTab = 0
|
||||
@@ -132,6 +137,7 @@ struct MainTabView: View {
|
||||
### 4. System Integration
|
||||
|
||||
**SF Symbols:**
|
||||
|
||||
```swift
|
||||
// Basic symbol
|
||||
Image(systemName: "heart.fill")
|
||||
@@ -150,6 +156,7 @@ Image(systemName: "bell.fill")
|
||||
```
|
||||
|
||||
**Dynamic Type:**
|
||||
|
||||
```swift
|
||||
// Use semantic fonts
|
||||
Text("Headline")
|
||||
@@ -166,6 +173,7 @@ Text("Custom")
|
||||
### 5. Visual Design
|
||||
|
||||
**Colors and Materials:**
|
||||
|
||||
```swift
|
||||
// Semantic colors that adapt to light/dark mode
|
||||
Text("Primary")
|
||||
@@ -185,6 +193,7 @@ Text("Overlay")
|
||||
```
|
||||
|
||||
**Shadows and Depth:**
|
||||
|
||||
```swift
|
||||
// Standard card shadow
|
||||
RoundedRectangle(cornerRadius: 16)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
## Lists and Collections
|
||||
|
||||
### Basic List
|
||||
|
||||
```swift
|
||||
struct ItemListView: View {
|
||||
@State private var items: [Item] = []
|
||||
@@ -32,6 +33,7 @@ struct ItemListView: View {
|
||||
```
|
||||
|
||||
### Sectioned List
|
||||
|
||||
```swift
|
||||
struct SectionedListView: View {
|
||||
let groupedItems: [String: [Item]]
|
||||
@@ -52,6 +54,7 @@ struct SectionedListView: View {
|
||||
```
|
||||
|
||||
### Search Integration
|
||||
|
||||
```swift
|
||||
struct SearchableListView: View {
|
||||
@State private var searchText = ""
|
||||
@@ -85,6 +88,7 @@ struct SearchableListView: View {
|
||||
## Forms and Input
|
||||
|
||||
### Settings Form
|
||||
|
||||
```swift
|
||||
struct SettingsView: View {
|
||||
@AppStorage("notifications") private var notificationsEnabled = true
|
||||
@@ -125,6 +129,7 @@ struct SettingsView: View {
|
||||
```
|
||||
|
||||
### Custom Input Fields
|
||||
|
||||
```swift
|
||||
struct ValidatedTextField: View {
|
||||
let title: String
|
||||
@@ -171,6 +176,7 @@ struct ValidatedTextField: View {
|
||||
## Buttons and Actions
|
||||
|
||||
### Button Styles
|
||||
|
||||
```swift
|
||||
// Primary filled button
|
||||
Button("Continue") {
|
||||
@@ -202,6 +208,7 @@ struct ScaleButtonStyle: ButtonStyle {
|
||||
```
|
||||
|
||||
### Menu and Context Menu
|
||||
|
||||
```swift
|
||||
// Menu button
|
||||
Menu {
|
||||
@@ -226,6 +233,7 @@ Text("Long press me")
|
||||
## Sheets and Modals
|
||||
|
||||
### Sheet Presentation
|
||||
|
||||
```swift
|
||||
struct ParentView: View {
|
||||
@State private var showSettings = false
|
||||
@@ -269,6 +277,7 @@ struct SettingsSheet: View {
|
||||
```
|
||||
|
||||
### Confirmation Dialog
|
||||
|
||||
```swift
|
||||
struct DeleteConfirmationView: View {
|
||||
@State private var showConfirmation = false
|
||||
@@ -296,6 +305,7 @@ struct DeleteConfirmationView: View {
|
||||
## Loading and Progress
|
||||
|
||||
### Progress Indicators
|
||||
|
||||
```swift
|
||||
// Indeterminate spinner
|
||||
ProgressView()
|
||||
@@ -334,6 +344,7 @@ struct LoadingOverlay: View {
|
||||
```
|
||||
|
||||
### Skeleton Loading
|
||||
|
||||
```swift
|
||||
struct SkeletonRow: View {
|
||||
@State private var isAnimating = false
|
||||
@@ -366,6 +377,7 @@ struct SkeletonRow: View {
|
||||
## Async Content Loading
|
||||
|
||||
### AsyncImage
|
||||
|
||||
```swift
|
||||
AsyncImage(url: imageURL) { phase in
|
||||
switch phase {
|
||||
@@ -387,6 +399,7 @@ AsyncImage(url: imageURL) { phase in
|
||||
```
|
||||
|
||||
### Task-Based Loading
|
||||
|
||||
```swift
|
||||
struct AsyncContentView: View {
|
||||
@State private var items: [Item] = []
|
||||
@@ -435,6 +448,7 @@ struct AsyncContentView: View {
|
||||
## Animations
|
||||
|
||||
### Implicit Animations
|
||||
|
||||
```swift
|
||||
struct AnimatedCard: View {
|
||||
@State private var isExpanded = false
|
||||
@@ -461,6 +475,7 @@ struct AnimatedCard: View {
|
||||
```
|
||||
|
||||
### Custom Transitions
|
||||
|
||||
```swift
|
||||
extension AnyTransition {
|
||||
static var slideAndFade: AnyTransition {
|
||||
@@ -477,6 +492,7 @@ extension AnyTransition {
|
||||
```
|
||||
|
||||
### Phase Animator (iOS 17+)
|
||||
|
||||
```swift
|
||||
struct PulsingButton: View {
|
||||
var body: some View {
|
||||
@@ -495,6 +511,7 @@ struct PulsingButton: View {
|
||||
## Gestures
|
||||
|
||||
### Drag Gesture
|
||||
|
||||
```swift
|
||||
struct DraggableCard: View {
|
||||
@State private var offset = CGSize.zero
|
||||
@@ -524,6 +541,7 @@ struct DraggableCard: View {
|
||||
```
|
||||
|
||||
### Simultaneous Gestures
|
||||
|
||||
```swift
|
||||
struct ZoomableImage: View {
|
||||
@State private var scale: CGFloat = 1.0
|
||||
|
||||
Reference in New Issue
Block a user