<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><description></description><title>slerp</title><generator>Tumblr (3.0; @phonedev)</generator><link>http://phonedev.tumblr.com/</link><item><title>We apologize for the untimely interruption</title><description>&lt;p&gt;We have been busy bees and have had no time for hackery.&lt;/p&gt;

&lt;p&gt;In the meantime, here are some &lt;a href="http://lucasnewman.com/phonedemos.zip"&gt;samples&lt;/a&gt; to play with.&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/13155474</link><guid>http://phonedev.tumblr.com/post/13155474</guid><pubDate>Wed, 26 Sep 2007 00:05:14 -0700</pubDate></item><item><title>Draw yr strings cheap and easy</title><description>&lt;p&gt;CGContextRef context = CGBitmapContextCreate(…);&lt;br/&gt;
UIPushContext(context);&lt;/p&gt;

&lt;p&gt;UITextLabel *textLabel = [[[UITextLabel alloc] initWithFrame:CGContextGetClipBoundingBox(context)] autorelease];&lt;br/&gt;
[textLabel setText:@”Hello world!”];&lt;br/&gt;
[textLabel setCentersHorizontally:YES];&lt;br/&gt;
[textLabel drawContentsInRect:[textLabel bounds]];&lt;/p&gt;

&lt;p&gt;UIPopContext(context);&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/11638506</link><guid>http://phonedev.tumblr.com/post/11638506</guid><pubDate>Thu, 13 Sep 2007 00:07:59 -0700</pubDate></item><item><title>You are so cover flow</title><description>&lt;p&gt;@implementation SlowFlipView&lt;/p&gt;

&lt;p&gt;// Combine something old…&lt;/p&gt;

