Is there any way in Swift i can change my UILabel's text color property at once in whole app? I've tried using appeareance property but that doesn't work for UILabel textColor. Any way or any library that works on the same.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
try this in your
AppDelegate.swift
insidedidFinishLaunchingWithOptions
function:One way is using Color Set.
Start with creating new set in your xcassets catalog
... and name it how you want to
Then change your color to color that you need
Finally, set color of your label as this color from xcassets catalog
... or programmatically
Now when you need to change color of text, just change color of this Color Set
Create a UILabel class and set the textColour in that class to your desired colour. And give this class to all the labels you are using in the app. If you want to change the colour of all labels during the session, say by button action, you can use NotificationCenter and Singleton for that purpose.