Get Started | Examples | Customize | Install |
-
Install
iPages
-
Add
iPages
to your project
import SwiftUI
import iPages
struct ContentView: View {
var body: some View {
iPages {
Text("iPages ๐ค")
Color.pink
}
}
}
- Customize your
iPages
Use iGraphicsView
to demo marketing slides.
import SwiftUI
import iPages
import iGraphics
struct ContentView: View {
var body: some View {
iPages {
iGraphicsView(.first)
iGraphicsView(.second)
iGraphicsView(.third)
}
}
}
If you want, you can pass in your own optional selection binding to iPages. Hide the bottom dots & add infinite scroll to remove context.
import SwiftUI
import iPages
import iGraphics
struct ContentView: View {
@State var currentPage: Int = 0
var body: some View {
iPages(selection: $currentPage) {
iGraphicsBox(.photo)
.stack(3)
iGraphicsBox(.card)
.stack(2)
}
.hideDots(true)
.wraps(true)
}
}
iPages
takes a trailing view builder of ordered views. You can also optionally pass in your own page index binding called selection:
, to let you build your own page control, or however you want to use it. iPages
supports a variety of custom modifiers. All customizations are built into our modifiers.
Example: Change the dot colors, enable infinite wrap & hide dots for single page views with the following code block:
iPages(selection: $currentPage) {
Text("๐")
}
.dotsTintColors(currentPage: Color, otherPages: Color)
.wraps(true)
.dotsHideForSinglePage(true)
.navigationOrientation(.vertical)
Use our exhaustive input list to customize your views.
Modifier or Initializer | Description | |
---|---|---|
๐ทโโ๏ธ | .init(content:) |
Initializes the page ๐๐ view. |
๐ทโโ๏ธ | .init(selection:content:) |
Initializes the page ๐๐ view with a selection binding. |
โบ | .hideDots(_:) |
Modifies whether or not the page view should include the standard page control dots. (โขโขโขโข) |
๐ | .wraps(_:) |
Modifies whether or not the page view should restart at the beginning ๐ when swiping past the end (and vise-versa) |
1๏ธโฃ | .dotsHideForSinglePage(_:) |
Modifies whether the page dots are hidden when there is only one page. 1๏ธโฃ |
๐จ | .dotsTintColors(currentPage:otherPages:) |
Modifies tint colors ๐ก๐ข๐ด๐ฃ to be used for the page dots. |
๐ | .dotsBackgroundStyle(_:) |
Modifies the background style โช๏ธ๐ of the page dots. |
๐ | .dotsAllowContinuousInteraction(_:) |
Modifies the continuous interaction settings of the dots. ๐ |
.dotsAlignment(_:) |
Modifies the alignment of the page dots. ๐ ๐ | |
.navigationOrientation(_:) |
Modifies the navigation orientation of the page view. |
|
๐ฆฟ | .disableBounce(_:) |
Disables the bounce settings of the page view. This is especially useful for scroll views. |
.interPageSpacing(_:) |
Modifies the spacing between the pages. |
|
๐ฅ | .animated(_:) |
Modifies whether the the pages animate the slide if the selection binding changes. ๐ฅ |
Use the Swift package manager to install. Find instructions here๐
As always, if you have any questions about iPages, we are available 24/7 to help.
Reach us at | ||
---|---|---|
๐ | +1 (415) 735-4464 | Call |
๐ง | [email protected] | |
๐ฒ | +1 (415) 735-4464 | Text |