photo-editor icon indicating copy to clipboard operation
photo-editor copied to clipboard

Fatal error: Unexpectedly found nil while unwrapping an Optional value

Open bbookman opened this issue 8 years ago • 1 comments

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 }

bbookman avatar Apr 03 '18 19:04 bbookman

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

jonchui avatar Aug 11 '18 18:08 jonchui