Latest 1.1.0
License MIT
Platforms ios 9.0
Dependencies SDWebImage

CI Status


A view that changes the content by selecting a card. Content can be customized, but images are essential.
You can change the card by clicking on it or by swiping up and down gestures.




* Swift 4.2
* XCode 10.0
* iOS 9.0 (Min SDK)


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

//Add Podfile
pod "SCCardView" //Swift 4.2
pod "SCCardView", '-> 1.0.0' //Swift 4.0
pod "SCCardView", '~> 0.2.0' //Swift 3.0

pod install

How To Use

If you use a URL, you can set the key value to "url". But "image" is a required parameter. If you use "url", the value of the "image" key will be entered into the placeholder image if it can be empty. The URL image is rendered dependent on SDWebImage.

import SCCardView

// Int index, [String: String] key, Value
// Make dummy data (Necessary key Image Card UI)
let dummyData: [Int: [String: Any]] = [0: ["image": UIImage()!,
                                          "title": "Catholic Church",
                                          "url": "",
                                          "description": "Maybe famous Catholic Churchsadl"],
                                       1: ["image": UIImage(named: "sc1")!,
                                           "title": "Beautiful Sea",
                                           "description": "Beautiful sea anywhere on earth"],
                                       2: ["image": UIImage(named: "sc2")!,
                                          "title": "Famous temple",
                                           "description": "A landscape of famous temple"],
                                       3: ["image": UIImage(named: "sc3")!,
                                          "title": "Pretty Flower",
                                          "description": "Pretty Flowernphoto  by myoung father"],
                                       4: ["image": UIImage(named: "sc4")!,
                                          "title":"Vast Sky",
                                          "description": "Vast korea skynphoto by myoung father"],
                                       5: ["image": UIImage(named: "sc5")!,
                                          "title": "Leaf",
                                          "description":"Leaf anywhere on Koreanphoto by myoung father"]]

sccard.delegate = self
sccard.cardStyle = .onlyTop
//if cardstyle round cutom
 sccard.cardStyle = .custom
 sccard.initCustomCardStyle([.topLeft, .bottomRight])

// Set initial value
if let dicSubData: [String: Any] = dummyData[0] {
    if let img: UIImage = dicSubData["image"] as? UIImage,
        let title: String = dicSubData["title"] as? String,
        let des: String = dicSubData["description"] as? String {
        sccardSubImg.image = img
        sccardSubTitle.text = title
        sccardSubDes.text = des
// Autolayout bottom card ratio
contBottomDes.constant = sccard.bottomInterval

// Delegate
// Selector Card Click. Required Delegate
func SCCardSelectorCard(_ index: Int, dic: [String: Any]) {
    if let img: UIImage = dic["image"] as? UIImage,
        let title: String = dic["title"] as? String,
        let des: String = dic["description"] as? String {
        sccardSubImg.image = img
        sccardSubTitle.text = title
        sccardSubDes.text = des

// Refresh content view from down image. Required Delegate
func SCCardURLIndexRefresh(_ img: UIImage) {
    sccardSubImg.image = img

// Card Down Gesture. optional Delegate
internal func SCCardDownCardAction(_ indexPath: IndexPath) {
    print("down gesture (indexPath)")

// Card Up Gesture. optional Delegate
internal func SCCardUpCardAction(_ indexPath: IndexPath) {
    print("up gesture (indexPath)")




[email protected]


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

Latest podspec

    "name": "SCCardView",
    "version": "1.1.0",
    "summary": "Selector card to change content view",
    "description": "Selector card to change content view.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "myoung": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "platforms": {
        "ios": "9.0"
    "source_files": "SCCardView/Classes/**/*",
    "dependencies": {
        "SDWebImage": []

Pin It on Pinterest

Share This