Swiftpack.co - Package - benjaminsage/iPages

Get Started

  1. Install iPages

  2. Add iPages to your project

import SwiftUI
import iPages

struct ContentView: View {
    var body: some View {
        iPages {
            Text("iPages ๐Ÿค‘")
            Color.pink
        }
    }
}
  1. Customize your iPages

Examples

Marketing Materials ๐Ÿ’ธ

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)
        }
    }
}
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)
    }
}

Customize ๐ŸŽ€

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. ๐ŸŽฅ

Install

Use the Swift package manager to install. Find instructions here๐Ÿ˜€

Help

As always, if you have any questions about iPages, we are available 24/7 to help.

Reach us at
๐Ÿ“ž +1 (415) 735-4464 Call
๐Ÿ“ง hello@iswiftui.com Email
๐Ÿ“ฒ +1 (415) 735-4464 Text

Usage

iPages is FREE and open-source for individuals, and will remain that way forever.

iPages is distributed under a GNU GPL open-source license.

Commercial users, please note, this license is often incompatible for many commercial applications. If your app is distributed for commercial use, it could violate this open-source license even "if the application is free in the App Store".

In order to offer iPages safely to our commercial friends we made it super easy to purchase a lifetime, full-use license for $0.99. Code on worry free ๐Ÿ˜

Github

link
Stars: 83

Used By

Total: 0

Releases

Mac dots -

The page indicator dots are now on the mac!

Mac support -

iPages now works natively with the Mac! Syntax is unchanged, so if you're using SwiftUI, all should continue to work as expected.

Made views a state variable so that things would stop breaking -

Fixed animation bug -

Added bug patch for animated issue -

Fixed single-page state update issue -

View builder now allows ForEach! -

A TON new features like vertical scrolling, inter-page spacing, and moving the page control around -

Now works with only 1 page -

Renamed iColor -

Revised View Builder + can now handle different kinds of views -

Initial Release -