简体   繁体   中英

Customize camera overlay in applozic

I am using applozic chat sdk for ios and sending images , video successfully . My requirement is to change camera overlay. When I try to add overlay on camera it crashes.

 let camaraObj : ALImagePickerController = ALImagePickerController()

 let overlay =UIView(frame: UIScreen.mainScreen().bounds)
 overlay.backgroundColor = UIColor.redColor()     
 camaraObj.cameraOverlayView = overlay

Crash log: libc++abi.dylib: terminating with uncaught exception of type NSException.

Any help ?

Looks like you are not setting the sourceType. ALImagePickerController is used for sending pictures from photos only. You need to explicitly set source type if you want to use it for camera.

ie self.mImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

We just tried the same and got below exception:

2017-01-30 14:30:30.954540 applozicdemo[3106:1925853] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type must be UIImagePickerControllerSourceTypeCamera' First throw call stack: (0x1819de1c0 0x18041855c 0x187a945cc 0x187d23294 0x1003f9dcc 0x10016525c 0x10016521c 0x10016a284 0x18198bf2c 0x181989b18 0x1818b8048 0x18333e198 0x1878a42fc 0x18789f034 0x1000517b8 0x18089c5b8) libc++abi.dylib: terminating with uncaught exception of type NSException

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM