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
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |
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
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity | |
{ | |
CGFloat offSetAdjustment = MAXFLOAT; | |
CGFloat horizontalCenter = (CGFloat) (proposedContentOffset.x + (self.collectionView.bounds.size.width / 2.0)); | |
CGRect targetRect = CGRectMake(proposedContentOffset.x, 0.0, self.collectionView.bounds.size.width, self.collectionView.bounds.size.height); | |
NSArray *array = [self layoutAttributesForElementsInRect:targetRect]; | |
UICollectionViewLayoutAttributes *currentAttributes; |
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.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; |
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
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://examplewebsite.com"]]; | |
manager.requestSerializer = [AFHTTPRequestSerializer serializer]; | |
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"userName" password:@"password"]; |
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
(•_•) | |
<) )/ | |
./ \. | |
(•_•) | |
\( (> | |
./ \. | |
(•_•) | |
<) )~ |
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
#!/bin/sh | |
PROJ=`find . -name '*.xib' -o -name '*.[mh]'` | |
for png in `find . -name '*.png'` | |
do | |
name=`basename $png` | |
if ! grep -q $name $PROJ; then | |
echo "$png is not referenced" | |
fi | |
done |
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 <Foundation/Foundation.h> | |
@interface StdQueue : NSObject | |
@property(nonatomic, readonly) BOOL empty; | |
@property(nonatomic, readonly) NSUInteger size; | |
@property(nonatomic, readonly) id front; | |
@property(nonatomic, readonly) id back; | |
- (void)enqueue:(id)object; |
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
@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { | |
UIImageOrientation scrollOrientation; | |
CGPoint lastPos; | |
} | |
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
if (tableView.isDragging) { | |
UIView *myView = cell.contentView; | |
CALayer *layer = myView.layer; | |
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; |
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
UIViewController *walkThru = [self.storyboard instantiateViewControllerWithIdentifier:@"WalkThroughScene"]; | |
walkThru.providesPresentationContextTransitionStyle = YES; | |
walkThru.definesPresentationContext = YES; | |
[walkThru setModalPresentationStyle:UIModalPresentationOverCurrentContext]; | |
[self.navigationController presentViewController:walkThru animated:YES completion:nil]; |
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
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
OlderNewer