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
//presentView and dismissView method with block | |
NSLog(@"Presenting view"); | |
[self presentViewController:changeLocationViewController animated:YES completion:^{ | |
NSLog(@"View done presenting"); | |
}]; | |
NSLog(@"Dismissing view"); |
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
//Add local repo for existing Xcode 5 Project | |
//Close Xcode.app | |
//Open Terminal.app | |
$ cd /path/to/project/dir | |
git init | |
git commit -a -m Initial | |
//You'll also want to add a .gitignore file to ignore some of the Xcode project files (Google for the exact list). | |
//When you open the Xcode project next time it will be ready for Source Code use. If you want a "remote" for the repo you'll need to edit .git/config. |
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
//styling navigation bar and status bar on the iOS7 | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// style the navigation bar | |
UIColor* navColor = [UIColor colorWithRed:0.97f green:0.37f blue:0.38f alpha:1.0f]; | |
[[UINavigationBar appearance] setBarTintColor:navColor]; | |
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; | |
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}]; | |
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
//three steps to create a custom transition in iOS: | |
//1. Create the animation controller. The first step is to create a class that implements the UIViewControllerAnimatedTransitioning protocol. This class contains the code to perform the actual animation, so this class is referred to as the animation controller. | |
//2. Before presenting a view controller, set its transitioning delegate. Before you present a view controller, you should set a class as its transitioning delegate (usually the presenting view controller). By doing this the delegate will get a callback asking for the animation controller to use when presenting the view controller. | |
//3. Return the animation controller in the callback. Finally, implement the callback method to return an instance of the animation controller you created in step 1. |
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
//handle iOS error meggages | |
//Scene is unreachable due to lack of entry points…”? | |
//just set an identifier. On the attribute inspector on the right pane, | |
//you'll find a field called "Identifier". | |
//Put any string in there, and Xcode will be happy again. |
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
//make basic table view with custom background and jason data v.7 | |
//add motion effects | |
- (void)viewDidLoad | |
{ | |
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} | |
... | |
// Background image |
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
//make basic table view with custom background and jason data v.6 | |
//following Collision Behavior 델리게이트 -> 상단 바운더리를 두어 스냅 시 상단에 뷰가 snap되도록 코딩 | |
//DynamicSandwichViewController.m | |
@interface DynamicSandwichViewController () <UICollisionBehaviorDelegate> //Collision Behavior 델리게이트 | |
- (UIView*)addRecipeAtOffset:(CGFloat)offset forSandwich:(NSDictionary*)sandwich { | |
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} | |
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
//make basic table view with custom background and jason data v.5 | |
//Docking views | |
//DynamicSandwichViewController.m | |
@implementation DynamicSandwichViewController | |
{ | |
//Docking views | |
UISnapBehavior* _snap; | |
BOOL _viewDocked; |
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
//make basic table view with custom background and jason data v.4 | |
//Adding some menu dynamics and takes gesture velocity, add velocity to behavior | |
//DynamicSandwichViewController.m | |
@implementation DynamicSandwichViewController | |
{ | |
NSMutableArray* _views; //use this variable to keep track of the added views | |
//Adding some menu dynamics |
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
//make basic table view with custom background and jason data v.3 | |
//iterate over the recipes and use the addRecipeAtOffset: forSandwich: method | |
//to add each recipe to the view | |
//DynamicSandwichViewController.h | |
@interface DynamicSandwichViewController : UIViewController | |
@end | |