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
| Getting the Source | |
| $ cd ~/source | |
| $ curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz | |
| $ tar -zxvf lame-3.99.5.tar.gz | |
| $ rm -r lame-3.99.5.tar.gz | |
| $ cd lame-3.99.5 | |
| Installing | |
| $ ./configure | |
| $ make |
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
| defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-{XcodeVersion} |
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
| import Foundation | |
| // 1. Wildcard Pattern | |
| func wildcard(a: String?) -> Bool { | |
| guard case _? = a else { return false } | |
| for case _? in [a] { | |
| return true | |
| } | |
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
| a = [lambda: i for i in xrange(1, 4)] | |
| for f in a: | |
| print f() | |
| //output: 333 |
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
| a = [] | |
| for i in 1..3 | |
| a.push(lambda { i }) | |
| end | |
| for f in a | |
| print "#{f.call()}" | |
| end | |
| // output: 333 |
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
| - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator | |
| { | |
| [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; | |
| [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
| [self.collectionView performBatchUpdates:^{ | |
| [self.collectionView setCollectionViewLayout:self.collectionView.collectionViewLayout animated:YES]; | |
| } completion: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
| NextViewController *newVC = [[NextViewController alloc] init]; | |
| newVC.transitioningDelegate = self; | |
| newVC.modalTransitionStyle = UIModalPresentationCustom; | |
| [self presentViewController:newVC animated:YES completion: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
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| self.presentInteractor = [[MiniToLargeViewInteractive alloc] init]; | |
| [self.presentInteractor attachToViewController:self withView:self.miniView presentViewController:self.playerView]; | |
| self.dismissInteractor = [[MiniToLargeViewInteractive alloc] init]; | |
| [self.dismissInteractor attachToViewController:self.nextViewController withView:self.nextViewController.view presentViewController: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
| #import "MiniToLargeViewInteractive.h" | |
| @interface MiniToLargeViewInteractive () | |
| @property (nonatomic) BOOL shouldComplete; | |
| @end | |
| @implementation MiniToLargeViewInteractive |
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
| #import <UIKit/UIKit.h> | |
| @interface MiniToLargeViewInteractive : UIPercentDrivenInteractiveTransition | |
| @property (nonatomic) UIViewController *viewController; | |
| @property (nonatomic) UIViewController *presentViewController; | |
| @property (nonatomic) UIPanGestureRecognizer *pan; | |
| - (void)attachToViewController:(UIViewController *)viewController withView:(UIView *)view presentViewController:(UIViewController *)presentViewController; | |
| @end |