This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func printerTextField(font:Int, size: Int, x:Int, y: Int, content: String) -> String { | |
return “TEXT \(font) \(size) \(x) \(y) \(content)” | |
} | |
private func printMultiLineTextField(linesHeight: Int, font:Int, size: Int, x:Int, y: Int, content: String) -> String { | |
return “ML \(linesHeight)\nTEXT \(font) \(size) \(x) \(y) \n\(content)\nENDML\nENDML” | |
} | |
private func printerBarCodeFormat(width: Int, ratio: Int, height: Int, x: Int, y:Int, content: String) -> String { | |
return “BARCODE 128 \(width) \(ratio) \(height) \(x) \(y) \(content)” | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
@IBOutlet var printerConnectionStatus: UILabel! | |
var printManager = PrintManager.sharedInstance | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
printManager.connectionDelegate = self | |
if printManager.isConnected { | |
printerConnectionStatus.text = “Connected” | |
} else { | |
printerConnectionStatus.text = “Not Connected” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var manager: EAAccessoryManager! | |
var isConnected: Bool = false | |
private var printerConnection: MfiBtPrinterConnection? | |
private var serialNumber: String? | |
private var disconnectNotificationObserver: NSObjectProtocol? | |
private var connectedNotificationObserver: NSObjectProtocol? | |
static let sharedInstance = PrintManager() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GradientView: UIView { | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
let gradientLayer = CAGradientLayer() | |
gradientLayer.frame = CGRect(x: 0, y: 0, width: frame.width, height: frame.height) | |
gradientLayer.colors = [UIColor.white.cgColor,UIColor.red.withAlphaComponent(0.5).cgColor] | |
gradientLayer.startPoint = CGPoint(x: 0.0, y: 1.0) | |
gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImageCollectionViewCell: UICollectionViewCell { | |
@IBOutlet weak var gradientView: GradientView! | |
@IBOutlet weak var imageView: UIImageView! | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
} | |
extension ViewController: UICollectionViewDelegate { | |
} | |
extension ViewController: UICollectionViewDataSource { | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TopMostPresenter.swift | |
// iTunesFeatureBanner | |
// | |
// Created by Eric Dockery on 7/7/18. | |
// Copyright © 2018 Eric Dockery. All rights reserved. | |
// | |
class TopMostPresenter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TopMostViewController.swift | |
// iTunesFeatureBanner | |
// | |
// Created by Eric Dockery on 7/7/18. | |
// Copyright © 2018 Eric Dockery. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TopMostCollectionViewCell.swift | |
// iTunesFeatureBanner | |
// | |
// Created by Eric Dockery on 7/7/18. | |
// Copyright © 2018 Eric Dockery. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TopMostCollectionViewCellPresenter.swift | |
// iTunesFeatureBanner | |
// | |
// Created by Eric Dockery on 7/7/18. | |
// Copyright © 2018 Eric Dockery. All rights reserved. | |
// | |
class TopMostCollectionViewCellPresenter { |