# iPages **Repository Path**: BugMonkey/iPages ## Basic Information - **Project Name**: iPages - **Description**: No description available - **Primary Language**: Swift - **License**: Not specified - **Default Branch**: Updated-ReadMe - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-11 - **Last Updated**: 2022-02-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
Get Started | Examples | Customize | Install | Usage
1. [Install](https://github.com/benjaminsage/iPages/blob/main/INSTALL.md) `iPages`
2. Add `iPages` to your project
```swift
import SwiftUI
import iPages
struct ContentView: View {
@State var currentPage: Int = 0
var body: some View {
iPages(currentPage: $currentPage) {
Text("iPages")
Color.pink
}
}
}
```
3. Customize your `iPages`
## Examples
### Marketing Materials
Use `iGraphicsView` to demo marketing slides.
```swift
import SwiftUI
import iPages
import iGraphics
struct ContentView: View {
@State var currentPage: Int = 0
var body: some View {
iPages(currentPage: $currentPage) {
iGraphicsView(.first)
iGraphicsView(.second)
iGraphicsView(.third)
}
}
}
```
### Shopping App
Hide the bottom dots & add infinite scroll to remove context.
```swift
import SwiftUI
import iPages
import iGraphics
struct ContentView: View {
@State var currentPage: Int = 0
var body: some View {
iPages(currentPage: $currentPage) {
iGraphicsBox(.photo)
.stack(3)
iGraphicsBox(.card)
.stack(2)
}
.hideDots(true)
.wrapsInfinitely(true)
}
}
```
## Customize
`iPages` has two required parameters: 1οΈβ£ a state variable to track the current page, and 2οΈβ£ a trailing view builder of ordered views. `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:
```swift
iPages($currentPage) {
EmptyView()
}
.dotsTintColors(currentPage: Color, otherPages: Color)
.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. (β’β’β’β’)
`.wraps(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. π
`.dotsAlignment(_ alignment: Alignment) -> iPages` | Modifies the **alignment of the page dots**. π π
`.navigationOrientation(_ orientation: UIPageViewController.NavigationOrientation) -> iPages` | Modifies the navigation **orientation** of the page view. βοΈ βοΈ
`.disableBounce(_ disable: Bool) -> iPages` | Disables the **bounce** settings of the page view. This is especially useful for scroll views.
`.interPageSpacing(_ spacing: CGFloat) -> iPages` | Modifies the spacing between the pages. βοΈ
## Install
Use the Swift package manager to install. Find instructions [here](https://github.com/benjaminsage/iPages/blob/main/INSTALL.md)π
## Usage
iPages is distributed under a GNU GPL open-source license. This license allows iPages to ALWAYS remain FREE for individuals.
However, 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 easy to purchase a lifetime, full-use license for $4.99. Code on worry free π