bevy / photo-editor

Photo editor with a lot of cool features
MIT License
881 stars 337 forks source link

Fatal error: Unexpectedly found nil while unwrapping an Optional value #29

Open bbookman opened 6 years ago

bbookman commented 6 years ago

Can you give me a workaround for this? I tried copying icomoon.ttf into various places in the Pod/. but that did not help

func registerFont(){
    let bundle = Bundle(for: PhotoEditorViewController.self)
    let url =  bundle.url(forResource: "icomoon", withExtension: "ttf")

// Fatal error: Unexpectedly found nil while unwrapping an Optional value guard let fontDataProvider = CGDataProvider(url: url! as CFURL) else { return }

jonchui commented 6 years ago

sounds like your url was nil - check that you have icomoon.ttf in your xcode project