jsoncreator_app/JSONCreator_iOS/JSONCreator/QueryServerCell.swift
2019-08-13 11:24:32 -04:00

36 lines
941 B
Swift

//
// QueryServerCell.swift
// JSONCreator
//
// Created by Kevin Christiano on 8/13/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import UIKit
class QueryServerCell: UITableViewCell {
var requestServer: (()->())?
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
let button = UIButton(frame: .zero)
button.setTitle("RequestView", for: .normal)
button.backgroundColor = .yellow
button.addTarget(self, action: #selector(requestJSON), for: .touchUpInside)
contentView.addSubview(button)
NSLayoutConstraint.pinView(toSuperview: button, useMargins: true)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func requestJSON() {
requestServer?()
}
}