Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

class CameraView: UIView {
override class func layerClass() -> AnyClass! {
return object_getClass(AVCaptureVideoPreviewLayer())
}
var captureLayer: AVCaptureVideoPreviewLayer {
return layer as AVCaptureVideoPreviewLayer
}
@pkluz
pkluz / gist:2400661
Created April 16, 2012 18:50
ZUUIRevealController - Entire front view interaction....
@interface FrontViewController()
@property (nonatomic, retain) UIPanGestureRecognizer *panGestureRecognizer;
@end
@implementation
@synthesize panGestureRecognizer = _panGestureRecognizer;
{
"language": "de",
"values" : {
"EDIT_PROFILE_TITLE" : {
"value" : "Profil Bearbeiten",
"comment" : "Text shown as the title of the edit profile view controller."
},
"TEXT_TOO_LONG" : {
"value" : "Dein Text ist zu lang. Bitte kürzen.",
"comment" : "Error message shown in an alert if the text entered into a text field is too long."
@pkluz
pkluz / en.json
Last active August 5, 2016 18:25
Localization-De
{
"language": "en",
"values" : {
"EDIT_PROFILE_TITLE" : {
"value" : "Edit Profile",
"comment" : "Text shown as the title of the edit profile view controller."
},
"TEXT_TOO_LONG" : {
"value" : "Your text is too long. Please shorten it.",
"comment" : "Error message shown in an alert if the text entered into a text field is too long."
@pkluz
pkluz / gist:3653117
Created September 6, 2012 08:35
Spinning UIImageView (Custom Activity Indicator)
// Depends. Entirely in Interface Builder it's not doable, but what you can do is grab an UIImageView and place it on your view. Style it any way you want by assigning an image to it. Then in code you do this (i.e. in you viewDidLoad of the controller (or later, if you want it re-used, in its own subclass)):
- (void)viewDidLoad
{
[super viewDidLoad];
// Create an animation that rotates something around its Z axis.
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
// M_PI_2 = 360 degree rotation.