6

PhoneGap offers a nice solution for writing cross-platform apps with HTML5 and JavaScript.

But I would like to use Interface Builder for the UI, and just write all the controller code in Javascript instead of Objective-C (with of course the option to mix and match and especially call into any Objective-C libraries that I may need).

Is there a framework for this? Something akin to what CamelBones does for Perl.

The reason for wanting to do this is that the non-UI code can ideally be written in JavaScript to be reused for the web version, an possible future Android PhoneGap version, and the server-side (node.js).

4
  • You could try Cappuccino or SproutCore, though that's really targeted toward building for the web using Cocoa-like tech. My advice would be just to suck it up and use Objective-C. It isn't really all that bad ;) Commented Jan 13, 2011 at 0:12
  • 2
    Coincidentally, there's an O'Reilly book titled Learning the iOS SDK for JavaScript Programmers, oreilly.com/catalog/0636920010265 but it has nothing to do with writing apps in JavaScript and everything to do with making the jump to Obj-C ;) Commented Jan 13, 2011 at 0:15
  • 1
    I'm not gonna buy that book then... Commented Jan 13, 2011 at 0:30
  • and that O'Reilly book is not such a great read, IMHO - its a very long-winded with not enough sample code. I eventually stopped reading it and just watched youtube tutorials to get a grasp of objective-c Commented Jul 6, 2012 at 2:27

5 Answers 5

4

You could try using Appcelerator's Titanium product. It lets you write native iPhone apps in HTML+Javascript.

Check it out here. I haven't used it, but it seems like what you want.

Sign up to request clarification or add additional context in comments.

3 Comments

This does look like it can make use of native UI components. No mention of Interface Builder, though, and it still seems to run in a WebView. I guess if there is a good enough abstraction from the HTML/CSS so that I do not have to touch that, it would work (I really do not want to code my UI, I want a builder).
Here is a comparison between Titanium and PhoneGap (even though the accepted answer appears to be wrong): stackoverflow.com/questions/1482586/…
Apparently, they switched from using a WebView to something more native recently, so it probably is very close to what I was looking for: developer.appcelerator.com/question/71/…
3

The other possibility is to use iOS Javascript Bridge to write an app in Javascript.

https://github.com/coolbloke1324/iOS-JavaScript-Bridge

1 Comment

That looks cool. "Your JS is contained and executed inside a custom build of JavaScriptCore so that no private API calls are made". Too bad you have to ship your own copy of that library. I wonder how big it is. Would be nice of Apple to make it a public API.
0

You can try JSCocoa. It lets you write Cocoa apps in JavaScript, like a bridge.

It works on a Mac and iPhone. It also works with Interface Builder while you develop.

1 Comment

Says it works on the iPhone Simulator, waiting for a port of libffi: code.google.com/p/jscocoa/wiki/iPhone
0

Here's an article that mentions a few alternatives to using Objective-C

Comments

-1

Just stumbled upon this (old) question but wanted to contribute by mentioning NibleKit (http://www.nimblekit.com/index.php) that let's you build native iOS apps with just HTML & Javascript.

1 Comment

I found that same link but on the current date (October 02, 2014) it has the following notice: "NimbleKit was acquired by Sencha inc, selling licenses is stopped until further notice".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.