如何在Swift 5中以编程方式关闭底部工作表?

huangapple go评论68阅读模式
英文:

How to dismiss bottom sheet programatically in swift 5?

问题

我已使用底部表单。我需要在Swift 5中解散附加的底部表单。我已使用以下代码将底部表单附加到视图控制器...

let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Dash_Board_Bottom_Sheet_Map") as! Dash_Board_Bottom_Sheet_Map
vc.attach(to: self)

请帮助关闭底部表单。

英文:

I have used a bottom sheet. I need to dismiss the attached bottom sheet in swift 5. I have used bellow code to the attached bottom sheet to viewController...

let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Dash_Board_Bottom_Sheet_Map") as! Dash_Board_Bottom_Sheet_Map
vc.attach(to: self)

Please help to dismiss bottom sheet

答案1

得分: 1

尝试这个。这对你有用。这是用于从当前视图控制器中移除表格的。

vc.detach()

英文:

Try this. This will work for you. This is for Remove the sheet from the current view controller.

vc.detach()

huangapple
  • 本文由 发表于 2020年1月6日 22:30:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/59613861.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定