Skip to content

Instantly share code, notes, and snippets.

- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
@keicoder
keicoder / dealing with UIImagePickerController and UIActionSheet.m
Created March 21, 2014 07:24
objective-c : dealing with UIImagePickerController and UIActionSheet
//dealing with UIImagePickerController and UIActionSheet
//ImageViewController.h
@interface ImageViewController : UIViewController
@end
@keicoder
keicoder / making UITextView programmatically with custom class and UITextViewDelegate (JTextView).m
Created March 17, 2014 10:47
objective-c : making UITextView programmatically with custom class and UITextViewDelegate (JTextView)
//making UITextView programmatically with custom class and UITextViewDelegate (JTextView)
//1. make basic UITextView programmatically with custom class
//Prefix header
#ifdef __OBJC__
#define debug 1
@keicoder
keicoder / resize UITextView when showing keyboard.m
Created March 15, 2014 06:43
objective-c : resize UITextView when showing keyboard
//resize UITextView when showing keyboard
- (void)keyboardWillShow:(NSNotification *)aNotification {
[self moveTextViewForKeyboard:aNotification up:YES];
}
- (void)keyboardWillHide:(NSNotification *)aNotification {
[self moveTextViewForKeyboard:aNotification up:NO];
}
@keicoder
keicoder / making UITextView programmatically with custom class and UITextViewDelegate.m
Created March 15, 2014 06:26
objective-c : making UITextView programmatically with custom class and UITextViewDelegate
//making UITextView programmatically with custom class and UITextViewDelegate
//1. make basic UITextView programmatically with custom class
//AppDelegate.h
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@keicoder
keicoder / UITextView subclass for supporting string, regex search and highlighting.m
Created March 14, 2014 10:42
objective-c : UITextView subclass for supporting string, regex search and highlighting
//UITextView subclass for supporting string, regex search and highlighting
//Created by Ivano Bilenchi on 05/11/13
//ICAppDelegate.h
@interface ICAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
@keicoder
keicoder / Table Views Getting Started (Ray Wenderlich) Table Views Multiple Sections.m
Created March 14, 2014 07:45
objective-c : TableViews Getting Started (Ray Wenderlich) TableViews Chapter 2 Multiple Sections
//TableViews Getting Started (Ray Wenderlich) TableViews Chapter 2 Multiple Sections
//1. Scary Bugs
//ScaryBug.h
#import <Foundation/Foundation.h>
//TableViews Getting Started (Ray Wenderlich) TableViews Chapter 1 Getting Started
//1. PrettyIcons
//Icon.h
typedef NS_ENUM(NSInteger, RatingType) {
RatingTypeUnrated,
RatingTypeUgly,
@keicoder
keicoder / Custom KeyboardView.m
Created March 13, 2014 09:58
objective-c : Custom KeyboardView
//Custom KeyboardView
//DLViewController.h
@interface DLViewController : UIViewController
@end
//DLViewController.m
@keicoder
keicoder / viewController with XIB and keyboard accview delegate.m
Created March 13, 2014 09:49
objective-c : viewController with XIB and keyboard accview delegate
//viewController with XIB and keyboard accview delegate
//AppDelegate.h
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
// viewController with XIB
// @property (strong, nonatomic) ViewController *viewController;