Archive for category iPhone
Boher Architecture iPhone app now available on iTunes
Posted by shawson in iPhone, Objective C on July 18, 2012
An app I recently built for Boher Architecture in Midhurst just went live on the iStore! You can get it for free from itunes.apple.com/us/app/boher/id539358624?ls=1&mt=8.
It features;
- Categorised Unit Converter covering Length, Area, Distance, Mass and many more!
- A graphical roof pitch calculator
- A complete set of UK building regs for reference, available when you’re on site, even without mobile signal
- Portfolio and contact details for Boher Architecture
Boher Architecture can also be contacted via their, soon-to-be-launched website at www.boherarchitecture.com
Rotating child UIView when parent UITabBar or UINavigationController isn’t rotatable!
Posted by shawson in iPhone, Objective C on June 13, 2012
I’m building an app at the moment, with what is most likely a pretty fairly use case. It is a tab based app (Using StoryBoard/ iOS5.0/ XCode 4.3.2) , so at the top I have a UITabBarController, UINavigationController’s coming off of a few different tabs, then UIViewControllers coming off of those.
I DON’T want the home screen’s to be rotatable, but I do want one of my child UIView’s (a picture gallery, of course!) to be rotatable.
My UITabBarController at the root of the application had the following method;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
This will make sure the views at the top don’t rotate, so I figured I would just add add the following to my gallery view controller to make just that one rotatable;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
But I found nothing happened when I rotated. I set a bunch of break points and found the method in my gallery detail controller wasn’t even hit, but the parent TabBarControllers method was still being hit. The trouble is, you can’t rotate a view unless it’s parent is marked as rotatable.
After some head scratching, the solution was actually pretty simple- I created a switch on my root TabBarController “allowRotation”, then adjust the shouldAutorotateToInterfaceOrientation method in the tabBarController to;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (self.allowRotation)
return YES;
else
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Then in my gallery detail view I set that switch to true when you enter the view;
-(void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
RootTabBarController *tabcontrol = (RootTabBarController*)[self tabBarController];
tabcontrol.allowRotation = YES;
}
And when you click the back button at the top of the view, I quickly set the switch back to false;
- (void)willMoveToParentViewController:(UIViewController *)parent
{
RootTabBarController *tabcontrol = (RootTabBarController*)[self tabBarController];
tabcontrol.allowRotation = NO;
}
I tried doing this on viewWillDisappear and a bunch of other methods, but found none of them fired early enough to get in there before the back button fired off it’s magic to prepare the parent views rotation.
NOTE: Make sure you’re app has rotation enabled in the Project Target “Summary” sheet, otherwise none of this will work!

Mobile HTML5 Offline app links
Posted by shawson in Android Development, HTML5, iPhone on September 14, 2011
I’m looking at writing some apps I did on the iPhone a while ago (the first of which will be Karma) to be mobile html5 offline accessible apps, using html5 audio/ canvas etc- so I’ll use this post to collect some useful links for research;
- http://www.html5rocks.com/en/mobile/mobifying.html
- http://www.html5rocks.com/en/mobile/touch.html
- http://diveintohtml5.org/
- http://www.modernizr.com/
- http://html5boilerplate.com/
- http://jquerymobile.com/
Also decided to use this as an opportunity to mess with nodejs, using one of the “nosql” db platforms;
http://blog.mongodb.org/post/812003773/node-js-and-mongodb
http://nodejs.org/
PhoneGap – Deselecting All Items from the tab bar!
Posted by shawson in iPhone, Javascript on October 5, 2010
Doing a bit of iPhone development at the mo and needed to remove a highlight from a tab bar when i moved to another page- In your javascript on your page put;
window.uicontrols.selectTabBarItem('');
Karma, now available on iTunes!
My first published iPhone app, “Karma” is now available on the iTunes store http://itunes.com/apps/karma
Cocos2d documentation on Easing effects for animating sprites
Posted by shawson in iPhone, Objective C on January 15, 2010
just found this ; http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:actions_ease?s=ease after ages of searching! shows you how to do smooth scrolling movements which ease out.
GDC – Austin 2009 Tickets Booked!
Posted by shawson in GDC - Austin '09, iPhone on July 9, 2009
Just booked my tickets for the Game Developer Conference, Austin Texas! Woo! Signed up for the iPhone game development sessions– quite exciting. My very first trip to the US, and it will be to, what I’ve always imagined to be, the most stereotypically American part of America I could possibly visit (controversial , I know)!
IPhone Code Masters!
Posted by shawson in iPhone, Objective C on May 28, 2009
Paul Ledger and I have just setup a dedicated IPhone Development blog to post all things IPhone related as well as house the support forums for app’s we produce up at IphoneCodeMasters.com
TomWhitson » iTunes connect tax
Found this article detailing how to setup the itunes connect tax form (W-8BEN) for a individual developer based in the UK.
MORE iPhone links
Posted by shawson in iPhone, Objective C on April 28, 2009
I’m currently down with man-flu, however have found the next tutorial to have a go with when I’m back – on iCodeBlog is a multi-part tutorial taking you through building your own iphone tennis app! I shall update this post as i find other stuff
