CALayer, shadows, and performance.

On iPad, we get shadows on CALayers..

So, you can do this:

aView.layer.shadowColor = [[UIColor darkGrayColor] CGColor];
aView.layer.shadowOffset = CGSizeMake(3., 3.);
aView.layer.shadowOpacity = 0.8;
aView.layer.shadowRadius = 5.;

However, you’ll notice that with a few of those onscreen and suddenly your splendidly fast iPad starts acting like it’s computing through a puddle of molasses. The cause turns out to be those darn shadows, they’re re-composited every time the layer moves. The fix is easy as microwavable popcorn:

aView.layer.shouldRasterize = YES;

Welcome back superfast iPad! :)

Friday, April 9, 2010

Bertrand Serlet (Apple Sr VP) on private APIs.

1.2 & OS 3.0

Reflections 1.2 has been out for a month or so. We need to update this more often. :)

Biggest new feature is the ability to save photos to your camera roll for use as wallpaper.

iPhone OS 3 is coming, and thus far there are very few issues with Reflections. In fact, there is really only one issue and that one stems from some fighting I had to do to get the look and feel I wanted. Without doing anything, Reflections is even faster in 3.0.

Thursday, May 7, 2009

Version 1.1

The latest build of Reflections has been submitted to the App Store. :)

Major changes include the ability to save photos to your camera roll, and from there you can use them as Wallpaper! Also, a new tag view has been added for all you Flickr users who actually use tags as your primary means of organizing photos. Finally, to round out the significant stuff, the tag cluster view will now let you add multiple tags from that cluster, without taking you back to the tag list after each one.

Look for it in your update queue soon!

Thursday, February 26, 2009

Best Backtrace *ever*

My kind of humor. :P

#0  0x933f3e17 in objc_exception_throw ()
#1  0x93a82eeb in +[NSException raise:format:arguments:] ()
#2  0x93a82f2a in +[NSException raise:format:] ()
#3  0x96f15e30 in _NSArrayRaiseInsertNilException ()
#4  0x96e342d4 in kHappyFunTable ()
#5  0x96e341e4 in kHappyFunTable ()
#6  0x30acdc20 in -[UINavigationController 
           pushViewController:transition:forceImmediate:] ()
#7  0x30acd9b9 in -[UINavigationController pushViewController:animated:] ()
<snip>
Saturday, January 31, 2009

Macworld reviewed Reflections! Yay!

Cocoa: The Subview Hierarchy

More useful code.. this time to print out the entire hierarchy of subviews below any particular view. For maximum usefulness, put this in a category* of UIView:

- (void)OP_printSubviewsOfView:(UIView*)view {
    static NSInteger depthCount = 0;

    NSArray *subview_array = [view subviews];

    NSMutableString *tabString = [NSMutableString 
                            stringWithCapacity:depthCount];
    for (NSInteger i = 0; i < depthCount; i++) {
        [tabString appendString:@" -- "];
    }
    NSLog(@"%@ %@",tabString,view);

    if (subview_array) {
        depthCount++;
        for(UIView *v in subview_array) {
            [self OP_printSubviewsOfView:v];
        }
        depthCount--;
    }
}

Note(*): Categories in Objective-C are very useful. They are also easy to create:

@interface UIView(Extras)
- (void)OP_printSubviewsOfView:(UIView*)view;
@end

@implementation UIView(Extras)
- (void)OP_printSubviewsOfView:(UIView*)view {
    // code
}
@end

But be careful. Read the chapter in the Objective-C 2.0 Programming Language document on them first. In fact, if you haven’t read that document from cover to cover, you should. It’s not that long.

Saturday, January 24, 2009

Cocoa: The Responder Chain

Here is a helpful little method that you can use to print out the responder chain above a particular instance.

- (void)_printNextResponder {
    id nextObj = self;
    while (nextObj) {
        NSLog(@"nextResponder %@",nextObj);
        nextObj = [nextObj nextResponder];
    }
}
Wednesday, January 21, 2009

It’s not what you look at that matters, it’s what you see.

Henry David Thoreau

Welcome

Orange Petal is a small team in Austin, Texas who have the audacious goal of building the 37signals of iPhone applications. Click that fancy RSS feed button up there and keep an automated electronic eye on us, you might just be surprised.

Friday, January 16, 2009