TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Apr 2015 |
Maintained by John Heaton, Mark Glagola, David Warner.
Depends on: | |
pop | ~> 1.0 |
ReactiveCocoa | ~> 2.0 |
PureLayout | ~> 2.0 |
CocoaBloc-UI | ~> 0.0.3 |
CocoaBloc-Camera is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CocoaBloc-Camera'
SBCameraViewController
SBCameraViewController's
delegate
.SBCameraViewController
.SBCaptureViewControllerDelegate
callbacks.@implementation ViewController
. . .
//create an SBCameraViewController
- (void)launchCameraController {
// ===> 1. Init a `SBCameraViewController`
SBCameraViewController *cameraController = [[SBCameraViewController alloc] initWithReviewOptions:reviewOptions initialCaptureType:SBCaptureTypeVideo];
// ===> 2. Set the `SBCameraViewController's` `delegate`.
cameraController.captureDelegate = self;
// ===> 3. Present the `SBCameraViewController`.
[self presentViewController:cameraController animated:YES completion:nil];
}
. . .
// ===> 4. Handle `SBCaptureViewControllerDelegate` callbacks.
#pragma mark - SBCaptureViewControllerDelegate
- (void)cameraControllerCancelled:(SBCaptureViewController*)controller {
//The user just attempted to close the controller.
[self dismissViewControllerAnimated:YES completion:nil];
}
//The SBCaptureViewControllerDelegate protocol inherits from SBReviewControllerDelegate
//hence the different name "reviewController:..."
- (void)reviewController:(SBReviewController*)controller acceptedAsset:(SBAsset*)asset {
//The user just accepted the SBAsset, do something with it!
//This is also a good time to dismiss the SBCameraViewController you launched earlier.
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
To try our example project, run the following via command line:
pod try 'CocoaBloc-Camera'
CocoaBloc-Camera is available under the MIT license. See the LICENSE file for more info.