import TicketKit
ticketView.enrollContentImage.image = UIImage(named: "qr")
ticketView.showEnrollImage()
import TicketKit
ticketView.enrollContentImage.image = UIImage(named: "soldout")
ticketView.showEnrollImage()
import TicketKit
ticketView.showPurchaseButton() // Default
import TicketKit
ticketView.hideDetailView()
Swift 4.2
& 5.0
. Ready for use on iOS 11.3+
To integrate TicketKit
into your Xcode project using CocoaPods, specify it in your Podfile:
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'TicketKit', :git => 'https://github.com/tiskender2/TicketKit.git'
end
Then, run the following terminal command:
pod install
Drag TicketKit.swift
from the source
folder into your Xcode project.
import TicketKit
@IBOutlet weak var ticketView: TicketKit!
ticketView.contentImage.image = UIImage(named: "joker")
ticketView.contentTitle.text = "Joker"
ticketView.duration.text = "2hr 2min"
ticketView.genre.text = "Drama,Action"
ticketView.rating.text = "8.5"
ticketView.price.text = "$30"
ticketView.subTitle.text = "StoryLine"
ticketView.desc.text = "desc"
ticketView.durationTitle.text = "DURATION"
ticketView.genreTitle.text = "GENRE"
// to change background Color
ticketView.topView.backgroundColor = .blue
ticketView.bottomView.backgroundColor = .blue
If you want to clipped view add below code in override func draw(_ rect: CGRect)
or override func viewDidAppear(_ animated: Bool)
ticketView.addClips(to: .topView, corner: [.bottom,.top]) // default no clip
ticketView.setupDashedLine(fillColor: UIColor.blue.cgColor) // to change dashed line color, default is white
If you're using this control, I'd love hearing from you! and
don't forget to put star ★
TicketKit was originally created by Tolga İskender
TicketKit is available under the MIT license. See the LICENSE file for more info.