OCCamera
Simple native camera control for iOS based on DIYCam.
Install / Use
/learn @ocrickard/OCCameraREADME
#OCCamera#
This demo is a quick camera implementation I've thrown together over a weekend. It is very beta, but has many of the features that you would expect from a camera on iOS. It is fully native, and uses NO external assets. All icons/buttons are drawn using CoreGraphics or QuartzCore. The demo app is built on the very excellent DIYAV and DIYCam projects, which have been modified slightly, and I need to separate them into separate forks from the root repos.

##Structure##
I've put a number of classes in the OCCameraViewController.h and .m files. The idea was to keep it encapsulated, though the dependencies on the DIYAV and DIYCam libraries keep it from being a true 2-file camera component.
##Installation##
-
Drag in the DIYAV and DIYCam directories into your project.
-
Drag in the OCCameraViewController.h and OCCameraViewController.m files into your project.
-
Make sure you have all of the following frameworks: MobileCoreServices.framework, AssetsLibrary.framework, CoreMedia.framework, QuartzCore.framework, AVFoundation.framework, UIKit.framework, Foundation.framework, CoreGraphics.framework.
-
Allocate/init the view controller where you need a controller, and present the controller to the user:
camController = [[OCCameraViewController alloc] init];
camController.delegate = self;
[myViewController presentViewController:camController animated:YES completion:nil];
- Implement the two delegate methods:
#pragma mark - OCCameraViewControllerDelegate
- (void)camera:(OCCameraViewController *)cameraViewController didTakePhoto:(NSString *)pathToPhoto {
NSLog(@"took photo:%@", pathToPhoto);
}
- (void)camera:(OCCameraViewController *)cameraViewController didTakeVideo:(NSString *)pathToVideo {
NSLog(@"took video:%@", pathToVideo);
}
- Tweak and enjoy!
##TODO##
-
Finish up the flash button. It still has some problems, and I need to test the flash modes more.
-
Test implementation on more devices (I've only tested on my iPhone 5).
-
Generalize all components. At the moment, I've written somewhat static components that should be generalized.
#License#
OCCamera is released under the MIT License.
Copyright (c) 2013 Oliver C. Rickard
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
