React Navigation: a Collaborative Effort in the React Native Community

React Navigation for React Native is “collaboration between people from Facebook, Exponent and the React community at large” as this comment on the project’s GitHub page indicates:

React Navigation is born from the React Native community’s need for an extensible yet easy-to-use navigation solution. It replaces and improves upon several navigation libraries in the ecosystem, including Ex-Navigation, React Native’s Navigator and NavigationExperimental components. React Navigation can also be used across React and React Native projects allowing for a higher degree of shared code. Once stable, NavigationExperimental will be deprecated in favor of React Navigation. React Navigation is a collaboration between people from Facebook, Exponent and the React community at large.

Also interesting is the revealing that React Native’s NavigationExperimental will be deprecated in favor of this new navigation system.

Details can be found here:

How to Format JSON in TextWrangler [#iosdev, #json, #webdev]

If you’re a TextWrangler user and you wanted to be able to format a block of JSON, you can do it yourself by following the instructions at Java Dev on Mac OS X: Format JSON in TextWrangler

1. Create text (Python) file called “Format JSON” in the following location:

~/Library/Application Support/TextWrangler/Text Filters/Format JSON.py

2. Add the following Python code to take care of the formatting:

#!/usr/local/bin/python
import fileinput
import json
if __name__ == "__main__":
  text = ''
  for line in fileinput.input():
    text = text + ' ' + line.strip()
  jsonObj = json.loads(text)
  print json.dumps(jsonObj, sort_keys=True, indent=2)

One thing that tripped me up is that you need to select a block of text before running the macro. Otherwise it works great.

Thanks for the tip!

UPDATE:
I’m not sure if it was due to installing newer versions of Xcode or Mountain Lion, but I noticed that I was getting an error when attempting to run the script.

Evidently the first line:

#!/usr/local/bin/python

Might need to be:

#!/usr/bin/python

…or maybe you could create a symbolic link as well, but for me, since I’m not a Python guru, modifying the script was the easiest way to fix the problem.

Xcode 4 Tip from iOS Developer Tips: Related Files List [@iosdevtips, #iosdev]

Good tip from iOS Developer Tips for using the “Related Files” button in the upper left corner of your code window (right next to the Back/Forward navigation buttons):

Xcode 4 : Related Files List

With Xcode 4 you can quickly access an assortment of files related to your project through the Related Files option in the Jump Bar.

 

iOS 5 now cleaning out Caches and tmp directories – could pose a real problem for app developers [#iosdev, #iOS5, @marcoarment]

This sounds like it could really be a problem for developers who store anything but truly temporary data in the Caches or tmp directory…

Cleaning… – Marco.org

Every iOS app has its own “home” directory where it can store files. Every file and directory that an app puts there, except anything in a Caches or tmp directory, gets backed up when you sync your device to iTunes.

Prior to iOS 5, the system never deleted the contents of Caches and tmp, so they were safe places for apps to put data that should always be available but could be redownloaded if the user did a complete restore or otherwise lost all data, and therefore shouldn’t be taking up space in backups and slowing down syncs.

In iOS 5, since iCloud backups are now possible, Apple has started cracking down on apps that store too much in any backed-up directory, such as Documents.

Instapaper has stored its downloaded articles in Caches for years, since I didn’t want to slow down iTunes syncing for my customers or enlarge their backups unnecessarily, and full restores don’t happen often enough for it to be a problem for most people. This new policy now locks me into using Caches: I no longer have a choice.

But in iOS 5, there’s an important change: Caches and tmp — the only two directories that aren’t backed up — are “cleaned” out when the device is low on space.

#iOSDev Tip: Unblock events caused when adding subviews to your UIButtons

Recently, I was having an issue I was having with subviews added to my UIButton objects that I was customizing. The buttons would behave fine if they were standard rounded rect buttons, but the moment I added a UIView and some UILabels to it, the taps stopped responding.

But I was able to resolve it, thanks to the tip provided here:

iPhone: Subviews in UIButtons block the touch, unless…

The solution boils down to something very simple and it makes sense when you think about it, but at first it seems strange:

  • All you need to do is set userInteractionEnabled and exclusiveTouch to NO on the items that you want to add as subviews to your UIButton (and don’t set those properties to NO for the UIButton itself).

Once you turn off user interaction and exclusive touch properties on the subviews, your events will be sent to the underlying button (or at least that’s how I like to think of it happening…).

I initially read the post wrong and set them to YES and couldn’t figure out why it wasn’t working. Then I went back and looked at the comments, which pointed out where I went wrong.

Hope this helps!

///eks

What is the Future of iOS Notification?

One of the more annoying things about iOS is its notification system. Modal alerts are so arcane, intrusive and annoying, I am actually shocked that they are still the standard method of notification in iOS as of version 4…

Looks like there are some underground movements (requiring jailbreaking, of course) to change that. Here’s a little commentary by Sebastiaan de With (@cocoia) that I found interesting:

Cocoia Blog » Getting Notified:

There’s some discussion on Apple-centric and tech news websites about a video that’s doing the rounds with a new approach to notifications for iOS. While the system in the video is really nothing new (there’s been at least one alternative notification system in the App-Store-for-jailbroken-phones “Cydia” since 2010) it is getting a lot of attention, presumably because iOS users are quite satisfied with almost all the interactions of the OS except those dang stacking modal dialogs that interrupt your game of Angry Birds every time you get a text message.

So while I am not a jailbreaker (and never will be), my hope is that Apple and its designers and developers on the iOS team will take notice of this and do something about it in a future version of iOS.

We shall see…

iOS Simulator QuickTip: Removing all installed applications.

It was time to clean house a bit, so I wanted to remove all the currently installed applications in the iPhone Simulator. Turns out there’s a very simple way to do it…

1. With the iPhone Simulator running, click on the iOS Simulator application menu.

2. Click “Reset Contents and Settings…”.

– A confirmation dialog will appear warning that “all installed applications, content, and settings will be moved to the trash.”

3. Click “Reset.”

All the applications will be removed and you can proceed with a clean slate.

Overcoming Hurdles of Building Phonegap Apps for Android on Windows

The other day I was attempting to build and test a simple example Phonegap application for Android on my Windows box. Unfortunately, I was unable to successfully execute the “droidgap” call using ruby and Git Bash.

It would kinda build out a structure and then would bomb when attempting to build out the .jar file.

Thankfully, Stack Overflow to the rescue (again)!

phonegap android sample project not building – Stack Overflow

The important point is that, evidently, the droidgap build script needed to call “ant.bat” on Windows (as opposed to just “ant”). This was even with the path to ant set in my PATH environment variable.

Thanks again, Stack Overflow.

No, the Tools are Not Free.
Just as a commentary, the hurdles to get to point zero with building an Android application – and by extension Phonegap – is just a bit ridiculous. I’m dreading the thought of having to do updates as well, but hopefully some time will pass before that’s necessary. “But they’re free!” some will say. Actually, it’s not really true. When you consider the amount of time it took to download all the various-and-sundry parts of the environment and get them all installed and (hopefully) working, it’s at least a few hundred dollars worth of time spent on what should be a one-or-two step installation process.

Seriously, doing the same process for iPhone is much simpler, and I’ll be interested to see how things pan out for Windows Phone 7 development.