README.md in ProMotion-0.1.2 vs README.md in ProMotion-0.2.0

- old
+ new

@@ -1,23 +1,23 @@ # ProMotion - A new way to organize RubyMotion apps. ProMotion introduces a new object called "Screens". Screens have a one-to-one relationship with your app's screens and can (usually) take the place of view controllers. -Typical /app file structure: +Typical app file structure: - app - screens - photos + app/ + screens/ + photos/ list_photos_screen.rb show_photo_screen.rb edit_photo_screen.rb home_screen.rb settings_screen.rb - models - view_controllers - views + models/ + view_controllers/ + views/ app_delegate.rb ## Usage Loading your home screen: @@ -118,11 +118,11 @@ end end ``` -Close a screen, passing back arguments to the previous screen's "on_return" method: +Close a screen (modal or in a nav controller), passing back arguments to the previous screen's "on_return" method: ```ruby class ItemScreen # ... def save_and_close @@ -165,11 +165,13 @@ @element = set_attributes UIView.alloc.initWithFrame(CGRectMake(0, 0, 20, 20)), { backgroundColor: UIColor.whiteColor } ``` -You can create sectioned table screens easily. TableScreen, SectionedTableScreen, GroupedTableScreen +You can create sectioned table screens easily. TableScreen, SectionedTableScreen, GroupedTableScreen. +This is loosely based on [motion-table](https://github.com/clearsightstudio/motion-table) (there are a +few minor differences). ```ruby class SettingsScreen < ProMotion::GroupedTableScreen title "Settings" @@ -207,15 +209,45 @@ # ... end end ``` +# Reference +(not comprehensive yet...working on this) + +<table> + <tr> + <th>Class or Module</th> + <th>Method</th> + <th>Description</th> + </tr> + <tr> + <td>Screen</td> + <td>is_modal?</td> + <td>Returns if the screen was opened in a modal window.</td> + </tr> + <tr> + <td>&nbsp;</td> + <td>has_nav_bar?</td> + <td>Returns if the screen is contained in a navigation controller.</td> + </tr> + <tr> + <td>&nbsp;</td> + <td>set_tab_bar_item(args)</td> + <td> + Creates the tab that is shown in a tab bar item.<br /> + Arguments: <code>{ icon: "imagename", systemIcon: UISystemIconContacts, title: "tabtitle" }</code> + </td> + </tr> +</table> + ### What about MVC? I'm a big believer in MVC (I'm a Rails developer, too). I found that most of the time working in RubyMotion seems to happen -in the ViewControllers and views are mainly custom elements. This pattern may be best for simpler, smaller apps. +in the ViewControllers and views are mainly custom elements. This pattern is probably best for navigation controller and +tab bar based apps. -Feedback welcome via twitter @jamonholmgren. +Feedback welcome via twitter @jamonholmgren or email jamon@clearsightstudio.com. ## Contributing I'm really looking for feedback. Tweet me with your ideas or open a ticket (I don't mind!) and let's discuss.