card-io / card.io-iOS-source

The open-source code for the card.io-iOS-SDK: provides fast, easy credit card scanning in mobile apps
Other
686 stars 372 forks source link

Update CardIOVideoStream's previewLayer to CALayer #63

Closed wisolith closed 8 years ago

wisolith commented 8 years ago

Update CardIOVideoStream's previewLayer to CALayer to allow it to be a SimulatedCameraLayer.

Resolves the following compile error in Xcode 7.3:

/card.io-iOS-source/Classes/CardIOVideoStream.mm:189:19: error: assigning to
'AVCaptureVideoPreviewLayer *__strong' from incompatible type 'SimulatedCameraLayer * _Nonnull'
bluk commented 8 years ago

Thanks for the PR. I'll merge this in but will add another commit on top for:

#if SIMULATE_CAMERA
@property(nonatomic, strong, readwrite) CALayer *previewLayer;
#else
@property(nonatomic, strong, readwrite) AVCaptureVideoPreviewLayer *previewLayer;
#endif

There were some errors when compiling for release because the types mismatched when SIMULATE_CAMERA was not set.