Coder Social home page Coder Social logo

ipages's Introduction

iPagesπŸ“–

Quickly implement swipable page views in iOS. πŸ“

Get Started | Examples | Customize | Install | Usage

CI


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

Shopping App

Hide the bottom dots & add infinite scroll to remove context.

If you want, you can pass in your own optional selection binding to iPages.

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: () -> Content) Initializes the page πŸ“ƒπŸ“– view. πŸ‘·β€β™€οΈ
.init(selection: Binding<Int>?, content: () -> Content) Initializes the page πŸ“ƒπŸ“– view with a selection binding. πŸ‘·β€β™€οΈ
.hideDots(_ hideDots: Bool) Modifies whether or not the page view should include the standard page control dots. (β€’β€’β€’β€’)
.wraps(_ wraps: Bool) Modifies whether or not the page view should restart at the beginning πŸ” when swiping past the end (and vise-versa)
.dotsHideForSinglePage(_ hide: Bool) Modifies whether the page dots are hidden when there is only one page. 1️⃣‡️
.dotsTintColors(currentPage: Color, otherPages: Color) Modifies tint colors πŸŸ‘πŸŸ’πŸ”΄πŸŸ£ to be used for the page dots.
.dotsBackgroundStyle(_ style: UIPageControl.BackgroundStyle) Modifies the background style βšͺοΈπŸ”˜ of the page dots.
.dotsAllowContinuousInteraction(_ allowContinuousInteraction: Bool) Modifies the continuous interaction settings of the dots. πŸ”„
.dotsAlignment(_ alignment: Alignment) Modifies the alignment of the page dots. πŸ‘† πŸ‘‡
.navigationOrientation(_ orientation: UIPageViewController.NavigationOrientation) Modifies the navigation orientation of the page view. ↔️ ↕️
.disableBounce(_ disable: Bool) Disables the bounce settings of the page view. This is especially useful for scroll views.
.interPageSpacing(_ spacing: CGFloat) Modifies the spacing between the pages. ↔️

Install

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

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 😁

ipages's People

Contributors

alexfine avatar benjaminsage avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.