All Projects → touchlane → Slidecontroller

touchlane / Slidecontroller

Licence: mit
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Slidecontroller

Tsmessages
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot
Stars: ✭ 4,927 (+1665.95%)
Mutual labels:  library, cocoapods
Keyboardhidemanager
Codeless manager to hide keyboard by tapping on views for iOS written in Swift
Stars: ✭ 57 (-79.57%)
Mutual labels:  library, cocoapods
Greedo Layout For Ios
Full aspect ratio grid layout for iOS
Stars: ✭ 837 (+200%)
Mutual labels:  library, cocoapods
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+516.49%)
Mutual labels:  cocoapods, uiscrollview
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (-63.08%)
Mutual labels:  library, cocoapods
Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (+24.01%)
Mutual labels:  library, cocoapods
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (+283.87%)
Mutual labels:  library, cocoapods
Parallaxheader
Simple way to add parallax header to UIScrollView/UITableView written in Swift.
Stars: ✭ 808 (+189.61%)
Mutual labels:  cocoapods, uiscrollview
Predicateflow
Write amazing, strong-typed and easy-to-read NSPredicate.
Stars: ✭ 98 (-64.87%)
Mutual labels:  library, cocoapods
Mscircularslider
A fully-featured, powerful circular slider for iOS applications
Stars: ✭ 94 (-66.31%)
Mutual labels:  library, cocoapods
Zoomy
Adds seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.
Stars: ✭ 130 (-53.41%)
Mutual labels:  cocoapods, uiscrollview
Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-42.29%)
Mutual labels:  library, cocoapods
Toscrollbar
An interactive scroll bar for traversing comically massive scroll views.
Stars: ✭ 90 (-67.74%)
Mutual labels:  cocoapods, uiscrollview
Shadowview
An iOS Library that makes shadows management easy on UIView.
Stars: ✭ 391 (+40.14%)
Mutual labels:  library, cocoapods
Silentscrolly
Scroll to hide navigationBar, tabBar and toolBar.
Stars: ✭ 79 (-71.68%)
Mutual labels:  cocoapods, uiscrollview
Styledecorator
Easy string decoration with styles
Stars: ✭ 17 (-93.91%)
Mutual labels:  library, cocoapods
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+1116.85%)
Mutual labels:  cocoapods, uiscrollview
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+1388.17%)
Mutual labels:  cocoapods, uiscrollview
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+322.94%)
Mutual labels:  library, cocoapods
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+3422.94%)
Mutual labels:  library, cocoapods

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 }

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].