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
// [Pseudo Code] Overriding a UITableViewController's TableView - viewDidLoad | |
self.tableView = nil; | |
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; | |
newView.backgroundColor = [UIColor clearColor]; | |
self.view = newView; | |
[newView release]; |
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
// To globally have these in App. | |
// Add Constants.h to .pch file like so | |
#ifdef __OBJC__ | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
#import "Constants.h" | |
#endif |
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
// UIView blur fix when using: view.center = CGPointmake(x, y) | |
// reason this happens is because of floating point points on x, y | |
// drop this into a UIView subclass | |
-(void)setCenter:(CGPoint)point { | |
super.center = point; | |
CGRect newFrame = self.frame; |
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
Default Fonts in the iPhone SDK | |
-------------- | |
Family name: AppleGothic | |
Font name: AppleGothic | |
Family name: Hiragino Kaku Gothic ProN | |
Font name: HiraKakuProN-W6 | |
Font name: HiraKakuProN-W3 | |
Family name: Arial Unicode MS |
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
// example demoed at #xcake belfast showing how to use CAGradientLayer to create a gradient button | |
CAGradientLayer * gradientLayer = [CAGradientLayer layer]; | |
gradientLayer.cornerRadius = 10; | |
gradientLayer.frame = loginButton.bounds; | |
gradientLayer.startPoint = CGPointMake(0, 0); | |
gradientLayer.endPoint = CGPointMake(1.0, 1.0); | |
gradientLayer.colors = [NSArray arrayWithObjects:(id)[UIColor colorWithWhite:0.90 alpha:1.0].CGColor, [UIColor colorWithWhite:0.5 alpha:1.0].CGColor, nil]; | |
[loginButton.layer insertSublayer:gradientLayer atIndex:0]; |
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
// Brute Force, to tidy | |
- (void)drawRect:(CGRect)rect { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetLineWidth(context, strokeWidth); | |
CGContextSetStrokeColorWithColor(context, self.strokeColor.CGColor); | |
CGRect rrect = self.bounds; |
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
# requires curb gem (http://curb.rubyforge.org/) | |
# I used matthooks’ vimeo gem to get the required token, sig and ticket. http://github.com/matthooks/vimeo/tree/master | |
# (flickraw has an alternative method of doing a http POST in the source using net/http which could be adapted for vimeo, avoiding the use of this curb gem) | |
# connect to Vimeo | |
VIMEO_API_KEY = "your api key" | |
VIMEO_SHARED_SECRET = "your shared secret" |