We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let path = Bundle.main.path(forResource: "SAConfettiView", ofType: "bundle")
let bundle = Bundle(path: path!)
How do I fix this!?
The text was updated successfully, but these errors were encountered:
Replace let path = Bundle(for: SAConfettiView.self).path(forResource: "SAConfettiView", ofType: "bundle") let bundle = Bundle(path: path!) let imagePath = bundle?.path(forResource: fileName, ofType: "png") let url = URL(fileURLWithPath: imagePath!) do { let data = try Data(contentsOf: url) return UIImage(data: data) } catch { print(error) }
let path = Bundle(for: SAConfettiView.self).path(forResource: "SAConfettiView", ofType: "bundle") let bundle = Bundle(path: path!) let imagePath = bundle?.path(forResource: fileName, ofType: "png") let url = URL(fileURLWithPath: imagePath!) do { let data = try Data(contentsOf: url) return UIImage(data: data) } catch { print(error) }
with this if let image = UIImage(named: fileName) { return image } else { return nil }
if let image = UIImage(named: fileName) { return image } else { return nil }
Sorry, something went wrong.
No branches or pull requests
let path = Bundle.main.path(forResource: "SAConfettiView", ofType: "bundle")
let bundle = Bundle(path: path!)
How do I fix this!?
The text was updated successfully, but these errors were encountered: