Awesome iOS 11 appstore cards in swift 5.

Overview

GitHub Stars Pod Version Platform License

Overview

Cards brings to Xcode the card views seen in the new iOS XI Appstore.

Getting Started

Storyboard

  • Go to main.storyboard and add a blank UIView
  • Open the Identity Inspector and type 'CardHighlight' the 'class' field
  • Make sure you have 'Cards' selected in 'Module' field
  • Switch to the Attributes Inspector and configure it as you like.

CardViewStoryboard

  • Drag a blank UIViewController and design its view as you like
  • Move to the Identity inspector
  • Type 'CardContent' in the StoryboardID field.

DetailViewStoryboard

Code

import Cards

// Aspect Ratio of 5:6 is preferred
let card = CardHighlight(frame: CGRect(x: 10, y: 30, width: 200 , height: 240))

card.backgroundColor = UIColor(red: 0, green: 94/255, blue: 112/255, alpha: 1)
card.icon = UIImage(named: "flappy")
card.title = "Welcome \nto \nCards !"
card.itemTitle = "Flappy Bird"
card.itemSubtitle = "Flap That !"
card.textColor = UIColor.white
    
card.hasParallax = true
    
let cardContentVC = storyboard!.instantiateViewController(withIdentifier: "CardContent")
card.shouldPresent(cardContentVC, from: self, fullscreen: false)
    
view.addSubview(card)

GetStarted

Prerequisites

  • Xcode 10.2 or newer
  • Swift 5.0

Installation

Cocoapods

use_frameworks!
pod 'Cards'

Manual

  • Download the repo
  • ⌘C ⌘V the 'Cards' folder in your project
  • In your Project's Info go to 'Build Phases'
  • Open 'Compile Sources' and add all the files in the folder

Overview

Customization

//Shadow settings
var shadowBlur: CGFloat
var shadowOpacity: Float
var shadowColor: UIColor
var backgroundImage: UIImage?
var backgroundColor: UIColor

var textColor: UIColor 	//Color used for the labels
var insets: CGFloat 	//Spacing between content and card borders
var cardRadius: CGFloat //Corner radius of the card
var icons: [UIImage]? 	//DataSource for CardGroupSliding
var blurEffect: UIBlurEffectStyle //Blur effect of CardGroup

Usage

CardPlayer

