ProMotion 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ProMotion (0.6.0)
4
+ ProMotion (0.6.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -260,6 +260,12 @@ If you pass `:system` for the title, then you can get a system item. E.g.:
260
260
  set_nav_bar_right_button nil, action: :add_something, system_icon: UIBarButtonSystemItemAdd
261
261
  ```
262
262
 
263
+ Additionally, if you pass an instance of a `UIBarButtonItem`, the `UIBarButton` will automatically display that particular button item.
264
+
265
+ ```ruby
266
+ set_nav_bar_left_button self.editButtonItem
267
+ ```
268
+
263
269
  ## Opening and closing screens
264
270
 
265
271
  If the user taps something and you want to open a new screen, it's easy. Just use `open` and pass in the screen class
@@ -19,7 +19,11 @@ module ProMotion
19
19
 
20
20
  [ master, detail ].map { |s| s.on_load if s.respond_to?(:on_load) }
21
21
 
22
- split_screen_controller master, detail
22
+ split = split_screen_controller master, detail
23
+ if args.has_key?(:icon) or args.has_key?(:title)
24
+ split.tabBarItem = create_tab_bar_item(args)
25
+ end
26
+ split
23
27
  end
24
28
 
25
29
  def open_split_screen(master, detail, args={})
@@ -39,4 +43,4 @@ module ProMotion
39
43
  svc.detail_screen.navigationItem.leftBarButtonItem = nil
40
44
  end
41
45
  end
42
- end
46
+ end
@@ -88,6 +88,8 @@ module ProMotion
88
88
  UIBarButtonItem.alloc.initWithImage(args[:title], style: args[:style], target: args[:target], action: args[:action])
89
89
  when Symbol, NilClass
90
90
  UIBarButtonItem.alloc.initWithBarButtonSystemItem(args[:system_icon], target: args[:target], action: args[:action]) if args[:system_icon]
91
+ when UIBarButtonItem
92
+ args[:title]
91
93
  else
92
94
  PM.logger.error("Please supply a title string, a UIImage or :system.")
93
95
  end
@@ -1,3 +1,3 @@
1
1
  module ProMotion
2
- VERSION = "0.6.1" unless defined?(ProMotion::VERSION)
2
+ VERSION = "0.6.2" unless defined?(ProMotion::VERSION)
3
3
  end
data/resources/list.png CHANGED
File without changes
@@ -68,6 +68,15 @@ describe "screen helpers" do
68
68
  @screen.navigationItem.leftBarButtonItem.image.should == image
69
69
  end
70
70
 
71
+ it "should add a left UIBarButtonItem" do
72
+ @screen.set_nav_bar_left_button @screen.editButtonItem
73
+ @screen.navigationItem.leftBarButtonItem.class.should == UIBarButtonItem
74
+ end
75
+
76
+ it "should add a right UIBarButtonItem" do
77
+ @screen.set_nav_bar_right_button @screen.editButtonItem
78
+ @screen.navigationItem.rightBarButtonItem.class.should == UIBarButtonItem
79
+ end
71
80
  end
72
81
 
73
82
  describe "screen navigation" do
@@ -6,7 +6,7 @@ describe "split screen in tab bar functionality" do
6
6
  @master_screen = HomeScreen.new nav_bar: true
7
7
  @detail_screen = BasicScreen.new nav_bar: true
8
8
 
9
- @split_screen = @app.create_split_screen @master_screen, @detail_screen
9
+ @split_screen = @app.create_split_screen @master_screen, @detail_screen, icon: "list", title: "Spec"
10
10
  @tab = @app.open_tab_bar @split_screen, HomeScreen, BasicScreen
11
11
  end
12
12
 
@@ -49,5 +49,18 @@ describe "split screen in tab bar functionality" do
49
49
  it "should set the tab bar first viewController to the split screen" do
50
50
  @tab.viewControllers.first.should == @split_screen
51
51
  end
52
+
53
+ it "should set the bar bar item for the split screen" do
54
+ @split_screen.tabBarItem.is_a?(UITabBarItem).should == true
55
+ end
56
+
57
+ it "should set the tab bar icon of the split screen" do
58
+ @split_screen.tabBarItem.image.is_a?(UIImage).should == true
59
+ end
60
+
61
+ it "should set the tab bar title of the split screen" do
62
+ @split_screen.tabBarItem.title.is_a?(String).should == true
63
+ @split_screen.tabBarItem.title.should == "Spec"
64
+ end
52
65
 
53
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ProMotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-05-17 00:00:00.000000000 Z
14
+ date: 2013-05-19 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: ProMotion is a new way to easily build RubyMotion iOS apps.
17
17
  email: