adding label to navigation bar
if let navigationBar = self.navigationController?.navigationBar {
let firstFrame = CGRect(x: 0, y: 0, width: navigationBar.frame.width/2, height: navigationBar.frame.height)
let secondFrame = CGRect(x: navigationBar.frame.width/2, y: 0, width: navigationBar.frame.width/2, height: navigationBar.frame.height)
let firstLabel = UILabel(frame: firstFrame)
firstLabel.text = "First"
let secondLabel = UILabel(frame: secondFrame)
secondLabel.text = "Second"
navigationBar.addSubview(firstLabel)
navigationBar.addSubview(secondLabel)
}
Also in Swift:
- get device name swift
- swift change enum value
- random string swift
- switch button swift 5
- button click programmatically swift
- swiftui foreach
- initializer generator xcode swift
- swift zstack
- remove child from firebase swift
- core data save
- swift string keep only numbers
- swift get day from available string
- create alert in swift
- conert data to string swift
- get index filter swift
- change textfield placeholder color swiftui
- swift check if regex is in string
- how to dismiss a view when touch up inside swift
- swift add navigation bar
- activity indicator swiftui
- set root view controller ios 13
- xcode combine calayer into an image
- setter must be with getter swift
- ui alert swift yes no