iPages

Quickly implement swipable page views. 📝

1.

Install iPages.

2.

Add iPages to your project.

import SwiftUI
import iPages
import iGraphics

struct ContentView: View {
    @State var currentPage: Int = 0

    var body: some View {
        iPages([iGraphicsView(.first),
                iGraphicsView(.second)],
               currentPage: $currentPage)
    }
}

3.

Customize your iPages.



Examples

Marketing Materials

Use iGraphicsView to demo marketing slides.

import SwiftUI
import iPages
import iGraphics

struct ContentView: View {
    @State var currentPage: Int = 0

    var body: some View {
        iPages([iGraphicsView(.first),
                iGraphicsView(.second),
                iGraphicsView(.third)],
               currentPage: $currentPage)
    }
}

Shopping App

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([iGraphicsBox(.photo).stack(3),
                iGraphicsBox(.card).stack(2)],
               currentPage: $currentPage)
            .hideDots(true)
            .wrapsInfinitely(true)
    }
}

Customize

iPages has two required parameters: 1️⃣ an array of views, and 2️⃣ a state variable to track the current page. 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([], $currentPage)
    .dotsTintColors(currentPage: Color.black, otherPages: Color.lightGray)
    .wrapsInfinitely(true)
    .dotsHideForSinglePage(true)


Use our exhaustive input list to customize your views.

Modifier Description
.hideDots(hideDots: Bool) -> iPages
Modifies whether or not the page view should include the standard page control dots. (••••)
.wrapsInfinitely(wraps: Bool) -> iPages
Modifies whether or not the page view should restart at the beginning 🔁 when swiping past the end (and vise-versa)
.dotsHideForSinglePage(hide: Bool) -> iPages
Modifies whether the page dots are hidden when there is only one page. 1️⃣⤵️
.dotsTintColors(currentPage: Color, otherPages: Color) -> iPages
Modifies tint colors 🟡🟢🔴🟣 to be used for the page dots.
.dotsBackgroundStyle(style: UIPageControl.BackgroundStyle) -> iPages
Modifies the background style ⚪️🔘 of the page dots.
.dotsAllowContinuousInteraction(allowContinuousInteraction: Bool) -> iPages
Modifies the continuous interaction settings of the dots. 🔄

Community

Meet the developers behind iPages.


@benjaminsage


@AlexFine


iOS 13.0+

WatchOS 6.0+