Latest 1.0.6
Homepage https://github.com/VladimirDinic/WDFlashCard
License MIT
Platforms ios 9.0
Authors

CocoaPods Compatible
License
Platform

WDFlashCard is a simple lightweight component for displaying flashcards inside iOS apps. Just add front and back view, set flashcard animation type and duration.

GitHub Logo

Installation:

Manual:

Just download source code and include WDFlashCard/WDFlashCard/WDFlashCardView.swift in your project.

CocoaPods:

target '<TargetName>' do
    use_frameworks!
    pod 'WDFlashCard'
end

Usage

Add UIView to storyboard or Xib file and set WDFlashCard as its class. Also, add two views inside this WDFlashCard view to use them as a back and front view for flash card view. Then set WDFlashCardDelegate (using interface builder or in code) and implement its metods: flipBackView to set back view and flipFrontView to set front view.

class ViewController: UIViewController, WDFlashCardDelegate {

    @IBOutlet weak var backView: UIView!
    @IBOutlet weak var frontView: UIView!
    @IBOutlet weak var flashCard: WDFlashCard!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        flashCard.duration = 2.0
        flashCard.flipAnimation = .flipFromLeft
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    //MARK: WDFlashCardDelegate methods

    func flipBackView(forFlashCard flashCardView: WDFlashCard) -> UIView {
        return backView
    }

    func flipFrontView(forFlashCard flashCardView: WDFlashCard) -> UIView {
        return frontView
    }
}

If you want to disable tap to flip option, you can set flashCard.disableTouchToFlipFesture to true (By default, it is set to true).

flashCard.disableTouchToFlipFesture = true

In that case, you are still able to flip this view. All you need to do is to call flip() method from wherever you need:

flashCard.flip()

For better understanding look at the source code example.

Note:

If you find any bug, please report it, and I will try to fix it ASAP.

Latest podspec

{
    "name": "WDFlashCard",
    "platforms": {
        "ios": "9.0"
    },
    "version": "1.0.6",
    "summary": "WDFlashCard is a simple lightweight component for displaying flashcards inside iOS apps.",
    "description": "WDFlashCard is a simple lightweight component for displaying flashcards inside iOS apps. Just add front and back view, set flashcard animation type and duration.",
    "homepage": "https://github.com/VladimirDinic/WDFlashCard",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vladimir Dinic": "[email protected]"
    },
    "source": {
        "git": "https://github.com/VladimirDinic/WDFlashCard.git",
        "tag": "1.0.6"
    },
    "source_files": "WDFlashCard/WDFlashCard/WDFlashCardView.swift",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This