jdisho / Papr

🌁 An Unsplash app for iOS
Apache License 2.0
1.15k stars 150 forks source link

Papr crashes in iOS 12 and lower. #96

Closed jdisho closed 4 years ago

jdisho commented 4 years ago

Since SVG format is not supported in iOS, the app crashes when it tries to access an image with a given resource name.

static var arrowUpRight: UIImage {
    if #available(iOS 13.0, *) {
        return UIImage(systemName: "arrow.up.right", withConfiguration: symbolConfigurationMedium)!#
    }
    return UIImage(imageLiteralResourceName: "arrow.up.right") // #CRASH
}

We can solve this issue by (I would like to avoid having a dependency for this use case) by converting the SVGs into .png or supporting iOS13 and higher.

Thoughts on this @serjooo (since you closed #89) ?

(This app is not planned to be released, so supporting only the latest iOS version seems fine to me.)

serjooo commented 4 years ago

I think it would be nice to support older versions of iOS. So I don't mind providing the images in PNG format and returning those images when needed, this way we avoid using a dependency as well. However, we will have duplicated resources. Also, maybe where we have set the image only by storyboard we would need to set it by code now. What do you think? @jdisho