I am trying to get remote images to show for Apple CarPlay.
I know I need to make an extension as it does not work by default.
I have tried to add the following and I get No exact matches in call to initializer Which I don't know what that means or how to fix.
extension UIImage {
func imageFromBase64(_ base64: String) -> UIImage? {
if let url = URL(string: base64), let data = try? Data(contentsOf: url) {
return UIImage(data: data)
}
return nil
}
}
let item = CPListItem(text: station.name,
detailText: station.name,
image: station.imageurl.imageFromBase64()
)