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
public static function easeOutIn (t:Number):Number | |
{ | |
if (t < 0.5) return 0.5 * ( (t=t*2-1) * t * t + 1); | |
return 0.5*(t = t*2-1)*t*t + 0.5; | |
} |
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
for f in *.png; do mv "$f" "${f%.png}@2x.png"; 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
for f in *.png; do mv "$f" "${f//-/_}"; 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
- (void)setupKeyboard | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWasShown:) | |
name:UIKeyboardWillShowNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillBeHidden:) | |
name:UIKeyboardWillHideNotification object: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 | |
f=$(pwd) | |
sips --resampleWidth 40 "${f}/${1}" --out "${f}/Icon-40.png" | |
sips --resampleWidth 80 "${f}/${1}" --out "${f}/Icon-40@2x.png" | |
sips --resampleWidth 120 "${f}/${1}" --out "${f}/Icon-60@2x.png" | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-29.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-29@2x.png" | |
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png" | |
sips --resampleWidth 76 "${f}/${1}" --out "${f}/Icon-76.png" |
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 Collor | |
class ExampleSectionDescriptor: CollectionSectionDescribable { | |
func sectionInset(_ collectionView:UICollectionView) -> UIEdgeInsets { | |
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) | |
} | |
func minimumLineSpacing(_ collectionView: UICollectionView, layout: UICollectionViewFlowLayout) -> CGFloat { | |
return 15 | |
} | |
} |
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 Collor | |
final class TitleDescriptor: CollectionCellDescribable { | |
let identifier: String = "TitleCollectionViewCell" | |
let className: String = "TitleCollectionViewCell" | |
var selectable:Bool = true | |
let adapter: TitleAdapter | |
init(adapter:TitleAdapter) { |
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 Collor | |
struct TitleAdapter: CollectionAdapter { | |
var title : NSAttributedString | |
let image: UIImage = UIImage(named: "picto_warning_orange")! | |
init() { | |
let paragrapheStyle = NSMutableParagraphStyle() | |
paragrapheStyle.alignment = .left |
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
extension TitleCollectionViewCell : CollectionCellAdaptable { | |
func update(with adapter: CollectionAdapter) { | |
guard let adapter = adapter as? TitleAdapter else { | |
fatalError("TitleAdapter required") | |
} | |
titleLabel.attributedText = adapter.title | |
} | |
} |
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
// Adapter Protocol | |
protocol VSCollectionLabelAdapter: CollectionAdapter { | |
var label: NSAttributedString { get } // required property | |
} | |
// VSLabelCollectionViewCell implements CollectionCellAdaptable | |
extension VSLabelCollectionViewCell: CollectionCellAdaptable { | |
func update(with adapter: CollectionAdapter) { | |
guard let adapter = adapter as? VSCollectionLabelAdapter else { | |
fatalError("VSCollectionLabelAdapter required") |
OlderNewer