let card = CardPlayer(frame: CGRect(x: 40, y: 50, width: 300 , height: 360))
card.textColor = UIColor.black
card.videoSource = URL(string: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
card.shouldDisplayPlayer(from: self)    //Required. 
        
card.playerCover = UIImage(named: "mvBackground")!  // Shows while the player is loading
card.playImage = UIImage(named: "CardPlayerPlayIcon")!  // Play button icon
        
card.isAutoplayEnabled = true
card.shouldRestartVideoWhenPlaybackEnds = true
        
card.title = "Big Buck Bunny"
card.subtitle = "Inside the extraordinary world of Buck Bunny"
card.category = "today's movie"
        
view.addSubview(card)

CardGroupSliding

    let icons: [UIImage] = [    
    
        UIImage(named: "grBackground")!,
        UIImage(named: "background")!,
        UIImage(named: "flappy")!,
        UIImage(named: "flBackground")!,
        UIImage(named: "icon")!,
        UIImage(named: "mvBackground")!
    
    ]   // Data source for CardGroupSliding
    
    let card = CardGroupSliding(frame: CGRect(x: 40, y: 50, width: 300 , height: 360))
    card.textColor = UIColor.black
    
    card.icons = icons
    card.iconsSize = 60
    card.iconsRadius = 30
    
    card.title = "from the editors"
    card.subtitle = "Welcome to XI Cards !"

    view.addSubview(card)

Documentation

See the Wiki, to learn in depth infos about Cards.
GO!

Issues & Feature requests

If you encounter any problems or have any trouble using Cards, feel free to open an issue. I'll answer you as soon as I see it.

New features, or improvements to the framework are welcome (open an issue).

Thanksto

License

Cards is released under the MIT License.

Comments
  • Display and animation issues on iOS 12

    Display and animation issues on iOS 12

    I'm pretty sure you have noticed by now, but when using cards (at least CardArticle) on iOS 12, several things go horribly wrong, beginning with text that's displayed darker than it should be to severe bounds and animation issues.

    I really don't know where to start honestly, so I took a short screen capture to show what exactly I mean (https://youtu.be/SHeDv5e89C8)

    I hope you can resolve the issue soon, looking forward to a response :)

    bug 
    opened by Medwe 37
  • Card Animation Return Glitchy

    Card Animation Return Glitchy

    ezgif com-optimize

    When creating a Card on my own application as well as running the demo project I noticed that whenever one "swipes away" a Card it goes to the top left corner of the display for about 2 seconds and then returns abruptly to it's original position. Is this intentional? or am I the only one experiencing this?

    Edit: I added a gif to show this in action. Also, this same bug persists inside both the emulator, real device (iPhone 7 iOS 12). And I even downloaded your demo project to see if it was just my implementation but the problem exists in the demo as well. It happens everytime and it looks terrible, thinking of removing the whole card functionality and just have it segue into another ViewController at this point.

    opened by EliteByte 27
  • UITableView in DetailView

    UITableView in DetailView

    A Reopen of case #31 Hi, I've tried to implement a UITableView inside the DetailView but as mention in #31 the scroll acts up and it doesn't function the way it should.

    I tried disabling the scroll on the table view and yes that does make the scroll work properly but then when I scroll to the bottom it's cutting off the tableview as in it's not resizing to the height of the tableview.

    I want to achieve something like: 34078976-3ca3549c-e367-11e7-9b7e-79a522ec35e8

    This is what the result is: iph_git_cards

    The table view should show all the way until Row:2 Section:5 but it is cut off.

    Any help would be much appreciated. Thanks in advanced.

    opened by zaccadams 11
  • Tableview bug - After open 3-4 cells, the detailedView is empty

    Tableview bug - After open 3-4 cells, the detailedView is empty

    Hi,

    I really love this project! I have a issue, after opened up some few cells, the detailedView is empty. See the gif for example. This example is from the Demo.

    TableViewIssue2

    How can i fix this?

    Thanks

    bug 
    opened by asbis 9
  • Dismiss detailViewController on iOS 13 Simulators

    Dismiss detailViewController on iOS 13 Simulators

    Hi Paolo There's a bug compiling with Xcode 11 beta and iOS 13 beta ...

    The cards open correctly but when you close the detail view the screen becomes black and there is no way to do anything more

    In addition, opening the CardPlayer causes the app to crash.

    *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<Player.Player: 0x1040b0800> should have parent view controller:<ViewController.DetailViewController: 0x103332d30> but actual parent is:<MyProject.CardsViewController: 0x103320520>'

    Thank you so much for your valuable work

    Vanni

    bug 
    opened by Ragazzetto 8
  • Failed to build Objective-C

    Failed to build Objective-C

    When importing Cards it just says 'Failed to build objective-C library'. Im running the latest xcode and swift versions. Please help as I really want to use this awesome pod!

    bug 
    opened by thijsheijden 7
  • Questions about cards

    Questions about cards

    Hi Paolo, I have three questions for you. 1. Is it possible to hide the "VIEW" button on the card in this release of Cards? 2. Is it possibile show the card content inside a frame with each corner rounded (not just the upper corners)? 3. Is it possible hide the X button inside the card content view? Is there the possibility to add a custom way to dismiss the card content? Thanks

    opened by ghost 6
  • Cards DetailView not showing up correctly when using with UICollectionView

    Cards DetailView not showing up correctly when using with UICollectionView

    Hello, I am making UI just like iOS11 app store, using Cards and Detailview with UICollectionView. I 've tried like the attached file, But..

    It shows the DetailView well first a few tapping, but after loading and dismissing a few times the detailviews with swiping the collectionviewcells, the detailview does not show up correctly. I guess indexPaths are being messed up after that. And maybe it's concerned with the dequeueReusableCell..

    Please check my code. Thanks a lot. CardDemo.zip

    opened by seongki1 6
  • CardPlayer Card not loading

    CardPlayer Card not loading

    Thanks for your efforts to share with us these amazing Pods. I encountered none problem with the CardPlayer Card. It is not loaded when view is loaded. Even in your demo project there is this issue. If one clicks in the white area where the card should be it pops up and is then visible. Seems that the card infos are not being loaded.

    Has someone a solution for me?

    opened by wirnico 5
  • Card content offset in iPhoneX safezone

    Card content offset in iPhoneX safezone

    ((https://user-images.githubusercontent.com/42987961/45067342-042d7780-b0c3-11e8-99a8-21e8640f2273.gif))

    hi how can I solve the problem of the superior zone when the card content show

    bug 
    opened by federico2390 5
  • TableView Issues

    TableView Issues

    I have cards working as TableViewCell's and they are working fine apart from two major issues.

    1. When you dismiss the card, and it returns to its place in the TableView it is often misaligned or has adjusted its size strangely.

    Notice the third cell misaligned

    1. After opening and dismissing Cards in the TableView, eventually, the cards stop presenting the view controller content. Like this:

    Working screen shot 2018-06-11 at 11 51 21 am Stops Presenting screen shot 2018-06-11 at 11 52 10 am

    opened by asikand-view 5
  • IOS14 XCODE BETA 4 : Return black screen after dismiss CardView

    IOS14 XCODE BETA 4 : Return black screen after dismiss CardView

    Hi there, Version : Xcode 12 beta4 with IOS 14 Issue : Return to black screen after dismiss detail view tried to change cardContentVC.modalPresentationStyle = (.fullScreen) but not working for me

    opened by WhiteAvocad0 5
  • Crash when player card is tapped for fullscreen effect

    Crash when player card is tapped for fullscreen effect

    Hello. Ty again for the great app. I noticed there is a crash on iPhone 11 in the simulator when clicking the player video card to go full screen. The crash error is.

    'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<Player.Player: 0x7fcd6898aa00> should have parent view controller:<Cards.DetailViewController: 0x7fcd67d781e0> but actual parent is:<Superapps.PlayerViewController: 0x7fcd67d67490>'

    any ideas, guys?

    opened by tonycrencren 0
  • Crash!

    Crash!

    When clicking on one view, it suddenly froze and went to app delegate. I couldn't move or touch the screen. Other views made the app go black. Why is this?

    opened by JohnCassavetes 1
  • How to Support Dark Mode

    How to Support Dark Mode

    Hi, I'm relatively new to ios development and I love the cards so far. I was just wondering the best way to implement dark mode. My issue right now is that I have a CardHighlight on a black background, and when I press on the card to open the CardContent, during the animation of the card opening the original black background fades to a white. Furthermore, if dark mode is turned on while the app is running, the background of CardContent does not adapt to this change until the animation is over. So for example if my simulator is in light mode, then I build and run my app, and then I press on the card, it opens CardContent with no issues. But say I then go to enable dark mode on the simulator and then press the card to open it, the CardContent remains white until the animation is finished, and only then becomes black. I have attached my project files. Thanks for your help!

    Test.zip

    opened by artemas-radik 0
  • New update turns the view black after closing the view

    New update turns the view black after closing the view

    Hi

    I just updated my app with the newest update to this project. Now, when i close a card, the screen turns black.

    I also tried it with the demo app, and it also turns itself black. I am looking into the issue. And will post update as soon as i have found the bug. But if you have found it, let me know.

    opened by asbis 3
Releases(1.4.0)
Owner
Paolo Cuscela
Paolo Cuscela
A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS.

?? CardStack A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS. Installation Xcode 11 & Swift Package Manager Use the package r

Deniz Adalar 285 Jan 3, 2023
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS.

KolodaView Check this article on our blog. Purpose KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS. It adds

Yalantis 5.2k Jan 2, 2023
A swift SDK to help you scan debit/credit cards.

SKCardReader A swift SDK to help you scan debit/credit cards. Requirements To use the SDK the following requirements must be met: Xcode 11.0 or newer

Syed Kashan 4 Jul 29, 2022
Swift Package to download Transactions for LunchOnUs Cards

LunchOnUs Downloader What This is a small library to download transaction and balance data for LunchOnUs Cards (Giftcards by Eigen Development). How C

Steffen Kötte 0 Jan 15, 2022
A navigation controller that displays its view controllers as an interactive stack of cards.

CardNavigation The easiest way to turn a navigation controller into an interactive stack of cards. Highlights ✅ Fully interactive and interruptible ✅

James Randolph 41 Sep 29, 2022
Card-based view controller for apps that display content cards with accompanying maps, similar to Apple Maps.

TripGo Card View Controller This is a repo for providing the card-based design for TripGo as well as the TripKitUI SDK by SkedGo. Specs 1. Basic funct

SkedGo 6 Oct 15, 2022
Swipe able, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI

Swipable, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI Сocoapods installation Add in your Podfile: po

Indy 850 Nov 17, 2022
Presenting timelines as cards, single or bundled in scrollable feed!

TimelineCards ?? Autogenerated timelines presented as cards ?? ?? Single or bundled into feed ?? Installation CocoaPods (wtf is that?) Add pod 'Timeli

0xNSHuman 428 Dec 16, 2022
🃏 Cardslider is a design UI controller that allows you to swipe through cards with pictures and accompanying descriptions.

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

Ramotion 1.2k Dec 19, 2022
A SwiftUI view that arranges its children in a whimsical interactive deck of cards, as seen in Big News

CardStack A SwiftUI view that arranges its children in a whimsical interactive deck of cards. CardStack mimics the behaviour of the photo stack in iMe

The Not So Big Company 74 Dec 13, 2022
Presenting timelines as cards, single or bundled in scrollable feed!

TimelineCards ?? Autogenerated timelines presented as cards ?? ?? Single or bundled into feed ?? Installation CocoaPods (wtf is that?) Add pod 'Timeli

0xNSHuman 428 Dec 16, 2022
Awesome looking Dial like card selection ViewController

KVCardSelectionVC Awesome looking Dial like card selection ViewController An updated Swift 3 working version of : https://github.com/atljeremy/JFCardS

Kunal Verma 23 Feb 1, 2021
A reactive, card-based UI framework built on UIKit for iOS developers.

CardParts - made with ❤️ by Intuit: Example Requirements Installation Communication & Contribution Overview Quick Start Architecture CardsViewControll

Intuit 2.5k Jan 4, 2023
A SwiftUI based custom sheet card to show information in iOS application.

A SwiftUI based custom sheet card to show any custom view inside the card in iOS application.

Mahmud Ahsan 4 Mar 28, 2022
An iOS library to create beautiful card transitions.

CSCardTransition CSCardTransition is a small library allowing you to create wonderful push and pop transition animations like in the App Store. It wor

Creastel 5 Jan 14, 2022
IOS Card Game - A simple card game using SwiftUI

IOS_Card_Game A simple card game using Swift UI.

Md. Masum Musfique 1 Mar 25, 2022
A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.

VerticalCardSwiper A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift. Project goal and information The goal o

Joni Van Roost 1.2k Dec 28, 2022
Awesome iOS 11 appstore cards in swift 5.

Cards brings to Xcode the card views seen in the new iOS XI Appstore. Getting Started Storyboard Go to main.storyboard and add a blank UIView Open the

Paolo Cuscela 4.1k Dec 14, 2022
Awesome iOS 11 appstore cards in swift 5.

Cards brings to Xcode the card views seen in the new iOS XI Appstore. Getting Started Storyboard Go to main.storyboard and add a blank UIView Open the

Paolo Cuscela 4.1k Dec 14, 2022
Appstore-Review-Guidelines - A curated list of guideline which has to be taken care before submitting your application to Appstore.

Appstore Review Guidelines The App Review Guidelines provide rules and examples across a range of topics, including user interface design, functionali

Aashish Tamsya 14 Dec 16, 2022