-- Poor Websites --
http://www.theworldsworstwebsiteever.com/
-- Useless Websites --
-- Poor Websites --
http://www.theworldsworstwebsiteever.com/
-- Useless Websites --
#import <UIKit/UIKit.h> | |
@interface UIView (Pop) | |
- (void)popWithMagnitude:(CGFloat)magnitude numPops:(int)numPops duration:(CGFloat)duration; | |
@end |
//By: Brandon Levasseur | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
CAGradientLayer *gradientLayer = [CAGradientLayer layer]; | |
gradientLayer.frame = self.containerView.bounds; | |
[self.view.layer addSublayer:gradientLayer]; | |
gradientLayer.colors = @[(__bridge id)[UIColor redColor].CGColor, (__bridge id)[UIColor yellowColor].CGColor, (__bridge id)[UIColor greenColor].CGColor]; | |
dir=$(pwd) | |
find "$dir" -name "*@2x.png" | while read image; do | |
outfile=$(dirname "$image")/$(basename "$image" @2x.png).png | |
if [ "$image" -nt "$outfile" ]; then | |
basename "$outfile" | |
width=$(sips -g "pixelWidth" "$image" | awk 'FNR>1 {print $2}') | |
height=$(sips -g "pixelHeight" "$image" | awk 'FNR>1 {print $2}') |
#!/bin/bash | |
#Taken from: http://stackoverflow.com/questions/6113243/how-to-find-unused-images-in-an-xcode-project | |
for i in `find . -name "*.png" -o -name "*.jpg"`; do | |
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x` | |
result=`ack -i "$file"` | |
if [ -z "$result" ]; then | |
echo "$i" | |
fi | |
done |
@interface UIViewController (AddChild) | |
- (void)addChildController:(UIViewController*)childController toView:(UIView*)view; | |
@end | |
@implementation UIViewController (AddChild) | |
- (void)addChildController:(UIViewController*)childController toView:(UIView*)view { | |
[childController willMoveToParentViewController:self]; |
Functions/Methods | |
Should do one thing and one thing only | |
Should not be longer than 30 lines (if possible, most of the time the expections are large switch statements) | |
Single lines should not exceed screen width | |
Any unused functions should be removed | |
Method names should be self explainatory | |
No side effects! | |
Yes, these means we don't override getters and setters. | |
Functions should follow 'the golden path'. Which means the developer minimizes nested code by 'returning' instead of using if else statements. | |
For more guidelines refer to this document: https://github.com/raywenderlich/objective-c-style-guide |