How can I create a UIColor
from a hexadecimal string format, such as #00FF00
?
相关问题
- 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
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
swift version. Use as a Function or an Extension.
Function Extension How to call You can also define yourHex Color
from interface builder.This is nice with cocoapod support
https://github.com/mRs-/HexColors
updated for swift 1.2
You could use various online tools to convert a HEX string to an actual UIColor. Check out uicolor.org or UI Color Picker. The output would be converted into Objective-C code, like:
Which you could embed in your application. Hope this helps!
Another version with alpha