&lt;p&gt;- (void)flipSlowly;&lt;br/&gt;
{&lt;br/&gt;
    // enable perspective transforms&lt;br/&gt;
    LKTransform sublayerTransform = LKTransformIdentity;&lt;br/&gt;
    sublayerTransform.m34 = 1.0 / -420.0;&lt;br/&gt;
    [[[self superview] _layer] setSublayerTransform:sublayerTransform];&lt;/p&gt;

&lt;p&gt;    [[self _layer] setTransform:LKTransformMakeRotation(M_PI, 0, -1, 0)];&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;// with something new…&lt;/p&gt;

&lt;p&gt;- (id)actionForLayer:(LKLayer *)layer forKey:(NSString *)key;&lt;br/&gt;
{&lt;br/&gt;
    if ([key isEqualToString:@”transform”]) {&lt;br/&gt;
        LKBasicAnimation *flipAnimation = [LKBasicAnimation animationWithKeyPath:key];&lt;br/&gt;
        [flipAnimation setTimingFunction:[LKTimingFunction functionWithName:@”easeInEaseOut”]];&lt;br/&gt;
        [flipAnimation setDuration:5.0]; // take yr time there, partner&lt;br/&gt;
        return flipAnimation;&lt;br/&gt;
    } else&lt;br/&gt;
        return [super actionForLayer:layer forKey:key];&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;@end&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/11629147</link><guid>http://phonedev.tumblr.com/post/11629147</guid><pubDate>Wed, 12 Sep 2007 21:52:43 -0700</pubDate></item><item><title>My app never crashes</title><description># ssh root@iphone cat /var/logs/CrashReporter/LatestCrash.plist | less</description><link>http://phonedev.tumblr.com/post/11480920</link><guid>http://phonedev.tumblr.com/post/11480920</guid><pubDate>Tue, 11 Sep 2007 16:52:27 -0700</pubDate></item><item><title>Take a swipe at it</title><description>&lt;p&gt;In a UITable subclass:&lt;/p&gt;

&lt;p&gt;- (int)swipe:(int)num withEvent:(GSEventRef)event;&lt;br/&gt;
{&lt;br/&gt;
  if (num == kUIViewSwipeRight)&lt;br/&gt;
    [self handleSwipeRight];&lt;/p&gt;

&lt;p&gt;  // knowing the bounds of the swipe might be useful…&lt;br/&gt;
  CGRect rect = (GSEventGetLocationInWindow(event));&lt;br/&gt;
  NSLog(@”origin: (%f, %f)  size: (%f, %f)”, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); &lt;br/&gt;
}&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/11474513</link><guid>http://phonedev.tumblr.com/post/11474513</guid><pubDate>Tue, 11 Sep 2007 15:32:58 -0700</pubDate></item><item><title>What goes down, must come up</title><description>&lt;p&gt;- (void)buttonPressed&lt;br/&gt;
{&lt;br/&gt;
  NSLog(@”Take action when a user finishes pressing a button, not when they start…”);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;p&gt;button = [[[UIPushButton alloc] initWithFrame:CGRectMake(…)] autorelease];&lt;br/&gt;
[button addTarget:self action:@selector(buttonPressed) forEvents:kUIControlEventMouseUpInside];&lt;br/&gt;
[button setShowPressFeedback:YES];&lt;br/&gt;
[button setEnabled:YES];&lt;br/&gt;
[view addSubview:button];&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/11471659</link><guid>http://phonedev.tumblr.com/post/11471659</guid><pubDate>Tue, 11 Sep 2007 15:04:50 -0700</pubDate></item><item><title>Just don't call it a desktop picture</title><description>UIImageView *background = [[[UIImageView alloc] initWithFrame:CGRectMake(…)] autorelease];&lt;br/&gt;
[background setImage:[UIImage defaultDesktopImage]];&lt;br/&gt;
[view addSubview:background];</description><link>http://phonedev.tumblr.com/post/11470697</link><guid>http://phonedev.tumblr.com/post/11470697</guid><pubDate>Tue, 11 Sep 2007 14:54:36 -0700</pubDate></item><item><title>Open sesame</title><description>&lt;p&gt;In your UIApplication instance:&lt;/p&gt;

&lt;p&gt;[self openURL:[NSURL URLWithString:@”http://goatse.cx”]];&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10659214</link><guid>http://phonedev.tumblr.com/post/10659214</guid><pubDate>Tue, 04 Sep 2007 09:18:39 -0700</pubDate></item><item><title>How to make Gruber hate your app...</title><description>&lt;p&gt;#import &lt;GraphicsServices/GraphicsServices.h&gt;&lt;br/&gt;
#import &lt;UIKit/UIKit.h&gt;&lt;/p&gt;

&lt;p&gt;textLabel = [[UITextLabel alloc] initWithFrame:…];&lt;br/&gt;
GSFontRef font = GSFontCreateWithName(“Marker Felt”, kGSFontTraitBold, 18.0f);&lt;br/&gt;
[textLabel setFont:font];&lt;br/&gt;
CFRelease(font);&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10658843</link><guid>http://phonedev.tumblr.com/post/10658843</guid><pubDate>Tue, 04 Sep 2007 09:13:24 -0700</pubDate></item><item><title>Automagicanimation</title><description>&lt;p&gt;Wrap your messages to a UIView in +beginAnimations: and +endAnimations to automatically animate to the new state.&lt;/p&gt;

&lt;p&gt;#import &lt;UIKit/UIKit.h&gt;&lt;/p&gt;

&lt;p&gt;UIView *view = …&lt;/p&gt;

&lt;p&gt;[UIView beginAnimations:nil];&lt;br/&gt;
[UIView setAnimationCurve:kUIAnimationCurveEaseInEaseOut];&lt;br/&gt;
[UIView setAnimationDuration:2.0];&lt;br/&gt;
// animate to the new frame in 2 seconds&lt;br/&gt;
[view setFrame:CGRectMake(0, 0, 100, 100)];&lt;br/&gt;
[UIView endAnimations];&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10506396</link><guid>http://phonedev.tumblr.com/post/10506396</guid><pubDate>Sun, 02 Sep 2007 23:09:59 -0700</pubDate></item><item><title>Watch your waistline</title><description>&lt;p&gt;There’s no MallocDebug or other leak checking tools, so make sure you’re not becoming a pig with:&lt;/p&gt;

&lt;p&gt;# while true; do ps -xo vsz,rsz,pagein,pmem,command | grep MyAwesomePhoneApp | grep -v grep; echo “—-“; sleep 10; done&lt;/p&gt;

&lt;p&gt;If you don’t watch it, Springboard will shut you down at about 64 MB.&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10468665</link><guid>http://phonedev.tumblr.com/post/10468665</guid><pubDate>Sun, 02 Sep 2007 12:17:04 -0700</pubDate></item><item><title>"Wow. Nice curves."</title><description>#import &lt;UIKit/UIKit.h&gt; &lt;br/&gt;&lt;br/&gt;- (void)drawRect:(CGRect)rect;&lt;br/&gt;{&lt;br/&gt;    CGContextSetFillColorWithColor(UICurrentContext(), [UIView colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]);&lt;br/&gt;    [[UIBezierPath roundedRectBezierPath:rect withRoundedCorners:kUIBezierPathAllCorners withCornerRadius:10.0] fill];&lt;br/&gt;}</description><link>http://phonedev.tumblr.com/post/10385140</link><guid>http://phonedev.tumblr.com/post/10385140</guid><pubDate>Sat, 01 Sep 2007 12:08:58 -0700</pubDate></item><item><title>Even from this angle, your app is still ugly</title><description>#import &lt;UIKit/UIKit.h&gt;&lt;br/&gt;#import &lt;LayerKit/LayerKit.h&gt;&lt;br/&gt;&lt;br/&gt;UIView *view = …&lt;br/&gt;&lt;br/&gt;LKTransform sublayerTransform = LKTransformIdentity;&lt;br/&gt;// adjust the distance of the sublayer transform to add perspective&lt;br/&gt;sublayerTransform.m34 = 1.0 / -500.0;&lt;br/&gt;[[[view superview] _layer] setSublayerTransform:sublayerTransform];&lt;br/&gt;&lt;br/&gt;[(LKLayer *)[view _layer] setTransform:LKTransformMakeRotation(M_PI / 3.0, 0.5, -1, 0)];</description><link>http://phonedev.tumblr.com/post/10384237</link><guid>http://phonedev.tumblr.com/post/10384237</guid><pubDate>Sat, 01 Sep 2007 11:55:39 -0700</pubDate></item><item><title>Pantone has nothing on you</title><description>&lt;p&gt;#import &lt;Foundation/Foundation.h&gt;&lt;br/&gt;
#import &lt;UIKit/UIKit.h&gt;&lt;/p&gt;

&lt;p&gt;@interface UIView (Color)&lt;br/&gt;
+ (CGColorRef)colorWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha;&lt;br/&gt;
@end&lt;/p&gt;

&lt;p&gt;@implementation UIView (Color)&lt;/p&gt;

&lt;p&gt;+ (CGColorRef)colorWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha;&lt;br/&gt;
{&lt;br/&gt;
    float rgba[4] = {red, green, blue, alpha};&lt;br/&gt;
    CGColorSpaceRef rgbColorSpace = (CGColorSpaceRef)[(id)CGColorSpaceCreateDeviceRGB() autorelease];&lt;br/&gt;
    CGColorRef color = (CGColorRef)[(id)CGColorCreate(rgbColorSpace, rgba) autorelease];&lt;br/&gt;
    return color;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;@end&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10291889</link><guid>http://phonedev.tumblr.com/post/10291889</guid><pubDate>Fri, 31 Aug 2007 11:17:28 -0700</pubDate></item><item><title>Use UIHardware</title><description>&lt;p&gt;Don’t assume that the size of the screen is 320x480 (who’s to say that the next version of the iPhone won’t have a 480x640 screen?) Also the status bar can be more than 20 pixels high (like during a phone call.)&lt;/p&gt;

&lt;p&gt;Do this:&lt;/p&gt;

&lt;p&gt;	CGRect contentRect = [UIHardware fullScreenApplicationContentRect];&lt;/p&gt;

&lt;p&gt;	UINavigationBar *navigationBar = [[[UINavigationBar alloc] initWithFrame:CGRectMake(contentRect.origin.x, contentRect.origin.y, contentRect.size.width, 44.0f)] autorelease];&lt;/p&gt;

&lt;p&gt;	UITextView *textView = [[[UITextView alloc] initWithFrame:CGRectMake(contentRect.origin.x, 44.0f, contentRect.size.width, contentRect.size.height - 44.0f)] autorelease];&lt;/p&gt;</description><link>http://phonedev.tumblr.com/post/10290246</link><guid>http://phonedev.tumblr.com/post/10290246</guid><pubDate>Fri, 31 Aug 2007 10:55:12 -0700</pubDate></item></channel></rss>
