Giter VIP home page Giter VIP logo

pagedhorizontalview's Introduction

PagedHorizontalView

Version License Platform

Supports Swift 3

A horizontal scoller view that makes its collection view cells full screen and can optionally wire UIPageControl and a previous and next UIbuttons.

It doesn't affect the appearance of the controls and doesn't implement the collection view data source to keep full flexibility while doing the repeated work for a horizontal scroller.

Requirements

  • iOS 7.0+ / Mac OS X 10.9+
  • Xcode 8.0
  • Swift 3.0

Usage

Interface builder:
  1. Drag and drop a UIView.
  2. Change the class name to PagedHorizontalView from identity inspector. Step 2
  3. Drag and drop a UICollectionView, use the defaults.
  4. Optionally drag and drop a UIPageControl
  5. Optionally drag and drop 2 UIButtons for next and previous
  6. Wire the UICollectionView to the PagedHorizontalView Step 4
  7. Wire the UIPageControl to the PagedHorizontalView either the reference outlet pageControl or the pageChanged: action. But not both.
  8. Wire the 2 UIButtons either the reference outlet nextButton and previousButton or touch up inside action with goToNextPage and goToPreviousPage. But not both, wiring the action and the reference outlet will give unexpected behavior.
Programmatically:

Alternatively, you can create it from code just as you create a normal UIView and set the properties instead of wiring them as described above for collectionView, pageControl, etc.

You need to set a layout object of kind UICollectionViewFlowLayout for the UICollectionView.

IMPORTANT

In both cases programmatically or using interface builder, you should set the dataSource for the UICollectionView yourself. This way, you have full flexibility to specify the layout of the scrolling content.

Demo

Step 4

Installation

For iOS 8 or later:

PagedHorizontalView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PagedHorizontalView"

For iOS 7.x:

Embedded frameworks require a minimum deployment target of iOS 8.

To use PagedHorizontalView with a project targeting iOS 7, you must include PagedHorizontalView.swift directly into your project.

Author

Mohamed Afifi, [email protected]

License

PagedHorizontalView is available under the MIT license. See the LICENSE file for more info.

pagedhorizontalview's People

Contributors

makehui avatar mohamede1945 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pagedhorizontalview's Issues

When starting the app of your example,it start from small collection cell.

First of all,Thank you so much for offering such a great library
But,I do have some problem.Don't know its bug or other.Mind take a look?

When I start load the app using my own image and your library,its start with small image cell.Then after passing 3 pages,it completely full and then page 1 and 2 become full again

Here is the project.
PagedHorizontalView-master.zip

Here is the screenshot :
collectionviewpaging_1

Would you mind help me fix this?If I did something wrong,Any help is welcome.
If I pass this problem,I will start using this library with AlamofireImage for image slide show.

get image from URL and store it in Array

I am using framework PagedHorizontalView for Swift and I am trying to save IMAGE from URL to this ARRAY for using it in COLLECTION VIEW.

let items: [(image: String, label: String)] = [
("imageAssetName", "some random stuff")]
I tried to save image as Data but i then i realized i don't know what to do with it. Can anyone help me with this?

Getting selected item index and perform action?

Was this library support that feature?
All i need is selected index path.row.

I cant get the selected index because i am not setting delegate.So,Any help to implement scroll view with delegate?Thanks

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.