ProMotion 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +77 -15
  3. metadata +39 -22
data/.gitignore CHANGED
@@ -13,3 +13,4 @@ pom.xml
13
13
  *.clj
14
14
  .repl_histroy
15
15
  .rvmrc
16
+ *.gem
data/README.md CHANGED
@@ -13,16 +13,34 @@ Typical app file structure:
13
13
 
14
14
  app/
15
15
  screens/
16
- photos/
17
- list_photos_screen.rb
18
- show_photo_screen.rb
19
- edit_photo_screen.rb
16
+ events/
17
+ list_events_screen.rb
18
+ show_event_screen.rb
19
+ edit_event_screen.rb
20
20
  home_screen.rb
21
21
  settings_screen.rb
22
22
  models/
23
+ event.rb
23
24
  views/
25
+ buttons/
26
+ save_event_button_view.rb
24
27
  app_delegate.rb
25
28
 
29
+ ## What's New in 0.4.0?
30
+
31
+ * Screens are now UIViewControllers (they used to contain UIViewControllers, but that got too funky) so you can do normal UIViewController stuff with them
32
+ * Screen functionality can also be inherited as a module in your own UIViewController, but you need to provide your own methods for viewDidLoad and whatnot.
33
+ * Tons of headlessCamelCaps methods are now properly_ruby_underscored (with an alias to the old name for compatibility)
34
+ * `open_screen` and `close_screen` can now just be `open` and `close` respectively
35
+ * Attempted to keep 100% compatibility with 0.3.x but no guarantees...report issues, please!
36
+ * Revamped the internal folder structure of the gem...more work on this to come
37
+ * Built in a few helpers that were external before, like `content_height(view)`
38
+ * More consistent calling of `on_load` (sometimes doesn't get called in 0.3.x)
39
+ * `fresh_start SomeScreen` is now `open_root_screen SomeScreen`
40
+ * Removed `set_view_controller` as we don't need it anymore
41
+ * Better documentation (still needs work), better error messages
42
+ * Deprecation warnings EVERYWHERE for older apps (upgrade already!)
43
+
26
44
  ## Usage
27
45
 
28
46
  Loading your home screen:
@@ -164,17 +182,6 @@ class MainScreen < ProMotion::Screen
164
182
  end
165
183
  ```
166
184
 
167
- Use a custom view controller:
168
-
169
- ```ruby
170
- def on_load
171
- set_view_controller MyCustomViewController
172
-
173
- # Note: on_appear will not fire when using a custom
174
- # view controller.
175
- end
176
- ```
177
-
178
185
  The helper add_element takes any view object and adds it to the current view. You can also use
179
186
  the helper ProMotion::ViewHelper.set_attributes(view, attributes) to do the same thing without adding
180
187
  it to the current view. Screens include this helper by default.
@@ -245,6 +252,61 @@ your Rakefile and doing this:
245
252
  ]
246
253
  ```
247
254
 
255
+ ## Using your own UIViewController or Formotion
256
+
257
+ Sometimes you want to inherit from a different UIViewController than that provided by ProMotion,
258
+ such as when using [Formotion](https://github.com/clayallsopp/formotion). RubyMotion doesn't currently allow us to override built-in methods
259
+ when including as a module, so there's a workaround for that.
260
+
261
+ ```ruby
262
+ class EventsScreen < Formotion::FormController # Can also be < UIViewController
263
+ include ProMotion::ScreenModule # Not TableScreenModule since we're using Formotion for that
264
+
265
+ # Required functions for ProMotion to work properly
266
+
267
+ def viewDidLoad
268
+ super
269
+ self.view_did_load if self.respond_to?(:view_did_load)
270
+ end
271
+
272
+ def viewWillAppear(animated)
273
+ super
274
+ self.view_will_appear(animated) if self.respond_to?("view_will_appear:")
275
+ end
276
+
277
+ def viewDidAppear(animated)
278
+ super
279
+ self.view_did_appear(animated) if self.respond_to?("view_did_appear:")
280
+ end
281
+
282
+ def viewWillDisappear(animated)
283
+ self.view_will_disappear(animated) if self.respond_to?("view_will_disappear:")
284
+ super
285
+ end
286
+
287
+ def viewDidDisappear(animated)
288
+ self.view_did_disappear(animated) if self.respond_to?("view_did_disappear:")
289
+ super
290
+ end
291
+
292
+ def shouldAutorotateToInterfaceOrientation(orientation)
293
+ self.should_rotate(orientation)
294
+ end
295
+
296
+ def shouldAutorotate
297
+ self.should_autorotate
298
+ end
299
+
300
+ def willRotateToInterfaceOrientation(orientation, duration:duration)
301
+ self.will_rotate(orientation, duration)
302
+ end
303
+
304
+ def didRotateFromInterfaceOrientation(orientation)
305
+ self.on_rotate
306
+ end
307
+ end
308
+ ```
309
+
248
310
  # Reference
249
311
  (not comprehensive yet...working on this)
250
312
 
metadata CHANGED
@@ -1,27 +1,37 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ProMotion
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 13
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 1
10
+ version: 0.4.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jamon Holmgren
9
14
  - Silas Matson
10
15
  - ClearSight Studio
11
16
  autorequire:
12
17
  bindir: bin
13
18
  cert_chain: []
14
- date: 2013-02-05 00:00:00.000000000 Z
19
+
20
+ date: 2013-02-21 00:00:00 Z
15
21
  dependencies: []
22
+
16
23
  description: ProMotion is a new way to easily build RubyMotion iOS apps.
17
- email:
24
+ email:
18
25
  - jamon@clearsightstudio.com
19
26
  - silas@clearsightstudio.com
20
27
  - contact@clearsightstudio.com
21
28
  executables: []
29
+
22
30
  extensions: []
31
+
23
32
  extra_rdoc_files: []
24
- files:
33
+
34
+ files:
25
35
  - .gitignore
26
36
  - .repl_history
27
37
  - Gemfile
@@ -60,29 +70,36 @@ files:
60
70
  - lib/ProMotion/version.rb
61
71
  homepage: https://github.com/clearsightstudio/ProMotion
62
72
  licenses: []
73
+
63
74
  post_install_message:
64
75
  rdoc_options: []
65
- require_paths:
76
+
77
+ require_paths:
66
78
  - lib
67
- required_ruby_version: !ruby/object:Gem::Requirement
79
+ required_ruby_version: !ruby/object:Gem::Requirement
68
80
  none: false
69
- requirements:
70
- - - ! '>='
71
- - !ruby/object:Gem::Version
72
- version: '0'
73
- required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
89
  none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
79
97
  requirements: []
98
+
80
99
  rubyforge_project:
81
100
  rubygems_version: 1.8.24
82
101
  signing_key:
83
102
  specification_version: 3
84
- summary: ProMotion is a new way to organize RubyMotion apps. Instead of dealing with
85
- UIViewControllers, you work with Screens. Screens are a logical way to think of
86
- your app and include a ton of great utilities to make iOS development more like
87
- Ruby and less like Objective-C.
103
+ summary: ProMotion is a new way to organize RubyMotion apps. Instead of dealing with UIViewControllers, you work with Screens. Screens are a logical way to think of your app and include a ton of great utilities to make iOS development more like Ruby and less like Objective-C.
88
104
  test_files: []
105
+