Thursday, December 18, 2008

More iPhone code, opening some URLs in Safari

I answered a question about this in the iPhone developer forums, so thought others might find it useful too.

If you have a UIWebView in your app to show some web page (which I'm using for all the help pages.) You may still want it to open a new Safari window for other things--like links to the AppStore for other programs. This little bit sees what they web view will open, and if it's a URL on apple.com or an email address, opens that in Safari or the Mail app.

An equivalent of the "myEndsWith" is something you'll still have to do :)


- (BOOL)webView:(UIWebView *)webView 
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
//Opens any to apple.com in Safari (so app-store links open right :)
if ([[[request URL] host] myEndsWith:@"apple.com"]) {
[[UIApplication sharedApplication] openURL:[request URL]];
return NO;
}
//Mailto opens in email app...
if ([[[request URL] scheme] myStartsWith:@"mailto"]) {
[[UIApplication sharedApplication] openURL:[request URL]];
return NO;
}
return YES;
}

Saturday, December 13, 2008

1 Week, 1 App

I started pulling out a few of the features in FTP On The Go since put together, they really make an entire very useful program.

The Web and FTP servers, along with the directory manager to browse your files, and the viewers for individual files (editor for text, etc) all add up into a very useful program.

Crazy that I could have stopped after the first day of work and called it done. But I wanted to add a much cooler interface...the picture here doesn't show how cool the "bounce" sizing looks when you touch the things on the screen.

About a week later and it's all done and submitted to Apple. Even a website using Peter's nice templates: WiFi Disk. Hopefully shows up in the AppStore soon!

{Edit.  Names changed more for this than any other program we've done.  One of the working titles is in the picture.  Somebody already had a USB disk product with that name, so didn't use it.  But go the .com before I noticed.}

Thursday, December 4, 2008

iPhone Toolbar Menu Icon

I needed an icon for showing a menu of choices in the "FTP On The Go" iPhone app. Since it's using an UIActionSheet, I thought this turned out well...just simple boxes (with a little shading), shown in black here so visible on the background.



Seems the blogger site loses the alpha channel. Here's the original image. Free to use in any app.

www.ftponthego.com/toolbar-menu-button.png

Tuesday, November 25, 2008

Getting our money's worth.

A couple years ago, we bought a new logo design for GetRight (from glyfx.com; highly recommended.)

It was a much improved version of the basic idea I'd done years before with the arrows around a globe. My versions tended to look good as long as computers did 16 colors :)




We needed a new logo for the FTP On The Go program since the one we'd done was pretty simple and not too fancy. Peter adapted the GetRight logo, adding the burst effect and removing some arrows. It turned out awesome!

Monday, November 24, 2008

Clone wars

I watched the newer Clone Wars movie. If you expect it to be the first extended episode of a TV series for kids, you'll be happy. I'm sure my 10 year old nephew loved it.

But come on: The enemy characters in any number of video games I've played showed far better tactics than the stupid droid army (in this and the other movies). Marching in nice easy-to-hit rows into enemy fire was what lost the British the US revolutionary war.

Friday, November 21, 2008

Q

Just saw the new James Bond movie. Good, but is Q gone?

It used to be, Q would manage to provide just the gadget needed. You could count on the fact that if Bond had a laser watch, something would need to be cut; or if a mini underwater air tank, he'd be trapped underwater before the end of the film.

Now, it's mainly product placement for the newest Sony gadgets. Must be nice owning a movie studio.

Though Technology is to blame a bit; they had to get pretty crazy to have a gadget that wasn't available at Wal-Mart. Invisible cars and silly things like that.

Wednesday, November 19, 2008

Fading Default.png when iPhone app starts

More iPhone code. I wanted to have the startup logo (Default.png) graphic fade into the first screen after the program starts. This is a much nicer transition than just letting the view switch instantly.


1) Add the new image view to the class.

UIImageView *splashView;

And add this selector:
- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;


2) at the very bottom of "applicationDidFinishLaunching" add:

splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
splashView.alpha = 0.0;
[UIView commitAnimations];



3) Add this selector to cleanup the image and save memory.

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[splashView removeFromSuperview];
[splashView release];
}



4) Awesome bonus bit. Add this below the splashView.alpha = 0.0 line. It adds that extra bit of coolness to the transition.

splashView.frame = CGRectMake(-60, -60, 440, 600);