Skip to content

Instantly share code, notes, and snippets.

View jeksys's full-sized avatar

Eugene Yagrushkin jeksys

View GitHub Profile
@jeksys
jeksys / EditableViewCell.h
Created May 4, 2011 20:19
EditableViewCell
//
// EditableViewCell.h
// Editable UITableViewCell with a UITextField as an edit tool
// Created by Eugene Yagrushkin on 11-05-04.
// Copyright 2011 Eugene Yagrushkin All rights reserved.
//
#import <UIKit/UIKit.h>
@jeksys
jeksys / gist:953410
Created May 3, 2011 14:22
ANIMATION BLOCK
[UIView animateWithDuration:HIDE_CONTROLS_ANIMATION
animations:^{
// and other controls
self.navigationController.navigationBar.hidden = ControlsHidden;
self.tabbar.hidden = ControlsHidden;
}
completion:^(BOOL finished){
+ (BOOL)isRunningOniPad
{
static BOOL hasCheckediPadStatus = NO;
static BOOL isRunningOniPad = NO;
if (!hasCheckediPadStatus)
{
if ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)])
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
@jeksys
jeksys / gist:953396
Created May 3, 2011 14:11
GestureRecognizer
UILongPressGestureRecognizer *recognizer;
recognizer = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)] autorelease];
[self.view addGestureRecognizer: recognizer];
- (void)handleLongPress:(UILongPressGestureRecognizer *)recognizer