Skip to content

Instantly share code, notes, and snippets.

View EricADockery's full-sized avatar
🦕

Eric Arlan Dockery EricADockery

🦕
  • Versailles, KY
View GitHub Profile
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)”
}
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”
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()
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)
class ImageCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var gradientView: GradientView!
@IBOutlet weak var imageView: UIImageView!
}
class ViewController: UIViewController {
}
extension ViewController: UICollectionViewDelegate {
}
extension ViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
//
// TopMostPresenter.swift
// iTunesFeatureBanner
//
// Created by Eric Dockery on 7/7/18.
// Copyright © 2018 Eric Dockery. All rights reserved.
//
class TopMostPresenter {
//
// TopMostViewController.swift
// iTunesFeatureBanner
//
// Created by Eric Dockery on 7/7/18.
// Copyright © 2018 Eric Dockery. All rights reserved.
//
import UIKit
//
// TopMostCollectionViewCell.swift
// iTunesFeatureBanner
//
// Created by Eric Dockery on 7/7/18.
// Copyright © 2018 Eric Dockery. All rights reserved.
//
import UIKit
//
// TopMostCollectionViewCellPresenter.swift
// iTunesFeatureBanner
//
// Created by Eric Dockery on 7/7/18.
// Copyright © 2018 Eric Dockery. All rights reserved.
//
class TopMostCollectionViewCellPresenter {