Apple Crippling Parked Web Apps on the Home Screen?
This is a little disappointing.
http://www.theregister.co.uk/2011/03/15/apple_ios_throttles_web_apps_on_home_screen/
This is a little disappointing.
http://www.theregister.co.uk/2011/03/15/apple_ios_throttles_web_apps_on_home_screen/
The filename is case sensitive on the device. It should be
Default.png
I tried to just use the reachabilityforInternetConnection from Apple’s example
internetReach = [[Reachability
reachabilityForInternetConnection] retain];
[internetReach startNotifier];
by itself – without invoking the reachabilityWithHostName counterpart
hostReach = [[Reachability
reachabilityWithHostName: @"www.apple.com"] retain];
[hostReach startNotifier];
and found that the callback was never invoked. However, when I switched and used the reachabilityWithHostName, the callbacks and subsequent notifications were being called as expected. Oh well..
The class in this post made it a snap to get the device type.
I’m creating a tabbed app. On several of the tab view controllers, I have table views that are loaded with data from the cloud. I needed to have a static image at the top of the screen that doesn’t scroll away as users scroll through the table. So I solved this with an intermediate view controller.
With that, I wanted to implement a “Pull To Refresh” behavior. I tried all of these solutions:
EGOTableViewRefresh
UIPullToReloadHeaderView
several others listed here
They all seem to subclass TableViewController and when used as the view in a tab, the graphics and animations worked as expected. However, when used in my intermediate ViewControllers, the graphics didn’t appear. The calls to refresh the data were being hit – I was just having no luck getting the imagery to render in the app. So what I ended up doing, was implementing:
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView
willDecelerate:(BOOL)decelerate
{
#ifdef LOTS_OF_LOGGING
NSLog(@"offset = %f", scrollView.contentOffset.y);
#endif
if ((scrollView.contentOffset.y < 0) && (refreshDelegate))
{
[refreshDelegate refreshData];
}
}
The intermediate ViewController is the delegate and it throws up an UIAlertView to indicate the data is refreshing. It’s not as sexy a solution as the embedded view above the table, but it communicates to the user what the app is doing in a straightforward and easily understood manner.
I’m excited!
In some of my apps, I allow users to send an email from a web page. I send an HTML email so instead of just passing the URL as the title of the anchor, i wanted to send the page title. There is no property of the web view to do this, but I found that you can do it quickly in javascript by:
[theWeb stringByEvaluatingJavaScriptFromString:
@"document.title"];
This is a good read.
At first I resorted to setting the font in the ViewController’s viewDidLoad.. like
txtView.font = [UIFont
fontWithName:@"Helvetica" size:(float)currentSize];
but then I stumbled onto this post.. And, after reading it, I was like “well of course…”
Seems like an odd thing to have to manually code but alas…
In the delegate, add.
if ([[[request URL] scheme] isEqual:@"mailto"] &&
[[UIApplication sharedApplication] canOpenURL:[request URL]])
{
if ([[UIApplication sharedApplication]
openURL:[request URL]])
{
return NO;
}
}
return YES;
The canOpenURL check is more for the simulator.. Without it, the links are silently consumed. At least with this in place, I get some feedback.
A better solution would be to use the MFMailComposeViewController but opening the mail.app is good enough for my purposes in building this demo app.