https://github.com/markrickert/promotiontwoscreensinone-example
An example Promotion (RubyMotion) application that shows how to use two PM::Screen instances in a master screen.
https://github.com/markrickert/promotiontwoscreensinone-example
Last synced: 4 months ago
JSON representation
An example Promotion (RubyMotion) application that shows how to use two PM::Screen instances in a master screen.
- Host: GitHub
- URL: https://github.com/markrickert/promotiontwoscreensinone-example
- Owner: markrickert
- Created: 2013-08-30T14:06:38.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T22:39:31.000Z (over 7 years ago)
- Last Synced: 2025-02-23T00:32:27.738Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 164 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PromotionTwoScreensInOne-Example
===
Summary
---
An example Promotion (RubyMotion) application that shows how to use two PM::Screen instances in a master screen and communicate between them.
More in depth
---
This example uses [ProMotion](https://github.com/clearsightstudio/ProMotion). We create one [PM::Screen](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::Screen) and initialize two other PM::Screen subclasses and set all their attributes. Then when we lay out the the main view controller, we add the two PM::Screen's respective views to the main screen.
This app is a map with a tableview under it that lists out all the states. You can tap a state and the map will animate and zoom to encompass the entire state. This app also showcases Apple's reverse geocoding api very nicely since I'll I'm doing to get the map coordinates and region is asking Apple where "State, USA" is and it returns back all the relevant data for me to use.
Making the screens talk to each other
---
You can see how I'm passing messages from the [PM::TableScreen](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::TableScreen) to the [PM::MapScreen](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::MapScreen) using the `attr_accessor :container` to pass in `self` and therefore allow messages to be easily sent to the main view controller to manupilate both screens.
Screenshots
---

