Latest 0.1.3
Homepage https://github.com/charlymr/IRLInfiniteScrollView
License GNU GENERAL PUBLIC LICENSE. Denis Martin. Luxembourg
Platforms ios 8.0
Authors

An Infinite UIScrollView.

Demo

A very simple to implement infinite scrolling effect to UIScrollView. You can either use the subclass or the extension provided to UIScrollView if you don’t want to subclass.

MINIMUM iOS REQUIREMENT: 8.0

This Project use Swift

Licence

Installation

The recommended approach for installing IRLDocumentScanner is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation. For best results, it is recommended that you install via CocoaPods >= 0.19.1 using Git >= 1.8.0 installed via Homebrew.

via CocoaPods

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Change to the directory of your Xcode project, and Create and Edit your Podfile and add RestKit:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
platform :ios, '8.0'
pod 'IRLInfiniteScrollView', '~> 0.1'

Manually

  • Download IRLInfiniteScrollView
  • Copy to your project this file: IRLInfiniteScrollView.swift
  • Make sure your project link to ‘Foundation’, ‘UIKit’

Getting Started

IRLInfiniteScrollView is designed to be a flexible drop in dependency.

You can either use the provided sublcass IRLInfiniteScrollView or the extension to UIScrollView

Examples

Swift using the provided IRLInfiniteScrollView subclass


    @IBOutlet weak var scrollView: IRLInfiniteScrollView!

    //MARK: View Life cycle

    override func viewDidLoad() {
        super.viewDidLoad()

        let subviews   = someCustomUIViewElements()
        scrollView.delegate = self
        scrollView.setupInfiniteScroll(subviews: subviews, beforeMargin: 10, afterMargin: 10)

    }

    //MARK: UIScrollViewDelegate

    func scrollViewDidScroll(scrollView: UIScrollView) {

        if let infiniteScrollView = scrollView as? IRLInfiniteScrollView {
            infiniteScrollView.reoderScrollingStack()
        }
    }

    func scrollViewDidEndDecelerating(scrollView: UIScrollView) {

        // Optional move the view
        if let infiniteScrollView = scrollView as? IRLInfiniteScrollView {
            infiniteScrollView.moveScrollToNearestCard()
        }
    }

Swift using the UIScrollView extension


    @IBOutlet weak var scrollView: UIScrollView!

    var subviews = [UIView]()

    //MARK: View Life cycle

    override func viewDidLoad() {
        super.viewDidLoad()

        subviews   = someCustomUIViewElements()
        scrollView.delegate = self
        scrollView.setupInfiniteScroll(subviews: subviews, beforeMargin: 10, afterMargin: 10)

    }

    //MARK: UIScrollViewDelegate

    func scrollViewDidScroll(scrollView: UIScrollView) {
        scrollView.reoderScrollingStack(subviews: subviews, subviewsWidth: 750/2, beforeMargin: 10, afterMargin: 10)
    }

    func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
        // Optional move the view
        scrollView.moveScrollToNearestCard(750/2, beforeMargin: 10, afterMargin: 10)
    }

Authors

Open Source

  • Feel free to fork and modify this code. Pull requests are more thant welcome!

License

The MIT License (MIT)

Copyright (c) 2016 Denis Martin.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Latest podspec

{
    "name": "IRLInfiniteScrollView",
    "version": "0.1.3",
    "summary": "An infinite ScrollView.",
    "description": "A very simple to implement an infinite scrolling effect to UIScrollView. You can either use the subclass or the extension provided to UIScrollView if you don't want to subclass.",
    "license": {
        "type": "GNU GENERAL PUBLIC LICENSE. Denis Martin. Luxembourg",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/charlymr/IRLInfiniteScrollView",
    "authors": {
        "Denis Martin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/charlymr/IRLInfiniteScrollView.git",
        "branch": "master",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "default_subspecs": "Default",
    "subspecs": [
        {
            "name": "Default",
            "source_files": [
                "Source",
                "Source/**/*.{h,m,swift}"
            ],
            "ios": {
                "frameworks": [
                    "Foundation",
                    "UIKit"
                ]
            },
            "requires_arc": true
        }
    ]
}

Pin It on Pinterest

Share This