https://github.com/yeahdongcn/rscameraswitchsample
A pure code implementation of http://dribbble.com/shots/929359-Camera-Switch with beautiful animations.
https://github.com/yeahdongcn/rscameraswitchsample
Last synced: 11 months ago
JSON representation
A pure code implementation of http://dribbble.com/shots/929359-Camera-Switch with beautiful animations.
- Host: GitHub
- URL: https://github.com/yeahdongcn/rscameraswitchsample
- Owner: yeahdongcn
- License: mit
- Created: 2013-11-26T02:20:52.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-30T08:23:21.000Z (about 12 years ago)
- Last Synced: 2025-03-27T14:55:23.886Z (over 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 213 KB
- Stars: 40
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
RSCameraSwitchSample
====================
A pure code implementation of http://dribbble.com/shots/929359-Camera-Switch
The image below is what this control looks in dribbble

and this is what my control looks like

similar but still have some difference in material.
Usage, creation:
self.cameraSwitch = [[RSCameraSwitch alloc] initWithFrame:CGRectMake(100, 100, 165, 50)];
self.cameraSwitch.tintColor = [UIColor blackColor];
self.cameraSwitch.offColor = [[self class] colorWithARGBHex:0xff498e14];
self.cameraSwitch.onColorLight = [[self class] colorWithARGBHex:0xff9dd32a];
self.cameraSwitch.onColorDark = [[self class] colorWithARGBHex:0xff66a61b];
self.cameraSwitch.delegate = self;
[self.view addSubview:self.cameraSwitch];
event handling:
- (void)clicked:(BOOL)isFront
{
// When using GPUImage, put [self.videoCamera rotateCamera]; here,
// Otherwise do:
if (isFront) {
NSLog(@"front button selected");
} else {
NSLog(@"back button selected");
}
}
[](https://bitdeli.com/free "Bitdeli Badge")