Skip to content

Commit

Permalink
Merged Dev Branch
Browse files Browse the repository at this point in the history
  • Loading branch information
probablycorey committed Feb 8, 2011
2 parents b906108 + 6ee172f commit e998c34
Show file tree
Hide file tree
Showing 133 changed files with 4,472 additions and 3,546 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build/
*.pbxuser
*.perspectivev3
wax.framework
lib/wax_stdlib.h
56 changes: 18 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
Wax
===
Wax is a framework that lets you write native iPhone apps in
[Lua](http://www.lua.org/about.html). It bridges Objective-C and Lua using the
Objective-C runtime. With Wax, **anything** you can do in Objective-C is **automatically**
available in Lua! What are you waiting for, give it a shot!

Wax is a framework that lets you write iPhone apps in [Lua](http://www.lua.org/about.html). It bridges Objective-C and Lua using the Objective-C runtime. With Wax, anything you can do in Objective-C is **automatically** available in Lua! What are you waiting for, give it a shot!
Why write iPhone apps in Lua?
---------------------------------------

Setup
-----
I love writing iPhone apps, but would rather write them in a dynamic language than in Objective-C. Here
are some reasons why many people prefer Lua + Wax over Objective-C...

1. Clone wax [http://github.com/probablycorey/wax/](http://github.com/probablycorey/wax/)
* Automatic Garbage Collection! Gone are the days of alloc, retain, and release.

2. From the command line, **cd** into wax folder created above and type **rake install**. This will install an xcode project template.
* Less Code! No more header files, no more static types, array and dictionary literals!
Lua enables you to get more power out of less lines of code.

3. Open up xcode and create a new **Wax** project, it should be located under the **User Tempates** section.

4. Build and Run! You've got lua running on the iPhone!

5. Start editing **wax/data/scripts/AppDelegate.lua** to make your app!

Why?
----

I love writing iPhone apps, but would rather write them in a dynamic language than in Objective-C. Here are some reasons why many people prefer Lua + Wax over Objective-C...

* Automatic Garbage Collection! Gone are the days of release and autorelease.

* Less Code! No more header files, no more static types, array and dictionary literals! Lua enables you to get more power out of less lines of code.

* Access to every Cocoa, UITouch, Foundation, etc.. framework, if it's written in Objective-C, Wax exposes it to Lua automatically. All the frameworks you love are all available to you!
* Access to every Cocoa, UITouch, Foundation, etc.. framework, if it's written in Objective-C,
Wax exposes it to Lua automatically. All the frameworks you love are all available to you!

* Super easy HTTP requests. Interacting with a REST webservice has never been eaiser

* Lua has closures, also known as blocks! Anyone who has used these before knows how powerful they can be.

* Lua has a build in Regex-like pattern matching library.


You get all of this with Lua, with no downside!

Examples
--------

Expand Down Expand Up @@ -105,14 +92,14 @@ Since Wax converts NSString, NSArray, NSDictionary and NSNumber to native Lua va
local size = toobjc(testString):sizeWithFont(bigFont)
puts(size)

Tutorials
---------
Setup & Tutorials
-----------------

[Setting up iPhone wax](http://probablyinteractive.com/2009/10/18/Setting-up-iPhone-Wax.html)
[Setting up Wax](https://github.com/probablycorey/wax/wiki/Installation)

[How does iPhone Wax work?](http://probablyinteractive.com/2009/10/19/How-does-iPhone-Wax-work.html)
[How does Wax work?](https://github.com/probablycorey/wax/wiki/Overview)

[Twitter client in Wax](http://probablyinteractive.com/2009/10/20/Wax-talks-to-twitter.html)
[Simple Twitter client in Wax](https://github.com/probablycorey/wax/wiki/Twitter)

Which API's are included?
-------------------------
Expand All @@ -123,13 +110,6 @@ Created By
----------
Corey Johnson (probablycorey at gmail dot com)

Acknowledgements
----------------

[Aman Gupta](http://github.com/tmm1): For adding YAJL JSON support.

[Apple](http://www.apple.com/iphone/): For creating such an awesome development platform.

More
----
* [Feature Requests? Bugs?](http://github.com/probablycorey/wax/issues) - Issue tracking and release planning.
Expand Down
2 changes: 1 addition & 1 deletion bin/hammer
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Hammer
def self.headless
return if not @should_run_headless
if ENV["PLATFORM_NAME"] !~ /simulator/
puts "Can only run tests on the simulator not #{ENV["PLATFORM_NAME"]}"
puts "Can only be run on the simulator not #{ENV["PLATFORM_NAME"]}"
exit 1
end

Expand Down
4 changes: 2 additions & 2 deletions bin/update-xibs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'rubygems'
require 'xml'
require 'erb'

PROJECT_DIR = File.expand_path("../../..", __FILE__)
PROJECT_DIR = Dir.pwd
XML.indent_tree_output = true
XML.default_tree_indent_string = "\t"

Expand All @@ -15,7 +15,7 @@ class LuaClass
attr :actions

def self.all
lua_files = Dir["#{PROJECT_DIR}/data/**/*.lua"]
lua_files = Dir["#{PROJECT_DIR}/**/*.lua"]
lua_files.map {|f| parse(open(f).read)}.compact
end

Expand Down
136 changes: 93 additions & 43 deletions examples/IBExample/BlueView.xib
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
<string key="IBDocument.AppKitVersion">1038.25</string>
<string key="IBDocument.HIToolboxVersion">458.00</string>
<int key="IBDocument.SystemTarget">1056</int>
<string key="IBDocument.SystemVersion">10H574</string>
<string key="IBDocument.InterfaceBuilderVersion">823</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">62</string>
<string key="NS.object.0">132</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -31,9 +30,11 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
Expand All @@ -45,13 +46,15 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 45}, {280, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor" id="563072086">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUITag">1</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont">
Expand Down Expand Up @@ -79,11 +82,13 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 125}, {280, 193}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="IBUIBackgroundColor" ref="563072086"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUITag">2</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string type="base64-UTF8" key="IBUIText">RmlsZSdzIE93bmVyIGlzIHNldCB0byBnZW5lcmljICdVSVZpZXdDb250cm9sbGVyJwoKVGFncyBhcmUg
c2V0IHVzaW5nIHRoZSBJbnNwZWN0aW9uIHdpbmRvdy4gVGhpcyB0ZXh0Ym94IGhhcyBhIHRhZyBvZiAy
LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
Expand All @@ -103,13 +108,14 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<int key="IBUITextAlignment">1</int>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC40MDAwMDAwMDYgMC44MDAwMDAwMTE5IDEAA</bytes>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
Expand All @@ -121,7 +127,24 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">6</int>
<int key="connectionID">8</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">textField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="848650548"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">buttonTouched:</string>
<reference key="source" ref="504711114"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">10</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
Expand Down Expand Up @@ -179,9 +202,9 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIViewController</string>
<string>BlueController</string>
<string>UIResponder</string>
<string>{{354, 412}, {320, 480}}</string>
<string>{{575, 427}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
Expand All @@ -203,9 +226,42 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">6</int>
<int key="maxID">10</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">BlueController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">buttonTouched:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">buttonTouched:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">buttonTouched:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">textField</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">textField</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">textField</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
Expand Down Expand Up @@ -243,41 +299,20 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand All @@ -299,13 +334,6 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand Down Expand Up @@ -372,6 +400,13 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand All @@ -394,6 +429,20 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand All @@ -412,9 +461,10 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="768" key="NS.object.0"/>
<integer value="1056" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
Expand All @@ -423,6 +473,6 @@ LCB0aGUgYnV0dG9uJ3MgdGFnIGlzIDEuA</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">IBExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">3.1</string>
<string key="IBCocoaTouchPluginVersion">132</string>
</data>
</archive>
Loading

0 comments on commit e998c34

Please sign in to comment.