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
-(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
if (indexPath.section == SectionNumberInfo) | |
{ | |
NSString *str = _group.groupDescription; | |
CGSize labelSize = [str sizeWithFont:[UIFont fontWithName:@"Helvetica" size:17] constrainedToSize:CGSizeMake(260, 400) lineBreakMode:NSLineBreakByTruncatingTail]; | |
// 112 (logo height) + 13(logo to margin) + 8(logo bottom margin) + 40(label bottom margin) = 173 | |
CGFloat result = 173 + labelSize.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
- (void)viewDidLayoutSubviews { | |
[super viewDidLayoutSubviews]; | |
_scrollView.contentOffset = _lastOffset; | |
} | |
-(void)viewDidDisappear:(BOOL)animated | |
{ | |
[self unregisterForKeyboardNotifications]; | |
_lastOffset = _scrollView.contentOffset; | |
_scrollView.contentOffset = CGPointZero; |
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
AVMutableComposition* mixComposition = [[AVMutableComposition alloc] init]; | |
NSString *path1 = _exportPaths[0]; | |
NSString *path2 = _exportPaths[1]; | |
//load assets | |
AVURLAsset *asset1 = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:path1] options:nil]; | |
AVURLAsset *asset2 = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:path2] options:nil]; | |
//create mutable composition track and add all assets to this track | |
AVMutableCompositionTrack *track = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; |
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
pbcopy < ~/.ssh/id_rsa.pub |
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
// move item to clip marker | |
// save current touch.x as N | |
// if continue: | |
// calculate displacement from N point | |
// if displacement > threshold | |
// move item.center to current touch point; | |
// reset N; |
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
NSString *numberString = @"0"; | |
NSNumber *number = [NSNumber numberWithInt:_selectedCounter]; | |
numberString = [numberString stringByAppendingString:number.description]; | |
cell.numberLabel.text = numberString; | |
cell.numberLabel.hidden = NO; |
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
// See http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill for details | |
#import <AssetsLibrary/AssetsLibrary.h> | |
#import <ImageIO/ImageIO.h> | |
// Helper methods for thumbnailForAsset:maxPixelSize: | |
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) { | |
ALAssetRepresentation *rep = (__bridge id)info; | |
NSError *error = nil; |
NewerOlder