Swift4底表自定义XIB文件

时间:2018-08-23 13:40:45

标签: ios uiviewcontroller cocoapods swift4

我想使用我的自定义 Login.xib 全屏显示底部工作表。我已经尝试过this library

let controller = Bottomsheet.Controller()
controller.initializeHeight = UIScreen.main.bounds.height
self.present(controller, animated: true, completion: nil)

该代码需要添加我的Login.swift文件,任何人都可以帮助我。 期望这样的输出。
我在IOS上比较新鲜,所以也尽力了。enter image description here

class LoginViewController: UIViewController {
@IBOutlet weak var firstName: UILabel!

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
    firstName.text = "Vinothkumar"
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

class func instanceFromNib() -> UIView {
    return UINib(nibName: "LoginView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! UIView
}}

0 个答案:

没有答案