-- Poor Websites --
http://www.theworldsworstwebsiteever.com/
-- Useless Websites --
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 |
@interface UIViewController (AddChild) | |
- (void)addChildController:(UIViewController*)childController toView:(UIView*)view; | |
@end | |
@implementation UIViewController (AddChild) | |
- (void)addChildController:(UIViewController*)childController toView:(UIView*)view { | |
[childController willMoveToParentViewController:self]; |
#!/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 |
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}') |
//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]; | |
#import <UIKit/UIKit.h> | |
@interface UIView (Pop) | |
- (void)popWithMagnitude:(CGFloat)magnitude numPops:(int)numPops duration:(CGFloat)duration; | |
@end |
-- Poor Websites --
http://www.theworldsworstwebsiteever.com/
-- Useless Websites --
source ~/.bash_profile | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi |
#import <UIKit/UIKit.h> | |
@interface Widget : UIView | |
@property (strong, nonatomic, readonly) IBOutlet UIView* view; | |
@end |
# Xcode | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 | |
!default.perspectivev3 | |
*.xcworkspace |