SegmentedControlPageView
Native Segmented Control + Page View implementation for SwiftUI. Supports iOS/iPadOS 13+ and visionOS 1+
Install / Use
/learn @samdawes/SegmentedControlPageViewREADME
SegmentedControlPageView
Offers a seamless integration of a segmented control and a page view in native SwiftUI applications. Users can navigate between pages by swiping or tapping on segments in the control. Compatible with iOS 13+ and visionOS 1+.
Usage
The following example shows a possible onboarding process. The segmented control has three segments with the labels Welcome, Features, and Next Steps that correspond to three custom SwiftUI views: WelcomeView(), FeaturesView(), and NextStepsView().
import SegmentedControlPageView
@State var currentSelection: Int = 0
SegmentedControlPageView(
"Onboarding Process",
selection: $currentSelection,
labels: [
"Welcome",
"Features",
"Next Steps"
],
pages: [
WelcomeView(),
FeaturesView(),
NextStepsView()
]
)
If you'd like to use the page view without the segmented control, initialize a PageView in your project. This will fall back to a UIKit implementation for older versions of iOS, to ensure consistency on all versions.
PageView([
WelcomeView(),
FeaturesView(),
NextStepsView()
], selection: $currentSelection)
Requirements
- iOS 13.0 or later
- visionOS 1.0 or later
Installation
Swift Package Manager
In Xcode go to Project -> Your Project Name -> Package Dependencies -> Tap Plus. Insert url:
https://github.com/samdawes/SegmentedControlPageView
or add it to the dependencies section in your Package.swift file:
dependencies: [
.package(url: "https://github.com/samdawes/SegmentedControlPageView", .upToNextMajor(from: "1.0.0"))
]
Manually
If you prefer not to use Swift Package Manager, you can integrate manually. Put the Sources/SegmentedControlPageView folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.
Apps Using
If your app uses SegmentedControlPageView, don't hesitate to add yours to the list!
Related Skills
openhue
346.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
346.4kElevenLabs text-to-speech with mac-style say UX.
weather
346.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.6kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
