├── demo.gif ├── Screenshot.png ├── AMCreditCard ├── CREDC.ttf ├── Images │ ├── chip.png │ ├── card_bg.png │ ├── chip@2x.png │ ├── chip@3x.png │ ├── blackLine.png │ ├── amexCardLogo.png │ ├── blackLine@2x.png │ ├── blackLine@3x.png │ ├── card_bg@2x.png │ ├── card_bg@3x.png │ ├── signatureBg.png │ ├── visaCardLogo.png │ ├── masterCardLogo.png │ ├── signatureBg@2x.png │ ├── signatureBg@3x.png │ ├── amexCardLogo@2x.png │ ├── amexCardLogo@3x.png │ ├── discoverCardLogo.png │ ├── maestroCardLogo.png │ ├── masterCardLogo@2x.png │ ├── masterCardLogo@3x.png │ ├── visaCardLogo@2x.png │ ├── visaCardLogo@3x.png │ ├── discoverCardLogo@2x.png │ ├── discoverCardLogo@3x.png │ ├── maestroCardLogo@2x.png │ └── maestroCardLogo@3x.png ├── AMCreditCardView.swift └── AMCreditCardView.xib ├── AMCreditCardViewDemo.mp4 ├── AMCreditCardDemo ├── AMCreditCardDemo.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── AMCreditCardDemo │ ├── ViewController.swift │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ └── AppDelegate.swift ├── README.md ├── LICENSE └── .gitignore /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/demo.gif -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/Screenshot.png -------------------------------------------------------------------------------- /AMCreditCard/CREDC.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/CREDC.ttf -------------------------------------------------------------------------------- /AMCreditCardViewDemo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCardViewDemo.mp4 -------------------------------------------------------------------------------- /AMCreditCard/Images/chip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/chip.png -------------------------------------------------------------------------------- /AMCreditCard/Images/card_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/card_bg.png -------------------------------------------------------------------------------- /AMCreditCard/Images/chip@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/chip@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/chip@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/chip@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/blackLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/blackLine.png -------------------------------------------------------------------------------- /AMCreditCard/Images/amexCardLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/amexCardLogo.png -------------------------------------------------------------------------------- /AMCreditCard/Images/blackLine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/blackLine@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/blackLine@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/blackLine@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/card_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/card_bg@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/card_bg@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/card_bg@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/signatureBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/signatureBg.png -------------------------------------------------------------------------------- /AMCreditCard/Images/visaCardLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/visaCardLogo.png -------------------------------------------------------------------------------- /AMCreditCard/Images/masterCardLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/masterCardLogo.png -------------------------------------------------------------------------------- /AMCreditCard/Images/signatureBg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/signatureBg@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/signatureBg@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/signatureBg@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/amexCardLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/amexCardLogo@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/amexCardLogo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/amexCardLogo@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/discoverCardLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/discoverCardLogo.png -------------------------------------------------------------------------------- /AMCreditCard/Images/maestroCardLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/maestroCardLogo.png -------------------------------------------------------------------------------- /AMCreditCard/Images/masterCardLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/masterCardLogo@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/masterCardLogo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/masterCardLogo@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/visaCardLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/visaCardLogo@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/visaCardLogo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/visaCardLogo@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/discoverCardLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/discoverCardLogo@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/discoverCardLogo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/discoverCardLogo@3x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/maestroCardLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/maestroCardLogo@2x.png -------------------------------------------------------------------------------- /AMCreditCard/Images/maestroCardLogo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arturdev/AMCreditCardView/HEAD/AMCreditCard/Images/maestroCardLogo@3x.png -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AMCreditCardView 2 | AMCreditCardView is a iOS library that allows developers to create the UI which replicates an actual Credit Card written in Swift 3 | 4 | 5 | 6 | ### Requirements 7 | Xcode 9+
8 | iOS 10.0 +
9 | 10 | INSTALLATION 11 | ===== 12 | 13 | Copy AMCreditCard folder to your project. 14 | 15 | 16 |

LICENSE

17 | AMCreditCardView is under MIT License (see LICENSE file) 18 | 19 |

IMPORTANT NOTE

