Skip to content
A playing card UI library for iOS
Branch: master
Clone or download
finiteloop Merge pull request #1 from tomnewton/master
Support for larger cards
Latest commit d95790f Nov 9, 2013
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Add LICENSE file Nov 2, 2013 Better screenshots Nov 2, 2013

iOS Card UI Library


I like making card games for iOS for my friends and family. When I started doing this, I noticed that there were no nice libraries available for rendering attractive looking playing cards. Furthermore, the few that I found used static images for cards, which is frustrating when you, e.g., want to render different card sizes on iPhones and iPads.

I found a nice open source package of playing cards in vector format (, but iOS has limited support for vector graphics.

To work around these issues, I modified the playing card graphics to be pages in a PDF document and use the native PDF rendering capabilities in iOS to render the playing cards at any resolution.

This library is the end result of that series of hacks, and I hope it will be useful to other folks making card games for iOS.


Draw a single card:

CGFloat width = 100;
CGFloat height = [CardView heightForWidth:width];
CardView *cardView = [[CardView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
cardView.card = [[Card alloc] initWithSuit:Hearts number:King];

See all the cards in a grid:

[self.navigationController pushViewController:[CardsController new]];


Drawn a simple grid at a couple different sizes:




This library is available under the Apache License, Version 2.0 (

The library includes card images released under the LGPL. See

You can’t perform that action at this time.