ProMotion 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +1 -0
- data/ProMotion.gemspec +14 -14
- data/README.md +26 -46
- data/Rakefile +13 -8
- data/lib/ProMotion.rb +2 -12
- data/lib/ProMotion/cocoatouch/navigation_controller.rb +11 -11
- data/lib/ProMotion/cocoatouch/split_view_controller.rb +4 -4
- data/lib/ProMotion/cocoatouch/tab_bar_controller.rb +5 -5
- data/lib/ProMotion/cocoatouch/table_view_cell.rb +2 -0
- data/lib/ProMotion/containers/split_screen.rb +4 -0
- data/lib/ProMotion/containers/tabs.rb +10 -8
- data/lib/ProMotion/delegate/delegate.rb +3 -0
- data/lib/ProMotion/delegate/delegate_module.rb +5 -0
- data/lib/ProMotion/extensions/conversions.rb +4 -4
- data/lib/ProMotion/map/map_screen.rb +4 -0
- data/lib/ProMotion/map/map_screen_module.rb +1 -1
- data/lib/ProMotion/screen/screen.rb +3 -0
- data/lib/ProMotion/screen/screen_module.rb +25 -1
- data/lib/ProMotion/screen/screen_navigation.rb +3 -3
- data/lib/ProMotion/table/cell/table_view_cell_module.rb +19 -3
- data/lib/ProMotion/table/grouped_table_screen.rb +5 -0
- data/lib/ProMotion/table/table.rb +5 -0
- data/lib/ProMotion/table/table_screen.rb +4 -0
- data/lib/ProMotion/version.rb +1 -1
- data/lib/ProMotion/view/styling.rb +22 -9
- data/lib/ProMotion/web/web_screen.rb +4 -0
- data/lib/ProMotion/web/web_screen_module.rb +1 -1
- data/spec/functional/func_image_title_screen.rb +20 -0
- data/spec/functional/func_image_view_title_screen.rb +20 -0
- data/spec/functional/func_screen_spec.rb +4 -0
- data/spec/functional/func_split_screen_spec.rb +7 -0
- data/spec/functional/func_view_title_screen.rb +21 -0
- data/spec/functional/func_web_screen_spec.rb +3 -3
- data/spec/helpers/image_title_screen.rb +15 -0
- data/spec/helpers/image_view_title_screen.rb +15 -0
- data/spec/helpers/map_screen.rb +4 -2
- data/spec/helpers/view_title_screen.rb +15 -0
- data/spec/helpers/web_screen.rb +7 -6
- data/spec/unit/map_spec.rb +10 -9
- data/spec/unit/screen_helpers_spec.rb +11 -7
- data/spec/unit/tables/table_module_spec.rb +1 -1
- data/spec/unit/view_helper_spec.rb +23 -6
- data/spec/unit/web_spec.rb +5 -5
- metadata +56 -47
- data/lib/ProMotion/thirdparty/formotion_screen.rb +0 -92
- data/spec/helpers/table_screen_formotion.rb +0 -50
- data/spec/unit/tables/formotion_screen_spec.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d80aa6f8f7ae03f3f2be1c808fa782037024aa91
|
4
|
+
data.tar.gz: 773f16d3e3c22101d89685f69ec374626e6d078f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e3a843a9b12a979de97ee5f089830945b2f08f7db2943cadbc8cf88349c73e92b30fcf7de006af0b32c64fc1de00316d5db4798de2c87ffc82e38cf6149083a
|
7
|
+
data.tar.gz: 0ce42b3ff248b019b1e63badad6c0f700da9a930a0f494b1f7e2775953fe2d62a44f97688fc4ae461a376ed7e62d3cc4ea926a0c01ff3edc85bd35c7c528596c
|
data/CONTRIBUTING.md
CHANGED
@@ -14,7 +14,7 @@ Over 20 developers have contributed to ProMotion. We love it when ProMotion user
|
|
14
14
|
2. Create a feature branch
|
15
15
|
3. Code
|
16
16
|
4. Update or create new specs ** NOTE: your PR is far more likely to be merged if you include comprehensive tests! **
|
17
|
-
5. Make sure tests are passing by running `rake spec` *(you can run functional and unit specs separately with `rake spec:
|
17
|
+
5. Make sure tests are passing by running `rake spec` *(you can run functional and unit specs separately with `rake spec:func` and `rake spec:unit`, and a single spec with `rake spec:single f=test_file_name`)*
|
18
18
|
6. Submit pull request to `edge` (for new features) or `master` (for bugfixes)
|
19
19
|
7. Make a million little nitpicky changes that @jamonholmgren wants
|
20
20
|
8. Merged, then fame, adoration, kudos everywhere
|
data/Gemfile
CHANGED
data/ProMotion.gemspec
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
require File.expand_path('../lib/ProMotion/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Jamon Holmgren", "Silas Matson", "
|
6
|
-
gem.email = ["jamon@clearsightstudio.com", "silas@clearsightstudio.com", "
|
7
|
-
gem.
|
8
|
-
gem.
|
9
|
-
ProMotion is a
|
10
|
-
|
11
|
-
a
|
12
|
-
|
5
|
+
gem.authors = ["Jamon Holmgren", "Silas Matson", "Mark Rickert"]
|
6
|
+
gem.email = ["jamon@clearsightstudio.com", "silas@clearsightstudio.com", "mark@mohawkapps.com"]
|
7
|
+
gem.summary = "ProMotion makes it easy to build RubyMotion iOS screen-based apps."
|
8
|
+
gem.description = "
|
9
|
+
ProMotion is a RubyMotion gem that makes iOS development more like Ruby and less like Objective-C.
|
10
|
+
It introduces a clean, Ruby-style syntax for building screens that is easy to learn and remember and
|
11
|
+
abstracts a ton of boilerplate UIViewController, UINavigationController, and other iOS code into a
|
12
|
+
simple, Ruby-like DSL.
|
13
13
|
"
|
14
14
|
gem.homepage = "https://github.com/clearsightstudio/ProMotion"
|
15
15
|
gem.license = 'MIT'
|
@@ -21,10 +21,10 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.require_paths = ["lib"]
|
22
22
|
gem.version = ProMotion::VERSION
|
23
23
|
|
24
|
-
gem.
|
25
|
-
gem.
|
26
|
-
gem.add_development_dependency("
|
27
|
-
gem.add_development_dependency("motion-
|
28
|
-
gem.add_development_dependency("
|
29
|
-
gem.
|
24
|
+
gem.add_dependency "motion-require", "~> 0.2"
|
25
|
+
gem.add_runtime_dependency("methadone", "~> 1.3")
|
26
|
+
gem.add_development_dependency("webstub", "~> 1.0")
|
27
|
+
gem.add_development_dependency("motion-stump", "~> 0.3")
|
28
|
+
gem.add_development_dependency("motion-redgreen", "~> 0.1")
|
29
|
+
gem.add_development_dependency("rake", "~> 10.1")
|
30
30
|
end
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ProMotion [![Build Status](https://travis-ci.org/clearsightstudio/ProMotion.png)](https://travis-ci.org/clearsightstudio/ProMotion) [![Code Climate](https://codeclimate.com/github/clearsightstudio/ProMotion.png)](https://codeclimate.com/github/clearsightstudio/ProMotion)
|
1
|
+
# ProMotion [![Gem Version](https://badge.fury.io/rb/ProMotion.png)](http://badge.fury.io/rb/ProMotion) [![Build Status](https://travis-ci.org/clearsightstudio/ProMotion.png)](https://travis-ci.org/clearsightstudio/ProMotion) [![Code Climate](https://codeclimate.com/github/clearsightstudio/ProMotion.png)](https://codeclimate.com/github/clearsightstudio/ProMotion) [![Dependency Status](https://gemnasium.com/clearsightstudio/ProMotion.png)](https://gemnasium.com/clearsightstudio/ProMotion)
|
2
2
|
|
3
3
|
## iPhone Apps, Ruby-style
|
4
4
|
|
@@ -23,10 +23,10 @@ class RootScreen < PM::Screen
|
|
23
23
|
title "Root Screen"
|
24
24
|
|
25
25
|
def on_load
|
26
|
-
set_nav_bar_button :right, title: "Help", action: :
|
26
|
+
set_nav_bar_button :right, title: "Help", action: :open_help_screen
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
29
|
+
def open_help_screen
|
30
30
|
open HelpScreen
|
31
31
|
end
|
32
32
|
end
|
@@ -44,6 +44,14 @@ class HelpScreen < PM::TableScreen
|
|
44
44
|
]
|
45
45
|
}]
|
46
46
|
end
|
47
|
+
|
48
|
+
def tapped_about(args={})
|
49
|
+
open AboutScreen
|
50
|
+
end
|
51
|
+
|
52
|
+
def log_out
|
53
|
+
# Log out!
|
54
|
+
end
|
47
55
|
end
|
48
56
|
```
|
49
57
|
|
@@ -67,48 +75,19 @@ end
|
|
67
75
|
# Getting Started
|
68
76
|
|
69
77
|
1. Check out the [Getting Started Guide](https://github.com/clearsightstudio/ProMotion/wiki/Guide:-Getting-Started) in the wiki
|
70
|
-
2.
|
78
|
+
2. Watch the excellent [MotionInMotion screencast about ProMotion](https://motioninmotion.tv/screencasts/8) (very reasonably priced subscription required)
|
79
|
+
3. Follow a tutorial: [Building an ESPN app using RubyMotion, ProMotion, and TDD](http://jamonholmgren.com/building-an-espn-app-using-rubymotion-promotion-and-tdd)
|
71
80
|
|
72
81
|
# What's New?
|
73
82
|
|
74
|
-
## Version 1.
|
75
|
-
|
76
|
-
* Added a [ProMotion executable](https://github.com/clearsightstudio/ProMotion/wiki/Command-Line-Tool) called `promotion`. You can type `promotion new <myapp>` and it will create a ProMotion-specific app. We will be adding more functionality in the future.
|
77
|
-
* Can now pass a symbol to `add`, `add_to`, and `set_attributes` to call a method with that name to get styles.
|
78
|
-
* Added `button_title:` to `open_split_screen` to [customize the auto-generated button title](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::SplitScreen#open_split_screenmaster-detail-args--)
|
79
|
-
* Updates to [set_tab_bar_button](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::Tabs#set_tab_bar_itemargs)
|
80
|
-
* Added to PM::Delegate [`on_open_url(args = {})`](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::Delegate#on_open_urlargs--) where `args` contains `:url`, `:source_app`, and `:annotation`
|
81
|
-
* Added to PM::Delegate [`tint_color`](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::Delegate#tint_color) to customize the application-wide tint color
|
82
|
-
* Added to [PM::MapScreen annotations](https://github.com/clearsightstudio/ProMotion/wiki/API-Reference:-ProMotion::MapScreen) the ability to set an image
|
83
|
-
* Removed legacy `navigation_controller` references which were causing confusion.
|
84
|
-
* Allowed setting a `custom_view` for `bar_button_item`s.
|
85
|
-
* Added `will_begin_search` and `will_end_search` callbacks to PM::TableScreen.
|
86
|
-
* Added `title_view` and `title_view_height` to sections in PM::TableScreen.
|
87
|
-
* Updated screenshots for iOS 7
|
88
|
-
* Refactored code and lots of new passing tests
|
89
|
-
|
90
|
-
# Tutorials
|
91
|
-
|
92
|
-
Shows how to make a basic app in ProMotion. Updated in May.
|
93
|
-
|
94
|
-
[http://www.clearsightstudio.com/insights/ruby-motion-promotion-tutorial](http://www.clearsightstudio.com/insights/ruby-motion-promotion-tutorial)
|
95
|
-
|
96
|
-
## Screencasts
|
83
|
+
## Version 1.2.x
|
97
84
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
Here's a demo app that is used to test new functionality. You might have to change the Gemfile
|
105
|
-
source to pull from Github.
|
106
|
-
|
107
|
-
[https://github.com/jamonholmgren/promotion-demo](https://github.com/jamonholmgren/promotion-demo)
|
108
|
-
|
109
|
-
Here's a demo app showing some styling options.
|
110
|
-
|
111
|
-
[https://github.com/jamonholmgren/promotion-styling](https://github.com/jamonholmgren/promotion-styling)
|
85
|
+
1. Now uses [motion-require](https://github.com/clayallsopp/motion-require) for better compatibility with other libraries [6046dd7f4](https://github.com/clearsightstudio/ProMotion/commit/6046dd7f49ba174f309baaa428eaac80ce0290b6)
|
86
|
+
2. SplitScreen: New option `swipe:` allows you to specify if a splitscreen master screen can be opened with a swipe. [ffbb76caf](https://github.com/clearsightstudio/ProMotion/commit/ffbb76caf3071297347d4cf43784069999a746b3)
|
87
|
+
3. FormotionScreen: Removed `PM::FormotionScreen` and the Formotion testing dependency. Use [ProMotion-formotion](https://github.com/rheoli/ProMotion-formotion) instead.
|
88
|
+
4. Styling: Added a `content_width` helper to PM::Styling (similar to `content_height`) [08a984815](https://github.com/clearsightstudio/ProMotion/commit/08a984815a7c96b9465c31b2e2664ac0086d2e1c)
|
89
|
+
5. TableScreen: Removed SDWebImage in favor of similar but more reliable JDImageCache [59ed747e9](https://github.com/clearsightstudio/ProMotion/commit/59ed747e93567e32bdb5099fed12297161cea05a)
|
90
|
+
6. Screen: Allow custom views (including images) for `title` setting [#415](https://github.com/clearsightstudio/ProMotion/pull/415)
|
112
91
|
|
113
92
|
# API Reference
|
114
93
|
|
@@ -118,13 +97,16 @@ We've created a comprehensive and always updated wiki with code examples, usage
|
|
118
97
|
|
119
98
|
# Help
|
120
99
|
|
100
|
+
ProMotion is not only an easy DSL to get started. The community is very helpful and
|
101
|
+
welcoming to new RubyMotion developers. We don't mind newbie questions.
|
102
|
+
|
121
103
|
If you need help, feel free to tweet [@jamonholmgren](http://twitter.com/jamonholmgren)
|
122
|
-
or open an issue on GitHub. Opening an issue is usually the best and we respond to those
|
123
|
-
If we don't respond within a day, tweet Jamon or Mark a link to the issue.
|
104
|
+
or open an issue on GitHub. Opening an issue is usually the best and we respond to those
|
105
|
+
pretty quickly. If we don't respond within a day, tweet Jamon or Mark a link to the issue.
|
124
106
|
|
125
107
|
# Contributing
|
126
108
|
|
127
|
-
See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/
|
109
|
+
See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/blob/master/CONTRIBUTING.md).
|
128
110
|
|
129
111
|
## Primary Contributors
|
130
112
|
|
@@ -133,5 +115,3 @@ See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/edit/master/
|
|
133
115
|
* Matt Brewer: [@macfanatic](https://twitter.com/macfanatic)
|
134
116
|
* Mark Rickert: [@markrickert](https://twitter.com/markrickert)
|
135
117
|
* [Many others](https://github.com/clearsightstudio/ProMotion/graphs/contributors)
|
136
|
-
* Run `git shortlog -s -n -e` to see everyone who has contributed.
|
137
|
-
|
data/Rakefile
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
$:.unshift("/Library/RubyMotion/lib")
|
2
2
|
require 'motion/project/template/ios'
|
3
3
|
require 'bundler'
|
4
|
-
|
5
|
-
# this follow from gemspec
|
6
4
|
Bundler.require(:development)
|
7
|
-
|
8
|
-
# this follow development code
|
9
5
|
require 'ProMotion'
|
10
6
|
|
11
7
|
Motion::Project::App.setup do |app|
|
@@ -17,8 +13,6 @@ Motion::Project::App.setup do |app|
|
|
17
13
|
# Devices
|
18
14
|
app.deployment_target = "6.0"
|
19
15
|
app.device_family = [:ipad] # so we can test split screen capability
|
20
|
-
|
21
|
-
app.detect_dependencies = true
|
22
16
|
end
|
23
17
|
|
24
18
|
def all_files
|
@@ -26,11 +20,11 @@ def all_files
|
|
26
20
|
end
|
27
21
|
|
28
22
|
def functional_files
|
29
|
-
Dir.glob('./spec/functional
|
23
|
+
Dir.glob('./spec/functional/**/*.rb')
|
30
24
|
end
|
31
25
|
|
32
26
|
def unit_files
|
33
|
-
Dir.glob('./spec/unit
|
27
|
+
Dir.glob('./spec/unit/**/*.rb')
|
34
28
|
end
|
35
29
|
|
36
30
|
namespace :spec do
|
@@ -54,6 +48,17 @@ namespace :spec do
|
|
54
48
|
Rake::Task["simulator"].invoke
|
55
49
|
end
|
56
50
|
|
51
|
+
task :single do
|
52
|
+
App.config.spec_mode = true
|
53
|
+
spec_files = App.config.spec_files
|
54
|
+
spec_files -= unit_files
|
55
|
+
spec_files -= functional_files
|
56
|
+
spec_files += Dir.glob("./spec/unit/**/#{ENV['f'] || ENV['file']}.rb")
|
57
|
+
spec_files += Dir.glob("./spec/functional/**/#{ENV['f'] || ENV['file']}.rb")
|
58
|
+
App.config.instance_variable_set("@spec_files", spec_files)
|
59
|
+
Rake::Task["simulator"].invoke
|
60
|
+
end
|
61
|
+
|
57
62
|
end
|
58
63
|
|
59
64
|
task :sim_close do
|
data/lib/ProMotion.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
|
2
|
-
raise "This file must be required within a RubyMotion project Rakefile."
|
3
|
-
end
|
1
|
+
require 'motion-require'
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
Motion::Project::App.setup do |app|
|
8
|
-
app.detect_dependencies = true
|
9
|
-
original_files = app.files
|
10
|
-
delegate = File.join(File.dirname(__FILE__), 'ProMotion/delegate/delegate.rb')
|
11
|
-
promotion_files = FileList[File.join(File.dirname(__FILE__), 'ProMotion/**/*.rb')].exclude(delegate).to_a
|
12
|
-
app.files = (promotion_files << delegate) + original_files
|
13
|
-
end
|
3
|
+
Motion::Require.all(Dir.glob(File.expand_path('../ProMotion/**/*.rb', __FILE__)))
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module ProMotion
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
class NavigationController < UINavigationController
|
3
|
+
def shouldAutorotate
|
4
|
+
visibleViewController.shouldAutorotate
|
5
|
+
end
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
def supportedInterfaceOrientations
|
8
|
+
visibleViewController.supportedInterfaceOrientations
|
9
|
+
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
def preferredInterfaceOrientationForPresentation
|
12
|
+
visibleViewController.preferredInterfaceOrientationForPresentation
|
13
|
+
end
|
14
|
+
end
|
15
15
|
end
|
@@ -4,16 +4,16 @@ module ProMotion
|
|
4
4
|
s = self.viewControllers.first
|
5
5
|
s.respond_to?(:visibleViewController) ? s.visibleViewController : s
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def detail_screen
|
9
9
|
s = self.viewControllers.last
|
10
10
|
s.respond_to?(:visibleViewController) ? s.visibleViewController : s
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def master_screen=(s)
|
14
14
|
self.viewControllers = [ (s.navigationController || s), self.viewControllers.last]
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def detail_screen=(s)
|
18
18
|
# set the button from the old detail screen to the new one
|
19
19
|
button = detail_screen.navigationItem.leftBarButtonItem
|
@@ -21,7 +21,7 @@ module ProMotion
|
|
21
21
|
|
22
22
|
self.viewControllers = [self.viewControllers.first, (s.navigationController || s)]
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def screens=(s_array)
|
26
26
|
self.viewControllers = s_array
|
27
27
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ProMotion
|
2
2
|
class TabBarController < UITabBarController
|
3
|
-
|
3
|
+
|
4
4
|
def self.new(*screens)
|
5
5
|
tab_bar_controller = alloc.init
|
6
6
|
|
@@ -19,14 +19,14 @@ module ProMotion
|
|
19
19
|
tab_bar_controller.viewControllers = view_controllers
|
20
20
|
tab_bar_controller
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def open_tab(tab)
|
24
24
|
if tab.is_a? String
|
25
25
|
selected_tab_vc = find_tab(tab)
|
26
26
|
elsif tab.is_a? Numeric
|
27
27
|
selected_tab_vc = viewControllers[tab]
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
if selected_tab_vc
|
31
31
|
self.selectedViewController = selected_tab_vc if selected_tab_vc
|
32
32
|
else
|
@@ -34,10 +34,10 @@ module ProMotion
|
|
34
34
|
nil
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def find_tab(tab_title)
|
39
39
|
self.viewControllers.select{ |vc| vc.tabBarItem.title == tab_title }.first
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
end
|
43
43
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
motion_require '../extensions/conversions'
|
2
|
+
|
1
3
|
module ProMotion
|
2
4
|
module Tabs
|
3
5
|
include Conversions
|
4
|
-
|
6
|
+
|
5
7
|
attr_accessor :tab_bar, :tab_bar_item
|
6
|
-
|
8
|
+
|
7
9
|
def open_tab_bar(*screens)
|
8
10
|
self.tab_bar = PM::TabBarController.new(screens)
|
9
11
|
|
@@ -43,7 +45,7 @@ module ProMotion
|
|
43
45
|
icon_unselected = icon_image[:unselected]
|
44
46
|
icon_image = nil
|
45
47
|
end
|
46
|
-
|
48
|
+
|
47
49
|
item = UITabBarItem.alloc.initWithTitle(title, image:icon_image, tag:tag)
|
48
50
|
|
49
51
|
if icon_selected || icon_unselected
|
@@ -66,13 +68,13 @@ module ProMotion
|
|
66
68
|
|
67
69
|
return tab_bar_item
|
68
70
|
end
|
69
|
-
|
71
|
+
|
70
72
|
def replace_current_item(tab_bar_controller, view_controller: vc)
|
71
73
|
controllers = NSMutableArray.arrayWithArray(tab_bar_controller.viewControllers)
|
72
74
|
controllers.replaceObjectAtIndex(tab_bar_controller.selectedIndex, withObject: vc)
|
73
75
|
tab_bar_controller.viewControllers = controllers
|
74
76
|
end
|
75
|
-
|
77
|
+
|
76
78
|
def map_tab_symbol(symbol)
|
77
79
|
@_tab_symbols ||= {
|
78
80
|
more: UITabBarSystemItemMore,
|
@@ -90,7 +92,7 @@ module ProMotion
|
|
90
92
|
}
|
91
93
|
@_tab_symbols[symbol] || symbol
|
92
94
|
end
|
93
|
-
|
95
|
+
|
94
96
|
module TabClassMethods
|
95
97
|
def tab_bar_item(args={})
|
96
98
|
@tab_bar_item = args
|
@@ -99,10 +101,10 @@ module ProMotion
|
|
99
101
|
@tab_bar_item
|
100
102
|
end
|
101
103
|
end
|
102
|
-
|
104
|
+
|
103
105
|
def self.included(base)
|
104
106
|
base.extend(TabClassMethods)
|
105
107
|
end
|
106
|
-
|
108
|
+
|
107
109
|
end
|
108
110
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
+
motion_require '../containers/tabs'
|
2
|
+
motion_require '../containers/split_screen'
|
3
|
+
motion_require 'delegate_notifications'
|
4
|
+
|
1
5
|
module ProMotion
|
2
6
|
module DelegateModule
|
3
7
|
include ProMotion::Tabs
|
@@ -8,6 +12,7 @@ module ProMotion
|
|
8
12
|
|
9
13
|
def application(application, willFinishLaunchingWithOptions:launch_options)
|
10
14
|
will_load(application, launch_options) if respond_to?(:will_load)
|
15
|
+
true
|
11
16
|
end
|
12
17
|
|
13
18
|
def application(application, didFinishLaunchingWithOptions:launch_options)
|