How to set custom font name and custom font weight (font style) for UINavigationBar title?
相关问题
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
- Get the NSRange for the visible text after scroll
- UIPanGestureRecognizer is not working in iOS 13
- What does a Firebase observer actually do?
相关文章
- Using if let syntax in switch statement
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
- How can I vertically align my status bar item text
- Adding TapGestureRecognizer to UILabel in Swift
- Attempt to present UIAlertController on View Contr
- Swift - Snapshotting a view that has not been rend
Try this code. Swift 3x
This could be a better approach to set nanvigationBar title font and Style.
Some Font Styles:
Note: Font style varies from font to font!
Use
UIFontDescriptor
asFont Name
andFont Size
UIFontDescriptor.fontDescriptorWithSymbolicTraits
as font style (Bold, Italic, ...)Swift 2.x:
Swift 4x:
let newFont = UIFont(name: "FontName", size: 15) newFont?.fontDescriptor.withSymbolicTraits(.traitBold)