ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - touchlane/SlideController: Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.  - GitHub - touchlane/SlideController: Swipe between pages with...
Visit Site

GitHub - touchlane/SlideController: Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

GitHub - touchlane/SlideController: Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

LOGO

Language Build Status codecov.io Version License Platform

SlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageViewController.

Horizontal Vertical Carousel

Requirements

  • iOS 9.0+
  • Xcode 10.2+
  • Swift 5.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SlideController into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SlideController'
end

Then, run the following command:

$ pod install

Usage

import SlideController
  1. Create content
let content = [
            SlideLifeCycleObjectBuilder<PageLifeCycleObject>(),
            SlideLifeCycleObjectBuilder<PageLifeCycleObject>(),
            SlideLifeCycleObjectBuilder<PageLifeCycleObject>()
        ]
  • PageLifeCycleObject is any object conforms to Initializable, Viewable, SlidePageLifeCycle protocols
  1. Initialize SlideController
slideController = SlideController<CustomTitleView, CustomTitleItem>(
    pagesContent: content,
    startPageIndex: 0,
    slideDirection: .horizontal)
  • CustomTitleView is subclass of TitleScrollView<CustomTitleItem>
  • CustomTitleItem is subclass of UIView and conforms to Initializable, ItemViewable, Selectable protocols
  1. Add slideController.view to view hierarchy

  2. Call slideController.viewDidAppear() and slideController.viewDidDisappear() in appropriate UIViewController methods:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    slideController.viewDidAppear()
}
override func viewDidDisappear(_ animated: Bool) {
   super.viewDidDisappear(animated)
   slideController.viewDidDisappear()
}

Documentation

SlideController

Default initializer of SlideController.
pagesContent - initial content of controller, can be empty.
startPageIndex - page index that should be displayed initially.
slideDirection - slide direction. .horizontal or .vertical.

public init(pagesContent: [SlideLifeCycleObjectProvidable],
            startPageIndex: Int = 0,
            slideDirection: SlideDirection)

Returns titleView instanсe of TitleScrollView.

public var titleView: T { get }

Returns LifeCycleObject for currently displayed page.

public var currentModel: SlideLifeCycleObjectProvidable? { get }

Returns array of LifeCycleObject that corresponds to SlideController's content.

public private(set) var content: [SlideLifeCycleObjectProvidable]

When set to true unloads content when it is out of screen bounds. The default value is true.

public var isContentUnloadingEnabled: Bool { get set }

When set to true scrolling in the direction of last item will result jumping to the first item. Makes scrolling infinite. The default value is false.

public var isCarousel: Bool { get set }

If the value of this property is true, content scrolling is enabled, and if it is false, content scrolling is disabled. The default is true.

public var isScrollEnabled: Bool { get set }

Appends pages array of SlideLifeCycleObjectProvidable to the end of sliding content.

public func append(object objects: [SlideLifeCycleObjectProvidable])

Inserts SlideLifeCycleObjectProvidable page object at index in sliding content.

public func insert(object: SlideLifeCycleObjectProvidable, index: Int)

Removes a page at index.

public func removeAtIndex(index: Int)

Slides content to page at pageIndex with sliding animation if animated is set to true. Using forced is not recommended, it will perform shift even if other shift animation in progress or pageIndex equals current page. The default value of animated is true. The default value of forced is false.

public func shift(pageIndex: Int, animated: Bool = default, forced: Bool = default)

Slides content the next page with sliding animation if animated is set to true. The default value of animated is true.

public func showNext(animated: Bool = default)

Lets the SlideController know when it is displayed on the screen. Used for correctly triggering LifeCycle events.

public func viewDidAppear()

Lets the SlideController know when it is not displayed on the screen. Used for correctly triggering LifeCycle events.

public func viewDidDisappear()

TitleScrollView

Alignment of title view. Supports .top, .bottom, .left, .right. The default value of alignment is .top.

public var alignment: SlideController.TitleViewAlignment { get set }

The size of TitleScrollView. For .horizontal slide direction of SlideController the titleSize corresponds to height. For .vertical slide direction of SlideController the titleSize corresponds to width. The default value of titleSize is 84.

open var titleSize: CGFloat { get set }

Array of title items that displayed in TitleScrollView.

open var items: [TitleItem] { get }

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory