Back to All

UIImage Errors

Hi, I downloaded the ios source from the site, configured signing and capabilities.
When trying to build I get two errors:

"Definition conflicts with previous value"
import Foundation

extension UIImage {
public convenience init(iconName: String, size: CGFloat, color: UIColor) {
let iconFont = FontFactory.font(for: iconName)
guard let iconFont = iconFont else { <----this is were the error comes
self.init()

        return
    }

The error 2:
"Value of optional type 'Font?' must be unwrapped to refer to member 'fontName' of wrapped base type 'Font'"

import Foundation

extension UIImage {
public convenience init(iconName: String, size: CGFloat, color: UIColor) {
let iconFont = FontFactory.font(for: iconName)
guard let iconFont = iconFont else {
self.init()

        return
    }
    
    let filePath = Utilities.generateFilePath(for: iconName, fontName: iconFont.fontName, fontSize: size, color: color) <----this is where error2 is
    
    let succeeded = Utilities.createAndSaveImage(for: iconName, font: iconFont, size: size, color: color, filePath: filePath)
    
    if (succeeded) {
        let data = try? Data(contentsOf: URL(fileURLWithPath: filePath))
        self.init(data: data!, scale: 3.0)!
        return
    }
    
    self.init()
}

}