Giter Club home page Giter Club logo

cardslider's Introduction

CARD SLIDER

UI controller that allows you to swipe through cards with pictures.


We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Stay tuned for the latest updates:


Twitter Donate

Requirements

  • iOS 11.0+
  • Xcode 10.0+

Installation

Use CocoaPods with Podfile:

pod 'CardSlider'

or Carthage users can simply add CardSlider to their Cartfile:

github "Ramotion/CardSlider"

Then import the module in your code:

import CardSlider

Usage

  1. Declare a card model, implementing CardSliderItem protocol:
public protocol CardSliderItem {
	var image: UIImage { get }
	var rating: Int? { get }
	var title: String { get }
	var subtitle: String? { get }
	var description: String? { get }
}
  1. Implement CardSliderDataSource methods in your class:
public protocol CardSliderDataSource: class {
	func item(for index: Int) -> CardSliderItem
	func numberOfItems() -> Int
}
  1. Create an instance of CardSliderViewController with the data source:
guard let dataSource = someObject as? CardSliderDataSource else { return }
let cardSlider = CardSliderViewController.with(dataSource: dataSource)
  1. Set the title and present:
cardSlider.title = "Movies"
present(cardSlider, animated: true, completion: nil)

๐Ÿ“„ License

Card Slider is released under the MIT license. See LICENSE for details.

This library is a part of a selection of our best UI open-source projects.

If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com

๐Ÿ“ฑ Get the Showroom App for iOS to give it a try

Try this UI component and more like this in our iOS app. Contact us if interested.



cardslider's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardslider's Issues

Which functions are responsible for the zooming in?

Which functions are responsible for zooming in the photo and bringing up the description when the image is tapped. Also which functions are responsible for going back to the normal view when you swipe down the when the description is shown.

Add update for iOS 13

iOS 13 supports native dark mode and this repo's demo project will put up a white background irrespective of the device's theme settings. This causes the text to become invisible when the user is on dark mode since the background color becomes white and so does the label color.

How to delete a item

I tried to delete a cell from collection view on didSelect method. But I had get a crash:[self.collectionView performBatchUpdates:^{ [self.movies removeObjectAtIndex:0]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; } completion:^(BOOL finished) { NSLog(@"finished"); }];
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

example keeps crashing

I tried running the example project that you guys provide and it always results in a crash. I also tried using the pod in my personal projects and it resulted in a crash. Can you guys look into it for a bug..?

What is the Datasource object?

Hi, im new to Xcode. And I'm asking me what the DataSource object is.

` guard let dataSource = test as? CardSliderDataSource else { return }
let cardSlider = CardSliderViewController.with(dataSource: dataSource)

    cardSlider.title = "Movies"
    present(cardSlider, animated: true, completion: nil)
    
    `

How to update data?

hello,
thanks for the beautiful UI of collectionview, saves a lot of time for me.

How can I update the data in the collectionview? m using my data which I'm getting from the API. I want to update the data source to show the updated data.
regards.

NSInternalInconsistencyException when dismiss CardSliderViewController

some times I receive this exception when dismiss CardSliderViewController:

"Property animators must either finish animating or be explicitly stopped and finished before they can be released."

i suppose the exception is about animator property of CardTitleView

Any help?
thank you

does not work on iPad

I tried the demo on iPad, but there are size issues...cells and collectionview are far too small

[!] Unable to find a specification for 'CardSlider'

Hey,

Thanks for your awesome repo. ๐Ÿ‘Œ๐Ÿผ

I tried a lot to install the pod but I got this error:

[!] Unable to find a specification for 'CardSlider'

I tried the following:

pod repo remove master 
pod setup 
pod install

But still same error!

Any solution?

How can I dismiss the cardslider?

In iOS13, if I present the cardslider by defining
cardSlider.modalPresentationStyle = .fullScreen
How can I get back to the master view controller?
If I use something like
cardSlider.modalPresentationStyle = .automatic
It will not be displayed well.

It means either I display it well but cannot get back,
or it shows up with the layout totally messed up.

Does anybody else have the same problem?

Scroll left for more cards, Insert item at the beggining?

When I try to do something like this:

self.movies.insert(newMovie, at: 0)
self.collectionView.insertItems(at: [IndexPath(item: 0, section: 0)])
self.collectionView.collectionViewLayout.invalidateLayout()
self.collectionView.layoutIfNeeded()

I get that card on top of the first one, it has a strange layout problem.
Is it possible to scroll left for more cards?

Running the demo returns error

the object movies return error:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

when running the program, not sure why

Crash

Hey,

Afterpod install still we can't use this repo. app crashed and we got the following error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle

Kindly fix it.

Crashing

I am trying to implement it with Package Dependencies but it crashes and says: "Failed to initialize CardSliderViewController".
Any ideas? Thanks again.

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.