//
// locationBtn.swift
// WenleSwift
//
// Created by Chengzhe Bu on 2018/3/23.
// Copyright © 2018年 Chengzhe Bu. All rights reserved.
//
import UIKit
class locationBtn: UIView {
@IBOutlet weak var locaBtn: UIButton!
static func newInstance() -> locationBtn?{
let nibView = Bundle.main.loadNibNamed("locationBtn", owner: nil, options: nil)
if let view = nibView?.first as? locationBtn{
return view
}
return nil
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
load_init()
}
func load_init(){
}
@IBAction func toSelectionLoca(_ sender: Any) {
}
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/
}
使用 -----
let loacBtn = locationBtn.newInstance()