Dev Juice: Help me create a hidden logo
Dear Dev Juice,
How do you implement that slightly egotistical Apple logo hidden in iBooks.app if you drag the bookshelf down from the top?
Brandon E.

Dear Brandon
Ah. You speak of the hidden drag-to-reveal logo. Actually, that's super-easy to do. Just remember that you can add subviews to scroll views and place them in that magic elastic zone at the top.
Take tables for example. Lots of devs now add "pull-to-refresh" feature to the top, similar to Apple's logo. As with the scrollview, make sure to set the origin above the normal start, i.e. use negative numbers of at least the size of whatever view you add.
Here's the basic approach. Adapt it as needed.
// Add the "Pull to Refresh" above the table.
// Ensure bounces and alwaysBounceVertical are enabled.
UIView *pullView = [[[NSBundle mainBundle]
loadNibNamed:@"HiddenHeaderView"
owner:self options:nil] lastObject];
pullView.frame = CGRectOffset(pullView.frame, 0.0f,
-pullView.frame.size.height);
[self.tableView addSubview:pullView];
Happy developing!
Share
Source: http://tuaw.com/tag/devjuice
Categories
Dear Dev Juice, How do you implement that slightly egotistical Apple logo hidden in iBooks.app if you drag the bookshelf down from the...
Add a Comment
Thanks Erica, cool code!
The refresh idea should be used with care though, as it likely to be or become patented.
I'd like to use this feature for hidden labels for my tableview. Having this in a popover creates some difficulties though.
After some experimentation I made it work by placing your code in the viewWillAppear: of my tableViewController.
The popover seems to have some problems with tableview scrolling though. The position of the popover influences the working of selectRowAtIndexPath:, for example, and the addition of the hidden subviews also gives different results depending on where on the view the popover is created. I think there is a bug in the popover framework. Perhaps they have fixed this in iOS 5, I have not tried this yet.
Deals of the Day
more deals- Acoustic Research Digital Photo Frame with iPod Dock for $50 + free shipping
- Apple iPhone 4 8GB for Verizon, AT&T, or Sprint for $50 + pickup at Best Buy
- Unlocked iPhone 4S 16GB for GSM (AT&T, T-Mobile) for $619 + free shipping
- Apple iMac Core i7 Quad 3.4GHz 27" w/ 24GB RAM, 2TB HDD for $2,677 + $29 s&h
- Used Apple Magic Mouse for $36 + $4 s&h
- 9-Piece iPhone Bundle, includes 1,900mAh battery for $8 + free shipping
1 Comment