This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Core Data Properties and Instance Methods | |
//AppDelegate.m | |
#pragma mark - Properties | |
- (NSManagedObjectContext *)managedObjectContext | |
{ | |
if (_managedObjectContext != nil) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//generate random number with array | |
- (void)awakeFromInsert //invoked automatically by the Core Data framework when the receiver is first inserted into a managed object context. | |
{ | |
[super awakeFromInsert]; | |
NSString *quotesFilePath = [[NSBundle mainBundle] | |
pathForResource:@"QuotesList" | |
ofType:@"plist"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source Control in Xcode 5 | |
//1. Git settings | |
//configure git with your name and email address so that your changes are tracked properly. | |
//open a Terminal window and enter the following commands: | |
//below commands will save your name and email to your local ~/.gitconfig file | |
git config --global user.name "YOUR NAME HERE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//making custom SearchBar | |
//SSAppDelegate.h | |
@interface SSAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Intermediate Text Kit (master-detail book app for ipad) | |
//1. basic UI | |
//AppDelete.h | |
@interface AppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//modify textView size when keyboard appears and disappears | |
//Add the following instance variable to NoteEditorViewController.m | |
@implementation NoteEditorViewController | |
{ | |
//... | |
CGRect _textViewFrame; //used to store the current text view frame | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Textkit and TableView with note (ios 7) | |
//1. start with basic dummy data | |
//AppDelegate.h | |
@interface AppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@property NSMutableArray* notes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// automatically extract first line of string, based on the first few words | |
// for example, can using this for title of note | |
//.h | |
// | |
@property NSString* contents; | |
@property (readonly) NSString* title; | |
//.m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//adjust UITextView size and scrolling position | |
- (void)viewDidLoad | |
{ | |
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} | |
[super viewDidLoad]; | |
[self registerForKeyboardNotifications]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set the frame of the view | |
/* | |
_theImageView.frame = CGRectMake(x, y, width, height); | |
Frame is in reference to its parent view, | |
Bounds are in reference to the view itself | |
*/ | |
//ex |