diff --git a/lib/ProMotion/screen_helpers/split_screen.rb b/lib/ProMotion/screen_helpers/split_screen.rb index 44b67a3..bb19df0 100644 --- a/lib/ProMotion/screen_helpers/split_screen.rb +++ b/lib/ProMotion/screen_helpers/split_screen.rb @@ -19,7 +19,11 @@ module ProMotion [ master, detail ].map { |s| s.on_load if s.respond_to?(:on_load) } - split_screen_controller master, detail + split = split_screen_controller master, detail + if args.has_key?(:icon) or args.has_key?(:title) + split.tabBarItem = create_tab_bar_item(args) + end + split end def open_split_screen(master, detail, args={}) @@ -39,4 +43,4 @@ module ProMotion svc.detail_screen.navigationItem.leftBarButtonItem = nil end end -end \ No newline at end of file +end diff --git a/resources/list.png b/resources/list.png old mode 100755 new mode 100644 diff --git a/spec/split_screen_in_tab_bar_spec.rb b/spec/split_screen_in_tab_bar_spec.rb index c21515d..03718e2 100644 --- a/spec/split_screen_in_tab_bar_spec.rb +++ b/spec/split_screen_in_tab_bar_spec.rb @@ -6,7 +6,7 @@ describe "split screen in tab bar functionality" do @master_screen = HomeScreen.new nav_bar: true @detail_screen = BasicScreen.new nav_bar: true - @split_screen = @app.create_split_screen @master_screen, @detail_screen + @split_screen = @app.create_split_screen @master_screen, @detail_screen, icon: "list", title: "Spec" @tab = @app.open_tab_bar @split_screen, HomeScreen, BasicScreen end @@ -49,5 +49,18 @@ describe "split screen in tab bar functionality" do it "should set the tab bar first viewController to the split screen" do @tab.viewControllers.first.should == @split_screen end + + it "should set the bar bar item for the split screen" do + @split_screen.tabBarItem.is_a?(UITabBarItem).should == true + end + + it "should set the tab bar icon of the split screen" do + @split_screen.tabBarItem.image.is_a?(UIImage).should == true + end + + it "should set the tab bar title of the split screen" do + @split_screen.tabBarItem.title.is_a?(String).should == true + @split_screen.tabBarItem.title.should == "Spec" + end end