skip to Main Content

Call objc code that throws exception in Swift – Ios swift

I have this code in ObjC/C: AVCaptureFocusMode GetFocusModeWithString(NSString *mode) { if ([mode isEqualToString:@"locked"]) { return AVCaptureFocusModeLocked; } else if ([mode isEqualToString:@"auto"]) { return AVCaptureFocusModeAutoFocus; } else { @throw [NSError errorWithDomain: @"FocusError", code: 12]; } } It used to be working…

VIEW QUESTION
Back To Top
Search