ProMotion-formotion 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/Gemfile.lock +20 -0
- data/LICENSE +22 -0
- data/ProMotion-formotion.gemspec +25 -0
- data/lib/ProMotion-formotion.rb +9 -0
- data/lib/ProMotion/formotion_screen.rb +70 -0
- data/lib/ProMotion/version-formotion.rb +3 -0
- metadata +8 -1
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ProMotion-formotion (0.0.1)
|
5
|
+
ProMotion (~> 0.4.1)
|
6
|
+
formotion (~> 1.1.4)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ProMotion (0.4.1)
|
12
|
+
bubble-wrap (1.1.5)
|
13
|
+
formotion (1.1.5)
|
14
|
+
bubble-wrap (>= 1.1.4)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
ProMotion-formotion!
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Stephan Toggweiler
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/ProMotion/version-formotion', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Stephan Toggweiler"]
|
6
|
+
gem.email = ["stephan@rheoli.net"]
|
7
|
+
gem.description = "ProMotion-formotion bind ProMotion and formotion together."
|
8
|
+
gem.summary = "
|
9
|
+
ProMotion is a new way to organize RubyMotion apps. Instead of dealing
|
10
|
+
with UIViewControllers, you work with Screens. Screens are
|
11
|
+
a logical way to think of your app and include a ton of great
|
12
|
+
utilities to make iOS development more like Ruby and less like Objective-C.
|
13
|
+
"
|
14
|
+
gem.homepage = "https://github.com/rheoli/ProMotion-formotion"
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($\)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.name = "ProMotion-formotion"
|
20
|
+
gem.require_paths = ["lib"]
|
21
|
+
gem.version = ProMotion::FORMOTION_VERSION
|
22
|
+
gem.add_dependency("ProMotion", "~> 0.4.1")
|
23
|
+
gem.add_dependency("formotion", "~> 1.1.4")
|
24
|
+
end
|
25
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
unless defined?(Motion::Project::Config)
|
2
|
+
raise "This file must be required within a RubyMotion project Rakefile."
|
3
|
+
end
|
4
|
+
|
5
|
+
require "ProMotion/version-formotion"
|
6
|
+
|
7
|
+
Motion::Project::App.setup do |app|
|
8
|
+
app.files = Dir.glob(File.join(File.dirname(__FILE__), 'ProMotion/**/*.rb')) | app.files
|
9
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module ProMotion
|
2
|
+
|
3
|
+
class FormotionScreen < Formotion::FormController # Can also be < UIViewController
|
4
|
+
include ProMotion::ScreenModule # Not TableScreenModule since we're using Formotion for that
|
5
|
+
|
6
|
+
# Required functions for ProMotion to work properly
|
7
|
+
|
8
|
+
def form_data
|
9
|
+
{}
|
10
|
+
end
|
11
|
+
|
12
|
+
def init_form
|
13
|
+
@local_form=Formotion::Form.new(form_data)
|
14
|
+
if self.respond_to?(:on_submit)
|
15
|
+
@local_form.on_submit do |form|
|
16
|
+
self.on_submit(form.render)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
self.initWithForm(@local_form)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.new(args = {})
|
23
|
+
s = self.alloc.init_form
|
24
|
+
s.on_create(args) if s.respond_to?(:on_create)
|
25
|
+
s
|
26
|
+
end
|
27
|
+
|
28
|
+
def viewDidLoad
|
29
|
+
super
|
30
|
+
self.view_did_load if self.respond_to?(:view_did_load)
|
31
|
+
end
|
32
|
+
|
33
|
+
def viewWillAppear(animated)
|
34
|
+
super
|
35
|
+
self.view_will_appear(animated) if self.respond_to?("view_will_appear:")
|
36
|
+
end
|
37
|
+
|
38
|
+
def viewDidAppear(animated)
|
39
|
+
super
|
40
|
+
self.view_did_appear(animated) if self.respond_to?("view_did_appear:")
|
41
|
+
end
|
42
|
+
|
43
|
+
def viewWillDisappear(animated)
|
44
|
+
self.view_will_disappear(animated) if self.respond_to?("view_will_disappear:")
|
45
|
+
super
|
46
|
+
end
|
47
|
+
|
48
|
+
def viewDidDisappear(animated)
|
49
|
+
self.view_did_disappear(animated) if self.respond_to?("view_did_disappear:")
|
50
|
+
super
|
51
|
+
end
|
52
|
+
|
53
|
+
def shouldAutorotateToInterfaceOrientation(orientation)
|
54
|
+
self.should_rotate(orientation)
|
55
|
+
end
|
56
|
+
|
57
|
+
def shouldAutorotate
|
58
|
+
self.should_autorotate
|
59
|
+
end
|
60
|
+
|
61
|
+
def willRotateToInterfaceOrientation(orientation, duration:duration)
|
62
|
+
self.will_rotate(orientation, duration)
|
63
|
+
end
|
64
|
+
|
65
|
+
def didRotateFromInterfaceOrientation(orientation)
|
66
|
+
self.on_rotate
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion-formotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -51,7 +51,14 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
56
|
+
- LICENSE
|
57
|
+
- ProMotion-formotion.gemspec
|
54
58
|
- README.md
|
59
|
+
- lib/ProMotion-formotion.rb
|
60
|
+
- lib/ProMotion/formotion_screen.rb
|
61
|
+
- lib/ProMotion/version-formotion.rb
|
55
62
|
homepage: https://github.com/rheoli/ProMotion-formotion
|
56
63
|
licenses: []
|
57
64
|
post_install_message:
|