How to change SF Symbol icon color in UIKit?
Use:
let icon = UIImageView(image: iconImage.withRenderingMode(.alwaysTemplate))
icon.tintColor = .red
SF Symbols in Map wont apply colors
This works for me (adjust size
as desired):
let circle = UIImage(systemName:"23.circle.fill")!.withTintColor(.white)
let size = CGSize(width: 40, height: 40)
v.image = UIGraphicsImageRenderer(size:size).image {
_ in circle.draw(in:CGRect(origin:.zero, size:size))
}
Related Topics
Type of Expression Is Ambiguous Without More Context in Xcode 11
Why Can't I Use .Reduce() in a One-Liner Swift Closure with a Variadic, Anonymous Argument
Using @Discardableresult for Closures in Swift
Showing Notification Banner on MAC with Swift
Selectively Remove and Delete Objects from a Nsmutablearray in Swift
Argument of '#Selector' Does Not Refer to an '@Objc' Method, Property or Initializer
Dyld: Library Not Loaded: @Rpath/Libswiftdispatch.Dylib
Custom Uitabbar Unselected Item's Color
Fetching Child Sum from Core Data
Zoom to Fit Current Location and Annotation on Map
Running Swift Build in Terminal Leading to "Platform Path" Errors
Xcodebuild -Exportarchive Wont Allow Me to Specify Filename
Swiftui Overlay Blocking List Scroll Events
Array Extension Called from Other Module
In Which Cases Arscnview.Raycastquery Returns Nil
Playing Hls (M3U8) in Cocoa Os X Avplayer - Swift
Realmswift Initialize List:Cannot Specialize a Non-Generic Definition