Question
I upgraded my project to Swift 3.0, but after the update the app won't run on the simulator. It doesn't crash, but simply freeze.
I investigated the issue and saw the the apps hangs on the initialisation of the custom fonts.
I copied the function below.
func registerMaterialFont() {
let url = Bundle.main.url(forResource: "Material-Design-Iconic-Font", withExtension: "otf")!
let data = try! Data(contentsOf: url)
let provider = CGDataProvider(data: data as CFData)
print("Test 1")
let font = CGFont(provider!)
print("Test 2")
var error: Unmanaged<CFError>?
if !CTFontManagerRegisterGraphicsFont(font, &error) {
//Error handling here
} else {
log.info("Material Font registered");
}
}
The console will only print Test 1.
Does somebody has an idea whats going on?
NB:. This app is running on a testPhone with sim card and not running on an phone without a simcard!
Edit: Stack trace If I press pauze in the Debug console, the following stack trace is displayed:
libsystem_kernel.dylib`semaphore_wait_trap:
0x10c765fa4 <+0>: movq %rcx, %r10
0x10c765fa7 <+3>: movl $0x1000024, %eax ; imm = 0x1000024
0x10c765fac <+8>: syscall
-> 0x10c765fae <+10>: retq
0x10c765faf <+11>: nop