Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# CLAUDE.md - StepperView

## Project Overview

StepperView is a SwiftUI component library for displaying step indicators in vertical and horizontal orientations. It supports iOS, watchOS, tvOS, and macOS. Published via CocoaPods (v1.6.7), Swift Package Manager, and Carthage.

## Project Structure

```
Sources/StepperView/ # Main library source
Views/ # Core views (StepperView, PitStopView, indicators, lines)
Extension/ # SwiftUI extensions (colors, environment, preferences, modifiers)
Utils/ # Constants and animation utilities
Example/ # Example iOS + watchOS app (CocoaPods workspace)
StepperView/ # iOS example app
StepperView_Watch/ # watchOS example app
Tests/ # Snapshot tests
Tests/StepperViewTests/ # SPM unit tests
.github/workflows/ # CI: build, swiftlint, cocoapods deploy
```

## Build & Test

```bash
# SPM
swift build
swift test

# CocoaPods (Example app)
cd Example && pod install
# Open Example/StepperView.xcworkspace in Xcode
```

## Key Configuration Files

- `Package.swift` - SPM manifest (Swift 5.1+, iOS 11.0+)
- `StepperView.podspec` - CocoaPods spec (Swift 5.0, iOS 11.0+, watchOS 6.0+)
- `.swiftlint.yml` - Linting rules
- `.github/workflows/swift.yml` - CI pipeline (build + test on push/PR)

## Coding Conventions

- **SwiftUI-native**: No UIKit in the library; UIKit only in Example app hosting
- **Fluent API**: Public modifiers via View extensions (e.g., `.addSteps()`, `.indicators()`, `.spacing()`)
- **Environment-driven config**: Uses `@Environment` and custom `EnvironmentKey` for passing options
- **PreferenceKeys**: Used for child-to-parent communication between views
- **Naming**: PascalCase for types, camelCase for properties/functions
- **Line length**: 160 characters max
- **Identifier length**: Warning at 45, error at 60 characters

## SwiftLint

Disabled rules: `trailing_whitespace`, `colon`, `implicit_getter`, `empty_enum_arguments`
Opted-in: `trailing_semicolon`

## Platform Targets

| Platform | Minimum Version |
|----------|----------------|
| iOS | 11.0 |
| watchOS | 6.0 |
| tvOS | 13.0 |
| macOS | 10.15 |

## Testing

- Snapshot tests use **SnapshotTesting** (~1.7.2) in `Example/Tests/`
- SPM tests in `Tests/StepperViewTests/`

## CI/CD

- **swift.yml**: Builds and tests on push to master and PRs
- **swiftlint.yml**: Lints Swift file diffs on PRs
- **deploy_to_cocoapods.yml**: Deploys on `deploy` tag push (requires `COCOAPODS_TRUNK_TOKEN`)

## Release Process

1. Update version in `StepperView.podspec`
2. Push a `deploy` tag to trigger CocoaPods trunk publish
25 changes: 20 additions & 5 deletions Example/StepperView/ExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,32 @@ struct ExampleView: View {
var body: some View {
TabView {
ExampleView6()
.tabItem { Text("PitStops") .foregroundColor(Color.black) }
.tabItem {
Image(systemName: "mappin.and.ellipse")
Text("PitStops")
}
ExampleView5()
.tabItem { Text("Examples") .foregroundColor(Color.black) }
.tabItem {
Image(systemName: "list.bullet")
Text("Examples")
}
ExampleView11()
.tabItem { Text("LifeCycle") .foregroundColor(Color.black) }
.tabItem {
Image(systemName: "arrow.triangle.2.circlepath")
Text("LifeCycle")
}
// ExampleView2()
// .tabItem { Text("Usecase") .foregroundColor(Color.black) }
ExampleView3()
.tabItem { Text("Card") .foregroundColor(Color.black) }
.tabItem {
Image(systemName: "creditcard")
Text("Card")
}
ExampleView1()
.tabItem { Text("Basic").foregroundColor(Color.black) }
.tabItem {
Image(systemName: "circle.grid.2x2")
Text("Basic")
}
}

// to test dynamic way of adding steps, use ExampleView9
Expand Down
Loading