iOS Safari Enhancement

I have run into an odd issue with iOS Safari on the iPad recently. In the current application I am working on, we have a list of items that can be dragged and dropped on the page. This works great with the mouse. However, I run into issues when I start throwing the touchstart, touchmove, and touchend events in.

The Problem

When a user starts to move their finger around on the iPad, normally this will cause the iPad to "pan" the window around (assuming there is area to scroll). Let's say the page is long, though, so the window can scroll down.

Apple does not trigger any javascript events for this pan (see the document here). The window just scrolls around. However, if the user happens to touch on an item that is capturing events, one of two things can happen:

1. The touchmove event returns false (or calls preventDefault), in which case the window will not scroll up or down ever when a user swipes on one of those items.

2. The touchemove returns true, in which case the window may scroll up or down with, but if you are "dragging" the item, that will scroll as well.

I have created a jsFiddle here to show you what I mean. List 1 prevents the default behavior, whereas List 2 returns true and allows dragging and scrolling.

Neither of these is preferable.

The Solution

The issue is that I think iOS needs to provide a way of canceling the default pan behavior that a user initiates. I have opened up a bug report with Apple, so I will keep this article posted to in case of any update. Let's hope they do.

I'm not sure why there really isn't any way to control (from the browser) at least a way to cancel this event.

From a psuedo-code perspective, what I would like to do, is allow the user to scroll (pan) around the screen as long as the touch-and-hold event is less than say 500ms. In that case, I will return true (but I won't move the dragged item). After 500ms, though, if the user is still moving around, I would cancel the scroll (pan) event, and then move the dragged item around.

Anyway, for now, we are making a small grab region on the item. However, I think it would be nice to fix this in the future.

Apple iPhone 5s Thumbprint Scanner

Not to gripe about an obvious issue, but I'm as equally unimpressed with the thumbprint scanner on the new Apple iPhone 5s as I am impressed.

I'm impressed when it works. I think "Wow! That is cool."

However, the scanner seems to only work about 50% of the time for me.

I've added my thumbprint numerous times in the settings. And at first, it works great. After some time, though, it starts to degrade.

I think there's two problems, though. First, I live in a cold climate and my hands get very dry in the winter time. If I look at my finger tips, the skin is dry and flakey. I think this starts to confuse the scanner (not surprisingly).

Second, I think if any kind of oily residue starts to build up on the scanner, it will stop working. I still need to test this, but right now, my fingers are too dry to do so.

Anyway, cool idea. Very useful. It would be nice if it were more reliable, though. Maybe Apple needs more beta testers in the Minnesota, though. 🙂

Safari Not Working, But Firefox Does

I recently had a problem on my Macbook where Safari would stop working after a few minutes of connecting to the network, but other network applications, like Firefox, still worked. It was odd. Safari would just sit and hang.

After some research, what ended up working for me was to create a new network profile. Here are the steps to do that in Mac OSX (10.7.2).

1. Go to the Apple Menu in the upper left and choose

Select System Preferences

2. Click on the "Network" icon.

3. At the top select "Edit Locations..." from the Location drop down.

Edit Locations

4. Click the plus sign to add a new location and name it something like "home" or "work." Then, click "Done."

New Location

5. That should be it. Safari should work now.

 

[UITableViewController loadView] loaded the “some-id” nib but didn’t get a UITableView.

The following error occurred when adding a UIView to the root of a NIB expecting that was loaded by a UITableViewController class.

uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "some-id" nib but didn't get a UITableView.'

If you have a UITableViewController and your root element is not a UITableView, you should make your controller extend UIViewController (not UITableViewController) and implement the UITableViewDelegate and UITableViewDataSource interfaces.

Your header file would look like this.

@interface ContactUsViewController : UIViewController<UITableViewDelegate, UITableViewDataSource> {
    IBOutlet UITableView* tableView;
}

@property (nonatomic, retain) UITableView* tableView;

@end

You should also add a reference to the table so that you can access it in your implementation. You may have to extend the UITableView in order to extend the operations.