Skip to content
A new generation of Alert View with fluid design
Swift Objective-C Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
PokerCard.xcodeproj
PokerCard.xcworkspace
Sources
Tests
.gitignore
.travis.yml
LICENSE
Package.swift
PokerCard.podspec
README.md

README.md

A new generation of Alert View with fluid design

Preview

poker-alert-preview

Basic Usage

import PokerCard

class ViewController: UIViewController {
    override viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        // present a poker card 
        PokerCard.showAlert(title: "Please notice").confirm {
            // do something ...
        }
    }
}

PokerAlertView

poker-alert

PokerCard.showAlert(title: "Please notice", detail: "Here is some descripttion ...")

poker-laert-detail

Or if you want some customization on the Confirm button.

let detailInfo = "You may configure the alert it as following"
PokerCard.showAlert(title: "The Alert Title", detail: detailInfo)
    .confirm(title: "Done", style: .default, fill: false) {
        // do something
    }

PokerInputView

Default

poker-input

PokerCard.showInput(title: "Please input your name")
    .confirm(title: "Done", style: .color(.systemPink)) { inputText in 
        print("Hey, \(inputText)!")
    }

Promotion

pker-promotion

let warningInfo = "Some long paragraph of text"
PokerCard.showPromotion(title: "Notice", promotion: warningInfo)
    // modify the promotion preference 
    .appearance(promotionStyle: .color(.systemPink))
    // validate the input string
    .validate { $0.count == 11 }
    // confirm handler 
    .confirm { inputText in 
        print(inputText)
    }

PokerAppearanceView

poker-appearance

PokerCard.showAppearanceOptions()
    .config(light: {
        print("light selected")
    }, dark: {
        print("dark selected")
    }) {
        print("auto selected")
    }

PokerContactView

poker-contact

PokerCard.showContacts()
    .config(with: [
        .email("mail"),
        .message("your icloud email"),
        .wechat("your wechat id", wechatLogoImage),
        .weibo(weiboURL, weiboImage),
        .github("github address", githubImage)
    ], on: self)

PokerLanguageView

poker-lang

PokerCard.showLanguagePicker()
    .config(en: {
        print("en selected")
    }, zh: {
        print("zh selected")
    }) {
        print("auto selected")
    }
You can’t perform that action at this time.