在主对象之前隐藏底部标签栏 select
Hiding bottom tab bar before master object select
Xcode 10.1
Swift4.2
我正在使用 Master-Detail 项目。我需要在详细视图中添加一个底部选项卡栏,但我不希望在选择主视图中的对象之前显示它。
现在我使用 "Drawing" 下的 "Hidden" 选项作为选项卡栏,它在初始启动时将其隐藏,但无法找到在选择主对象后显示它的方法.
class DetailViewController: UIViewController {
@IBOutlet weak var detailHeaderLabel: UINavigationItem!
@IBOutlet weak var detailDescriptionLabel: UILabel!
func configureView() {
// Update the user interface for the detail item.
if let detail = detailItem {
if let label = detailDescriptionLabel {
label.text = detail.description
}
if let headerLabel = detailHeaderLabel {
headerLabel.title = detail.description
}
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
configureView()
}
var detailItem: String? {
didSet {
// Update the view.
configureView()
}
}
}
您需要从故事板创建标签栏的 IBOutlet,然后隐藏更改 属性
DispatchQueue.global(qos: .background).async {
// Background Thread
getObjectForMaster()
DispatchQueue.main.async {
tabBar.isHidden = false
}
}
Xcode 10.1 Swift4.2
我正在使用 Master-Detail 项目。我需要在详细视图中添加一个底部选项卡栏,但我不希望在选择主视图中的对象之前显示它。
现在我使用 "Drawing" 下的 "Hidden" 选项作为选项卡栏,它在初始启动时将其隐藏,但无法找到在选择主对象后显示它的方法.
class DetailViewController: UIViewController {
@IBOutlet weak var detailHeaderLabel: UINavigationItem!
@IBOutlet weak var detailDescriptionLabel: UILabel!
func configureView() {
// Update the user interface for the detail item.
if let detail = detailItem {
if let label = detailDescriptionLabel {
label.text = detail.description
}
if let headerLabel = detailHeaderLabel {
headerLabel.title = detail.description
}
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
configureView()
}
var detailItem: String? {
didSet {
// Update the view.
configureView()
}
}
}
您需要从故事板创建标签栏的 IBOutlet,然后隐藏更改 属性
DispatchQueue.global(qos: .background).async {
// Background Thread
getObjectForMaster()
DispatchQueue.main.async {
tabBar.isHidden = false
}
}