Crash: calling destroyNotificationHandler with nil value causes crash
Don’t explicitly unwrap to avoid and allow more forgiving use:
public func destroyNotificationHandler(inout handler:NotificationHandler?)
{
handler!.remove()
handler = nil
}
to handler?.remove()