20 | Font "CREDC.ttf" used in this library is Free for Personal Use ONLY!
21 | You can buy Commercial License here 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Artur Mkrtchyan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AMCreditCardDemo 4 | // 5 | // Created by Artur Mkrtchyan on 12/6/17. 6 | // Copyright © 2017 Artur Mkrtchyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | @IBOutlet weak var creditCardView: AMCreditCardView! 14 | @IBOutlet weak var inputTextField: UITextField! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | } 19 | 20 | @IBAction func inputFieldEditingChanged(_ textField: UITextField) { 21 | if textField.placeholder == "CVV" { 22 | creditCardView.cvv = textField.text 23 | } else { 24 | creditCardView.cardNumber = textField.text 25 | } 26 | } 27 | } 28 | 29 | extension ViewController: UITextFieldDelegate { 30 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 31 | textField.text = "" 32 | if textField.placeholder == "CVV" { 33 | textField.resignFirstResponder() 34 | } 35 | textField.placeholder = textField.placeholder == "CVV" ? "Card Number" : "CVV" 36 | creditCardView.flip() 37 | return true 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AMCreditCardDemo 4 | // 5 | // Created by Artur Mkrtchyan on 12/6/17. 6 | // Copyright © 2017 Artur Mkrtchyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /AMCreditCard/AMCreditCardView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AMCreditCardView.swift 3 | // AMCreditCard 4 | // 5 | // Created by Artur Mkrtchyan on 11/30/17. 6 | // Copyright © 2017 Artur Mkrtchyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | fileprivate let kCardRatio = 1.58577 // ISO/IEC 7810 ID-1 standard 12 | fileprivate let kCornerRadius = 9.0 13 | fileprivate let kDefaultWidth = 243.0 14 | 15 | @IBDesignable 16 | open class AMCreditCardView: UIView { 17 | private var allNibs: [UIView]! 18 | private var view: UIView! 19 | private var backView: UIView! 20 | 21 | //MARK: - Font Sizes. 22 | //Consider that cardview's width is equal to 243 while setting the size of fonts 23 | open var cardNumberFontSize:CGFloat = 12.0 24 | open var cardHoldersFontSize:CGFloat = 10.0 25 | open var validThruTitleFontSize:CGFloat = 6.0 26 | open var validThruValueFontSize:CGFloat = 7.0 27 | open var cvvFontSize:CGFloat = 10.0 28 | 29 | open var shouldInsertSpacesEveryFourDigitsIntoString = true 30 | open var cardNumber:String? { 31 | didSet { 32 | guard let cardNumber = cardNumber else { 33 | self.cardNumberLabel.text = "" 34 | self.refreshCardType() 35 | return 36 | } 37 | if shouldInsertSpacesEveryFourDigitsIntoString { 38 | let cleanedNumber = cardNumber.replacingOccurrences(of: " ", with: "") 39 | self.cardNumberLabel.text = self.insertSpacesEveryFourDigitsIntoString(cleanedNumber) 40 | } else { 41 | self.cardNumberLabel.text = cardNumber 42 | } 43 | 44 | self.refreshCardType() 45 | } 46 | } 47 | 48 | open var cvv:String? { 49 | didSet { 50 | self.cvvLabel.text = cvv ?? "" 51 | } 52 | } 53 | 54 | open var cardHoldersName:String? { 55 | didSet { 56 | self.cardHoldersNameLabel.text = cardHoldersName ?? "" 57 | } 58 | } 59 | 60 | open var expirationDate:String? { 61 | didSet { 62 | self.validThruValueLabel.text = expirationDate ?? "" 63 | } 64 | } 65 | 66 | open var cardType:AMCreditCardType = .unknown { 67 | didSet { 68 | switch cardType { 69 | case .mastercard: 70 | self.cardTypeImageView.image = UIImage(named: "masterCardLogo.png") 71 | case .visa, 72 | .visaElectron: 73 | self.cardTypeImageView.image = UIImage(named: "visaCardLogo.png") 74 | case .americanExpress: 75 | self.cardTypeImageView.image = UIImage(named: "amexCardLogo.png") 76 | case .discovery: 77 | self.cardTypeImageView.image = UIImage(named: "discoverCardLogo.png") 78 | case .maestro: 79 | self.cardTypeImageView.image = UIImage(named: "maestroCardLogo.png") 80 | default: 81 | self.cardTypeImageView.image = nil 82 | } 83 | } 84 | } 85 | 86 | //MARK: - Outlets 87 | @IBOutlet weak var contentView: UIView! 88 | @IBOutlet weak var backgroundView: UIView! 89 | @IBOutlet weak var backgroundImageView: UIImageView! 90 | 91 | @IBOutlet weak var backContentView: UIView! 92 | @IBOutlet weak var backBackgroundView: UIView! 93 | @IBOutlet weak var backBackgroundImageView: UIImageView! 94 | 95 | @IBOutlet weak var chipImageView: UIImageView! 96 | @IBOutlet weak var cardNumberLabel: UILabel! 97 | @IBOutlet weak var cardTypeImageView: UIImageView! 98 | @IBOutlet weak var validThruTitleLabel: UILabel! 99 | @IBOutlet weak var validThruValueLabel: UILabel! 100 | @IBOutlet weak var cardHoldersNameLabel: UILabel! 101 | 102 | @IBOutlet weak var cvvLabel: UILabel! 103 | 104 | 105 | init() { 106 | super.init(frame: CGRect(x: 0, y: 0, width: kDefaultWidth, height: kDefaultWidth * kCardRatio)) 107 | xibLoad() 108 | setup() 109 | } 110 | 111 | override init(frame: CGRect) { 112 | super.init(frame: frame) 113 | xibLoad() 114 | setup() 115 | } 116 | 117 | required public init?(coder aDecoder: NSCoder) { 118 | super.init(coder: aDecoder) 119 | xibLoad() 120 | setup() 121 | } 122 | 123 | //MARK: - Private methods 124 | private func xibLoad() { 125 | loadViewFromNib() 126 | backView = allNibs[1] 127 | backView.frame = bounds 128 | backView.autoresizingMask = [.flexibleWidth, .flexibleHeight] 129 | addSubview(backView) 130 | backView.isHidden = true 131 | 132 | view = allNibs[0] 133 | view.frame = bounds 134 | view.autoresizingMask = [.flexibleWidth, .flexibleHeight] 135 | addSubview(view) 136 | } 137 | 138 | private func loadViewFromNib() { 139 | let bundle = Bundle(for: AMCreditCardView.self) 140 | let nib = UINib(nibName: "AMCreditCardView", bundle: bundle) 141 | allNibs = nib.instantiate(withOwner: self, options: nil) as? [UIView] 142 | } 143 | 144 | override open func layoutSubviews() { 145 | super.layoutSubviews() 146 | 147 | let multiplier = contentView.frame.size.width / 243.0 148 | reloadFont(label: cardNumberLabel, size: 12.0) 149 | reloadFont(label: cardHoldersNameLabel, size: 10.0) 150 | reloadFont(label: validThruTitleLabel, size: 6.0) 151 | reloadFont(label: validThruValueLabel, size: 7.0) 152 | reloadFont(label: cvvLabel, size: 10.0) 153 | 154 | backgroundView.layer.cornerRadius = CGFloat(kCornerRadius) * multiplier 155 | backgroundImageView.layer.cornerRadius = CGFloat(kCornerRadius) * multiplier 156 | 157 | backBackgroundView.layer.cornerRadius = CGFloat(kCornerRadius) * multiplier 158 | backBackgroundImageView.layer.cornerRadius = CGFloat(kCornerRadius) * multiplier 159 | } 160 | 161 | private func setup() { 162 | backgroundImageView.layer.masksToBounds = true 163 | backBackgroundImageView.layer.masksToBounds = true 164 | 165 | DispatchQueue.main.asyncAfter(deadline: .now() + 0) { 166 | self.setNeedsLayout() 167 | } 168 | } 169 | 170 | private func reloadFont(label: UILabel, size: CGFloat) { 171 | let multiplier = self.contentView.frame.size.width / 243.0 172 | label.font = UIFont(name: label.font.fontName, size: size * multiplier) 173 | } 174 | 175 | private func insertSpacesEveryFourDigitsIntoString(_ string: String) -> String { 176 | var result = "" 177 | for i in 0 ..< string.count { 178 | if i > 0 && (i % 4 == 0) { 179 | result += " " 180 | } 181 | result.append(string[string.index(string.startIndex, offsetBy: i)]) 182 | } 183 | 184 | return result 185 | } 186 | 187 | //MARK: - Public methods 188 | 189 | open func refreshUI() { 190 | self.setNeedsLayout() 191 | } 192 | 193 | @objc open func refreshCardType() { 194 | let cleanedNumber = (self.cardNumberLabel.text ?? "").replacingOccurrences(of: " ", with: "") 195 | self.cardType = AMCreditCardTypeChecker.checkType(cleanedNumber) 196 | } 197 | 198 | @objc open func flip() { 199 | let firstView = view.isHidden ? backView : view 200 | let secondView = view.isHidden ? view : backView 201 | 202 | let transitionOptions: UIViewAnimationOptions = [.transitionFlipFromRight, .showHideTransitionViews] 203 | 204 | UIView.transition(with: firstView!, duration: 0.5, options: transitionOptions, animations: { 205 | firstView!.isHidden = true 206 | }) 207 | 208 | UIView.transition(with: secondView!, duration: 0.5, options: transitionOptions, animations: { 209 | secondView!.isHidden = false 210 | }) 211 | } 212 | } 213 | 214 | public enum AMCreditCardType { 215 | case unknown 216 | case visa 217 | case visaElectron 218 | case mastercard 219 | case maestro 220 | case americanExpress 221 | case dinnersClub 222 | case discovery 223 | case jcb 224 | 225 | static var all: [AMCreditCardType] { 226 | return [ 227 | .visa, 228 | .visaElectron, 229 | .mastercard, 230 | .maestro, 231 | .americanExpress, 232 | .dinnersClub, 233 | .discovery, 234 | .jcb 235 | ] 236 | } 237 | 238 | var pattern: String { 239 | switch self { 240 | case .visa: return "^4[0-9]{12}(?:[0-9]{3})?$" 241 | case .visaElectron: return "^(4026|417500|4508|4844|491(3|7))" 242 | case .mastercard: return "^5[1-5][0-9]{14}$" 243 | case .maestro: return "^(5018|5020|5038|6304|6759|676[1-3])" 244 | case .americanExpress: return "^3[47][0-9]{13}$" 245 | case .dinnersClub: return "^3(?:0[0-5]|[68][0-9])[0-9]{11}$" 246 | case .discovery: return "^6(?:011|5[0-9]{2})[0-9]{12}$" 247 | case .jcb: return "^(?:2131|1800|35\\d{3})\\d{11}$" 248 | case .unknown: 249 | return "" 250 | } 251 | } 252 | } 253 | 254 | open class AMCreditCardTypeChecker { 255 | static func checkType(_ cardNumber: String) -> AMCreditCardType { 256 | for type in AMCreditCardType.all { 257 | let regexp = try? NSRegularExpression(pattern: type.pattern, options: .caseInsensitive) 258 | if let result = regexp?.matches(in: cardNumber, options: [], range: NSMakeRange(0, cardNumber.count)), result.count > 0 { 259 | return type 260 | } 261 | } 262 | 263 | return .unknown 264 | } 265 | } 266 | -------------------------------------------------------------------------------- /AMCreditCardDemo/AMCreditCardDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 75B638AA1FD7DA42008561B4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B638A91FD7DA42008561B4 /* AppDelegate.swift */; }; 11 | 75B638AC1FD7DA42008561B4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B638AB1FD7DA42008561B4 /* ViewController.swift */; }; 12 | 75B638AF1FD7DA42008561B4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 75B638AD1FD7DA42008561B4 /* Main.storyboard */; }; 13 | 75B638B11FD7DA42008561B4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75B638B01FD7DA42008561B4 /* Assets.xcassets */; }; 14 | 75B638B41FD7DA42008561B4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 75B638B21FD7DA42008561B4 /* LaunchScreen.storyboard */; }; 15 | 75B638DB1FD7DA4F008561B4 /* AMCreditCardView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B638BC1FD7DA4F008561B4 /* AMCreditCardView.xib */; }; 16 | 75B638DC1FD7DA4F008561B4 /* amexCardLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638BE1FD7DA4F008561B4 /* amexCardLogo.png */; }; 17 | 75B638DD1FD7DA4F008561B4 /* amexCardLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638BF1FD7DA4F008561B4 /* amexCardLogo@2x.png */; }; 18 | 75B638DE1FD7DA4F008561B4 /* discoverCardLogo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C01FD7DA4F008561B4 /* discoverCardLogo@3x.png */; }; 19 | 75B638DF1FD7DA4F008561B4 /* chip@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C11FD7DA4F008561B4 /* chip@2x.png */; }; 20 | 75B638E01FD7DA4F008561B4 /* chip@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C21FD7DA4F008561B4 /* chip@3x.png */; }; 21 | 75B638E11FD7DA4F008561B4 /* discoverCardLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C31FD7DA4F008561B4 /* discoverCardLogo@2x.png */; }; 22 | 75B638E21FD7DA4F008561B4 /* amexCardLogo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C41FD7DA4F008561B4 /* amexCardLogo@3x.png */; }; 23 | 75B638E31FD7DA4F008561B4 /* chip.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C51FD7DA4F008561B4 /* chip.png */; }; 24 | 75B638E41FD7DA4F008561B4 /* card_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C61FD7DA4F008561B4 /* card_bg@2x.png */; }; 25 | 75B638E51FD7DA50008561B4 /* visaCardLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C71FD7DA4F008561B4 /* visaCardLogo.png */; }; 26 | 75B638E61FD7DA50008561B4 /* masterCardLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C81FD7DA4F008561B4 /* masterCardLogo.png */; }; 27 | 75B638E71FD7DA50008561B4 /* signatureBg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638C91FD7DA4F008561B4 /* signatureBg@2x.png */; }; 28 | 75B638E81FD7DA50008561B4 /* signatureBg@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CA1FD7DA4F008561B4 /* signatureBg@3x.png */; }; 29 | 75B638E91FD7DA50008561B4 /* card_bg@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CB1FD7DA4F008561B4 /* card_bg@3x.png */; }; 30 | 75B638EA1FD7DA50008561B4 /* maestroCardLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CC1FD7DA4F008561B4 /* maestroCardLogo.png */; }; 31 | 75B638EB1FD7DA50008561B4 /* card_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CD1FD7DA4F008561B4 /* card_bg.png */; }; 32 | 75B638EC1FD7DA50008561B4 /* visaCardLogo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CE1FD7DA4F008561B4 /* visaCardLogo@3x.png */; }; 33 | 75B638ED1FD7DA50008561B4 /* blackLine@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638CF1FD7DA4F008561B4 /* blackLine@3x.png */; }; 34 | 75B638EE1FD7DA50008561B4 /* masterCardLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D01FD7DA4F008561B4 /* masterCardLogo@2x.png */; }; 35 | 75B638EF1FD7DA50008561B4 /* maestroCardLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D11FD7DA4F008561B4 /* maestroCardLogo@2x.png */; }; 36 | 75B638F01FD7DA50008561B4 /* signatureBg.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D21FD7DA4F008561B4 /* signatureBg.png */; }; 37 | 75B638F11FD7DA50008561B4 /* discoverCardLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D31FD7DA4F008561B4 /* discoverCardLogo.png */; }; 38 | 75B638F21FD7DA50008561B4 /* maestroCardLogo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D41FD7DA4F008561B4 /* maestroCardLogo@3x.png */; }; 39 | 75B638F31FD7DA50008561B4 /* masterCardLogo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D51FD7DA4F008561B4 /* masterCardLogo@3x.png */; }; 40 | 75B638F41FD7DA50008561B4 /* blackLine@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D61FD7DA4F008561B4 /* blackLine@2x.png */; }; 41 | 75B638F51FD7DA50008561B4 /* visaCardLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D71FD7DA4F008561B4 /* visaCardLogo@2x.png */; }; 42 | 75B638F61FD7DA50008561B4 /* blackLine.png in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D81FD7DA4F008561B4 /* blackLine.png */; }; 43 | 75B638F71FD7DA50008561B4 /* CREDC.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 75B638D91FD7DA4F008561B4 /* CREDC.ttf */; }; 44 | 75B638F81FD7DA50008561B4 /* AMCreditCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B638DA1FD7DA4F008561B4 /* AMCreditCardView.swift */; }; 45 | /* End PBXBuildFile section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 75B638A61FD7DA42008561B4 /* AMCreditCardDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AMCreditCardDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 75B638A91FD7DA42008561B4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50 | 75B638AB1FD7DA42008561B4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 51 | 75B638AE1FD7DA42008561B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 75B638B01FD7DA42008561B4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 75B638B31FD7DA42008561B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 75B638B51FD7DA42008561B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 75B638BC1FD7DA4F008561B4 /* AMCreditCardView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AMCreditCardView.xib; sourceTree = ""; }; 56 | 75B638BE1FD7DA4F008561B4 /* amexCardLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = amexCardLogo.png; sourceTree = ""; }; 57 | 75B638BF1FD7DA4F008561B4 /* amexCardLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amexCardLogo@2x.png"; sourceTree = ""; }; 58 | 75B638C01FD7DA4F008561B4 /* discoverCardLogo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "discoverCardLogo@3x.png"; sourceTree = ""; }; 59 | 75B638C11FD7DA4F008561B4 /* chip@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chip@2x.png"; sourceTree = ""; }; 60 | 75B638C21FD7DA4F008561B4 /* chip@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chip@3x.png"; sourceTree = ""; }; 61 | 75B638C31FD7DA4F008561B4 /* discoverCardLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "discoverCardLogo@2x.png"; sourceTree = ""; }; 62 | 75B638C41FD7DA4F008561B4 /* amexCardLogo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amexCardLogo@3x.png"; sourceTree = ""; }; 63 | 75B638C51FD7DA4F008561B4 /* chip.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chip.png; sourceTree = ""; }; 64 | 75B638C61FD7DA4F008561B4 /* card_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "card_bg@2x.png"; sourceTree = ""; }; 65 | 75B638C71FD7DA4F008561B4 /* visaCardLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = visaCardLogo.png; sourceTree = ""; }; 66 | 75B638C81FD7DA4F008561B4 /* masterCardLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = masterCardLogo.png; sourceTree = ""; }; 67 | 75B638C91FD7DA4F008561B4 /* signatureBg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "signatureBg@2x.png"; sourceTree = ""; }; 68 | 75B638CA1FD7DA4F008561B4 /* signatureBg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "signatureBg@3x.png"; sourceTree = ""; }; 69 | 75B638CB1FD7DA4F008561B4 /* card_bg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "card_bg@3x.png"; sourceTree = ""; }; 70 | 75B638CC1FD7DA4F008561B4 /* maestroCardLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = maestroCardLogo.png; sourceTree = ""; }; 71 | 75B638CD1FD7DA4F008561B4 /* card_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = card_bg.png; sourceTree = ""; }; 72 | 75B638CE1FD7DA4F008561B4 /* visaCardLogo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "visaCardLogo@3x.png"; sourceTree = ""; }; 73 | 75B638CF1FD7DA4F008561B4 /* blackLine@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "blackLine@3x.png"; sourceTree = ""; }; 74 | 75B638D01FD7DA4F008561B4 /* masterCardLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "masterCardLogo@2x.png"; sourceTree = ""; }; 75 | 75B638D11FD7DA4F008561B4 /* maestroCardLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "maestroCardLogo@2x.png"; sourceTree = ""; }; 76 | 75B638D21FD7DA4F008561B4 /* signatureBg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = signatureBg.png; sourceTree = ""; }; 77 | 75B638D31FD7DA4F008561B4 /* discoverCardLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = discoverCardLogo.png; sourceTree = ""; }; 78 | 75B638D41FD7DA4F008561B4 /* maestroCardLogo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "maestroCardLogo@3x.png"; sourceTree = ""; }; 79 | 75B638D51FD7DA4F008561B4 /* masterCardLogo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "masterCardLogo@3x.png"; sourceTree = ""; }; 80 | 75B638D61FD7DA4F008561B4 /* blackLine@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "blackLine@2x.png"; sourceTree = ""; }; 81 | 75B638D71FD7DA4F008561B4 /* visaCardLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "visaCardLogo@2x.png"; sourceTree = ""; }; 82 | 75B638D81FD7DA4F008561B4 /* blackLine.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blackLine.png; sourceTree = ""; }; 83 | 75B638D91FD7DA4F008561B4 /* CREDC.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = CREDC.ttf; sourceTree = ""; }; 84 | 75B638DA1FD7DA4F008561B4 /* AMCreditCardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMCreditCardView.swift; sourceTree = ""; }; 85 | /* End PBXFileReference section */ 86 | 87 | /* Begin PBXFrameworksBuildPhase section */ 88 | 75B638A31FD7DA42008561B4 /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 75B6389D1FD7DA42008561B4 = { 99 | isa = PBXGroup; 100 | children = ( 101 | 75B638A81FD7DA42008561B4 /* AMCreditCardDemo */, 102 | 75B638A71FD7DA42008561B4 /* Products */, 103 | ); 104 | sourceTree = ""; 105 | }; 106 | 75B638A71FD7DA42008561B4 /* Products */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 75B638A61FD7DA42008561B4 /* AMCreditCardDemo.app */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | 75B638A81FD7DA42008561B4 /* AMCreditCardDemo */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 75B638BB1FD7DA4F008561B4 /* AMCreditCard */, 118 | 75B638A91FD7DA42008561B4 /* AppDelegate.swift */, 119 | 75B638AB1FD7DA42008561B4 /* ViewController.swift */, 120 | 75B638AD1FD7DA42008561B4 /* Main.storyboard */, 121 | 75B638B01FD7DA42008561B4 /* Assets.xcassets */, 122 | 75B638B21FD7DA42008561B4 /* LaunchScreen.storyboard */, 123 | 75B638B51FD7DA42008561B4 /* Info.plist */, 124 | ); 125 | path = AMCreditCardDemo; 126 | sourceTree = ""; 127 | }; 128 | 75B638BB1FD7DA4F008561B4 /* AMCreditCard */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 75B638BC1FD7DA4F008561B4 /* AMCreditCardView.xib */, 132 | 75B638BD1FD7DA4F008561B4 /* Images */, 133 | 75B638D91FD7DA4F008561B4 /* CREDC.ttf */, 134 | 75B638DA1FD7DA4F008561B4 /* AMCreditCardView.swift */, 135 | ); 136 | name = AMCreditCard; 137 | path = ../../AMCreditCard; 138 | sourceTree = ""; 139 | }; 140 | 75B638BD1FD7DA4F008561B4 /* Images */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 75B638BE1FD7DA4F008561B4 /* amexCardLogo.png */, 144 | 75B638BF1FD7DA4F008561B4 /* amexCardLogo@2x.png */, 145 | 75B638C01FD7DA4F008561B4 /* discoverCardLogo@3x.png */, 146 | 75B638C11FD7DA4F008561B4 /* chip@2x.png */, 147 | 75B638C21FD7DA4F008561B4 /* chip@3x.png */, 148 | 75B638C31FD7DA4F008561B4 /* discoverCardLogo@2x.png */, 149 | 75B638C41FD7DA4F008561B4 /* amexCardLogo@3x.png */, 150 | 75B638C51FD7DA4F008561B4 /* chip.png */, 151 | 75B638C61FD7DA4F008561B4 /* card_bg@2x.png */, 152 | 75B638C71FD7DA4F008561B4 /* visaCardLogo.png */, 153 | 75B638C81FD7DA4F008561B4 /* masterCardLogo.png */, 154 | 75B638C91FD7DA4F008561B4 /* signatureBg@2x.png */, 155 | 75B638CA1FD7DA4F008561B4 /* signatureBg@3x.png */, 156 | 75B638CB1FD7DA4F008561B4 /* card_bg@3x.png */, 157 | 75B638CC1FD7DA4F008561B4 /* maestroCardLogo.png */, 158 | 75B638CD1FD7DA4F008561B4 /* card_bg.png */, 159 | 75B638CE1FD7DA4F008561B4 /* visaCardLogo@3x.png */, 160 | 75B638CF1FD7DA4F008561B4 /* blackLine@3x.png */, 161 | 75B638D01FD7DA4F008561B4 /* masterCardLogo@2x.png */, 162 | 75B638D11FD7DA4F008561B4 /* maestroCardLogo@2x.png */, 163 | 75B638D21FD7DA4F008561B4 /* signatureBg.png */, 164 | 75B638D31FD7DA4F008561B4 /* discoverCardLogo.png */, 165 | 75B638D41FD7DA4F008561B4 /* maestroCardLogo@3x.png */, 166 | 75B638D51FD7DA4F008561B4 /* masterCardLogo@3x.png */, 167 | 75B638D61FD7DA4F008561B4 /* blackLine@2x.png */, 168 | 75B638D71FD7DA4F008561B4 /* visaCardLogo@2x.png */, 169 | 75B638D81FD7DA4F008561B4 /* blackLine.png */, 170 | ); 171 | path = Images; 172 | sourceTree = ""; 173 | }; 174 | /* End PBXGroup section */ 175 | 176 | /* Begin PBXNativeTarget section */ 177 | 75B638A51FD7DA42008561B4 /* AMCreditCardDemo */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 75B638B81FD7DA42008561B4 /* Build configuration list for PBXNativeTarget "AMCreditCardDemo" */; 180 | buildPhases = ( 181 | 75B638A21FD7DA42008561B4 /* Sources */, 182 | 75B638A31FD7DA42008561B4 /* Frameworks */, 183 | 75B638A41FD7DA42008561B4 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | ); 189 | name = AMCreditCardDemo; 190 | productName = AMCreditCardDemo; 191 | productReference = 75B638A61FD7DA42008561B4 /* AMCreditCardDemo.app */; 192 | productType = "com.apple.product-type.application"; 193 | }; 194 | /* End PBXNativeTarget section */ 195 | 196 | /* Begin PBXProject section */ 197 | 75B6389E1FD7DA42008561B4 /* Project object */ = { 198 | isa = PBXProject; 199 | attributes = { 200 | LastSwiftUpdateCheck = 0910; 201 | LastUpgradeCheck = 0910; 202 | ORGANIZATIONNAME = "Artur Mkrtchyan"; 203 | TargetAttributes = { 204 | 75B638A51FD7DA42008561B4 = { 205 | CreatedOnToolsVersion = 9.1; 206 | ProvisioningStyle = Automatic; 207 | }; 208 | }; 209 | }; 210 | buildConfigurationList = 75B638A11FD7DA42008561B4 /* Build configuration list for PBXProject "AMCreditCardDemo" */; 211 | compatibilityVersion = "Xcode 8.0"; 212 | developmentRegion = en; 213 | hasScannedForEncodings = 0; 214 | knownRegions = ( 215 | en, 216 | Base, 217 | ); 218 | mainGroup = 75B6389D1FD7DA42008561B4; 219 | productRefGroup = 75B638A71FD7DA42008561B4 /* Products */; 220 | projectDirPath = ""; 221 | projectRoot = ""; 222 | targets = ( 223 | 75B638A51FD7DA42008561B4 /* AMCreditCardDemo */, 224 | ); 225 | }; 226 | /* End PBXProject section */ 227 | 228 | /* Begin PBXResourcesBuildPhase section */ 229 | 75B638A41FD7DA42008561B4 /* Resources */ = { 230 | isa = PBXResourcesBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | 75B638E21FD7DA4F008561B4 /* amexCardLogo@3x.png in Resources */, 234 | 75B638E01FD7DA4F008561B4 /* chip@3x.png in Resources */, 235 | 75B638B41FD7DA42008561B4 /* LaunchScreen.storyboard in Resources */, 236 | 75B638F21FD7DA50008561B4 /* maestroCardLogo@3x.png in Resources */, 237 | 75B638ED1FD7DA50008561B4 /* blackLine@3x.png in Resources */, 238 | 75B638E61FD7DA50008561B4 /* masterCardLogo.png in Resources */, 239 | 75B638F71FD7DA50008561B4 /* CREDC.ttf in Resources */, 240 | 75B638B11FD7DA42008561B4 /* Assets.xcassets in Resources */, 241 | 75B638AF1FD7DA42008561B4 /* Main.storyboard in Resources */, 242 | 75B638EC1FD7DA50008561B4 /* visaCardLogo@3x.png in Resources */, 243 | 75B638F41FD7DA50008561B4 /* blackLine@2x.png in Resources */, 244 | 75B638DB1FD7DA4F008561B4 /* AMCreditCardView.xib in Resources */, 245 | 75B638F31FD7DA50008561B4 /* masterCardLogo@3x.png in Resources */, 246 | 75B638E41FD7DA4F008561B4 /* card_bg@2x.png in Resources */, 247 | 75B638DF1FD7DA4F008561B4 /* chip@2x.png in Resources */, 248 | 75B638E11FD7DA4F008561B4 /* discoverCardLogo@2x.png in Resources */, 249 | 75B638E71FD7DA50008561B4 /* signatureBg@2x.png in Resources */, 250 | 75B638E51FD7DA50008561B4 /* visaCardLogo.png in Resources */, 251 | 75B638DE1FD7DA4F008561B4 /* discoverCardLogo@3x.png in Resources */, 252 | 75B638F61FD7DA50008561B4 /* blackLine.png in Resources */, 253 | 75B638DD1FD7DA4F008561B4 /* amexCardLogo@2x.png in Resources */, 254 | 75B638E91FD7DA50008561B4 /* card_bg@3x.png in Resources */, 255 | 75B638EF1FD7DA50008561B4 /* maestroCardLogo@2x.png in Resources */, 256 | 75B638DC1FD7DA4F008561B4 /* amexCardLogo.png in Resources */, 257 | 75B638F11FD7DA50008561B4 /* discoverCardLogo.png in Resources */, 258 | 75B638EB1FD7DA50008561B4 /* card_bg.png in Resources */, 259 | 75B638F51FD7DA50008561B4 /* visaCardLogo@2x.png in Resources */, 260 | 75B638EE1FD7DA50008561B4 /* masterCardLogo@2x.png in Resources */, 261 | 75B638F01FD7DA50008561B4 /* signatureBg.png in Resources */, 262 | 75B638EA1FD7DA50008561B4 /* maestroCardLogo.png in Resources */, 263 | 75B638E81FD7DA50008561B4 /* signatureBg@3x.png in Resources */, 264 | 75B638E31FD7DA4F008561B4 /* chip.png in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 75B638A21FD7DA42008561B4 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 75B638AC1FD7DA42008561B4 /* ViewController.swift in Sources */, 276 | 75B638AA1FD7DA42008561B4 /* AppDelegate.swift in Sources */, 277 | 75B638F81FD7DA50008561B4 /* AMCreditCardView.swift in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXVariantGroup section */ 284 | 75B638AD1FD7DA42008561B4 /* Main.storyboard */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | 75B638AE1FD7DA42008561B4 /* Base */, 288 | ); 289 | name = Main.storyboard; 290 | sourceTree = ""; 291 | }; 292 | 75B638B21FD7DA42008561B4 /* LaunchScreen.storyboard */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 75B638B31FD7DA42008561B4 /* Base */, 296 | ); 297 | name = LaunchScreen.storyboard; 298 | sourceTree = ""; 299 | }; 300 | /* End PBXVariantGroup section */ 301 | 302 | /* Begin XCBuildConfiguration section */ 303 | 75B638B61FD7DA42008561B4 /* Debug */ = { 304 | isa = XCBuildConfiguration; 305 | buildSettings = { 306 | ALWAYS_SEARCH_USER_PATHS = NO; 307 | CLANG_ANALYZER_NONNULL = YES; 308 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 310 | CLANG_CXX_LIBRARY = "libc++"; 311 | CLANG_ENABLE_MODULES = YES; 312 | CLANG_ENABLE_OBJC_ARC = YES; 313 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_COMMA = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 318 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INFINITE_RECURSION = YES; 322 | CLANG_WARN_INT_CONVERSION = YES; 323 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 327 | CLANG_WARN_STRICT_PROTOTYPES = YES; 328 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 329 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 330 | CLANG_WARN_UNREACHABLE_CODE = YES; 331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 332 | CODE_SIGN_IDENTITY = "iPhone Developer"; 333 | COPY_PHASE_STRIP = NO; 334 | DEBUG_INFORMATION_FORMAT = dwarf; 335 | ENABLE_STRICT_OBJC_MSGSEND = YES; 336 | ENABLE_TESTABILITY = YES; 337 | GCC_C_LANGUAGE_STANDARD = gnu11; 338 | GCC_DYNAMIC_NO_PIC = NO; 339 | GCC_NO_COMMON_BLOCKS = YES; 340 | GCC_OPTIMIZATION_LEVEL = 0; 341 | GCC_PREPROCESSOR_DEFINITIONS = ( 342 | "DEBUG=1", 343 | "$(inherited)", 344 | ); 345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 346 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 347 | GCC_WARN_UNDECLARED_SELECTOR = YES; 348 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 349 | GCC_WARN_UNUSED_FUNCTION = YES; 350 | GCC_WARN_UNUSED_VARIABLE = YES; 351 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 352 | MTL_ENABLE_DEBUG_INFO = YES; 353 | ONLY_ACTIVE_ARCH = YES; 354 | SDKROOT = iphoneos; 355 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 356 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 357 | }; 358 | name = Debug; 359 | }; 360 | 75B638B71FD7DA42008561B4 /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_ANALYZER_NONNULL = YES; 365 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 367 | CLANG_CXX_LIBRARY = "libc++"; 368 | CLANG_ENABLE_MODULES = YES; 369 | CLANG_ENABLE_OBJC_ARC = YES; 370 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 371 | CLANG_WARN_BOOL_CONVERSION = YES; 372 | CLANG_WARN_COMMA = YES; 373 | CLANG_WARN_CONSTANT_CONVERSION = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 375 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 376 | CLANG_WARN_EMPTY_BODY = YES; 377 | CLANG_WARN_ENUM_CONVERSION = YES; 378 | CLANG_WARN_INFINITE_RECURSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 381 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 383 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 384 | CLANG_WARN_STRICT_PROTOTYPES = YES; 385 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 386 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 387 | CLANG_WARN_UNREACHABLE_CODE = YES; 388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 389 | CODE_SIGN_IDENTITY = "iPhone Developer"; 390 | COPY_PHASE_STRIP = NO; 391 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 392 | ENABLE_NS_ASSERTIONS = NO; 393 | ENABLE_STRICT_OBJC_MSGSEND = YES; 394 | GCC_C_LANGUAGE_STANDARD = gnu11; 395 | GCC_NO_COMMON_BLOCKS = YES; 396 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 397 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 398 | GCC_WARN_UNDECLARED_SELECTOR = YES; 399 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 400 | GCC_WARN_UNUSED_FUNCTION = YES; 401 | GCC_WARN_UNUSED_VARIABLE = YES; 402 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 403 | MTL_ENABLE_DEBUG_INFO = NO; 404 | SDKROOT = iphoneos; 405 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 406 | VALIDATE_PRODUCT = YES; 407 | }; 408 | name = Release; 409 | }; 410 | 75B638B91FD7DA42008561B4 /* Debug */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 414 | CODE_SIGN_STYLE = Automatic; 415 | DEVELOPMENT_TEAM = U8CSJE9SQ2; 416 | INFOPLIST_FILE = AMCreditCardDemo/Info.plist; 417 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = com.arturiosdev.AMCreditCardDemo; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SWIFT_VERSION = 4.0; 422 | TARGETED_DEVICE_FAMILY = "1,2"; 423 | }; 424 | name = Debug; 425 | }; 426 | 75B638BA1FD7DA42008561B4 /* Release */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | CODE_SIGN_STYLE = Automatic; 431 | DEVELOPMENT_TEAM = U8CSJE9SQ2; 432 | INFOPLIST_FILE = AMCreditCardDemo/Info.plist; 433 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 435 | PRODUCT_BUNDLE_IDENTIFIER = com.arturiosdev.AMCreditCardDemo; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | SWIFT_VERSION = 4.0; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Release; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 75B638A11FD7DA42008561B4 /* Build configuration list for PBXProject "AMCreditCardDemo" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 75B638B61FD7DA42008561B4 /* Debug */, 449 | 75B638B71FD7DA42008561B4 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 75B638B81FD7DA42008561B4 /* Build configuration list for PBXNativeTarget "AMCreditCardDemo" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 75B638B91FD7DA42008561B4 /* Debug */, 458 | 75B638BA1FD7DA42008561B4 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | /* End XCConfigurationList section */ 464 | }; 465 | rootObject = 75B6389E1FD7DA42008561B4 /* Project object */; 466 | } 467 | -------------------------------------------------------------------------------- /AMCreditCard/AMCreditCardView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | CreditCard 16 | 17 | 18 | HelveticaNeue-LightItalic 19 | 20 | 21 | Verdana 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 93 | 101 | 109 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | --------------------------------------------------------------------------------