This file contains 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
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([[segue identifier] isEqualToString:@"NextVC"]) { | |
self.value = 1; | |
ViewController *controller = [segue destinationViewController]; | |
controller.data = self.value; | |
} | |
} | |
// In NextViewController.h | |
@property (nonatomic, strong) NSDictionary *data; |
This file contains 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
self.buttonLike.image = [[UIImage imageNamed:@"button-like"] imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal]; | |
//https://gist.github.com/MengTo/7887303 |
This file contains 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
//Original Blog Post : http://technopote.com/lift-uiview-uitextfield-editing/ | |
//Controller.h | |
@interface Controller : UIViewController <UITextFieldDelegate> { | |
CGFloat animatedDistance; | |
} | |
//Controller.m | |
#pragma constant UITextField | |
static const CGFloat KEYBOARD_ANIMATION_DURATION = 0.3; |
This file contains 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
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UIView *profile; //(264, 134, 100, 100) | |
@property (weak, nonatomic) IBOutlet UIView *subview; //(0, 5, 95, 95) : This view added in profile view | |
@end |
This file contains 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
// | |
// UIView+UIView_Roundify.h | |
// JMCurvedView | |
// | |
// Created by Mobmaxime on 30/12/14. | |
// Copyright (c) 2014 Jigar. All rights reserved. | |
// | |
//========================================================================== | |
//Round two corners in UIView |
This file contains 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
//Original Post : https://gist.github.com/joshdholtz/1861072 | |
NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"AddNewProductScrollView" owner:self options:nil]; | |
UIView *myView = [nibContents objectAtIndex:0]; | |
[scrollView addSubview: myView]; | |
[scrollView setContentSize:CGSizeMake(myView.frame.size.width, myView.frame.size.height)]; |
This file contains 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
//Original gist : https://gist.github.com/andrewgleave/915374 | |
-(void)MKMapViewFitAnnotations { | |
MKMapRect zoomRect = MKMapRectNull; | |
for (id <MKAnnotation> annotation in self.mkmapview.annotations) { | |
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
//MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0.1, 0.1); | |
if (MKMapRectIsNull(zoomRect)) { | |
zoomRect = pointRect; |
This file contains 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
// | |
// ProfileView.h | |
// Jigar | |
// | |
// Created by Jigar on 31/12/14. | |
// Copyright (c) 2014 Jigar. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains 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
//https://gist.github.com/gimenete/53704124583b5df3b407 : Originsl gist | |
- (void)changeRootViewController:(UIViewController*)viewController { | |
if (!self.window.rootViewController) { | |
self.window.rootViewController = viewController; | |
return; | |
} | |
UIView *snapShot = [self.window snapshotViewAfterScreenUpdates:YES]; | |
[viewController.view addSubview:snapShot]; | |
self.window.rootViewController = viewController; |