Class: ProMotion::FormotionScreen

Inherits:
Formotion::FormController
  • Object
show all
Includes:
ScreenModule
Defined in:
lib/ProMotion/thirdparty/formotion_screen.rb

Instance Attribute Summary

Attributes included from ScreenModule

#first_screen, #modal, #parent_screen, #split_screen

Attributes included from Tabs

#tab_bar, #tab_bar_item

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ScreenModule

#add_nav_bar, #bar_button_item, #bounds, #create_toolbar_button, #first_screen?, #frame, included, #map_bar_button_item_style, #map_bar_button_system_item, #modal?, #nav_bar?, #navigationController=, #navigation_controller, #navigation_controller=, #on_appear, #on_create, #on_disappear, #on_dismiss, #on_present, #on_rotate, #set_nav_bar_button, #set_nav_bar_left_button, #set_nav_bar_right_button, #set_toolbar_items, #should_autorotate, #should_rotate, #supported_device_families, #supported_device_family?, #supported_orientation?, #supported_orientations, #view_did_appear, #view_did_disappear, #view_did_load, #view_will_appear, #view_will_disappear, #will_appear, #will_disappear, #will_dismiss, #will_present, #will_rotate

Methods included from SplitScreen

#create_split_screen, #open_split_screen, #splitViewController, #split_screen_controller

Methods included from Tabs

#create_tab_bar_icon, #create_tab_bar_icon_custom, #create_tab_bar_item, included, #map_tab_symbol, #open_tab, #open_tab_bar, #refresh_tab_bar_item, #replace_current_item, #set_tab_bar_badge, #set_tab_bar_item

Methods included from Conversions

#camel_case, #convert_symbol, #objective_c_method_name

Methods included from Styling

#add, #add_to, #closest_parent, #content_height, #hex_color, #remove, #rgb_color, #rgba_color, #set_attribute, #set_attributes, #set_easy_attributes, #view_or_self

Methods included from ScreenNavigation

#app_delegate, #close_screen, #open_modal, #open_root_screen, #open_screen, #push_view_controller, #send_on_return

Class Method Details

.new(args = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 6

def self.new(args = {})
  s = self.alloc.initWithStyle(UITableViewStyleGrouped)
  s.on_create(args) if s.respond_to?(:on_create)

  if s.respond_to?(:table_data)
    s.form = s.table_data
  elsif args[:form]
    s.form = args[:form]
  else
    PM.logger.error "PM::FormotionScreen requires a `table_data` method or form: to be passed into `new`."
  end

  t = s.title # Formotion kills the title when you request tableView.
  s.tableView.allowsSelectionDuringEditing = true
  s.title = t

  s.form.on_submit { |form| s.on_submit(form) if s.respond_to?(:on_submit) }

  s
end

Instance Method Details

#didRotateFromInterfaceOrientation(orientation) ⇒ Object



82
83
84
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 82

def didRotateFromInterfaceOrientation(orientation)
  self.on_rotate
end

#loadViewObject



38
39
40
41
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 38

def loadView
  super
  self.send(:on_load) if self.respond_to?(:on_load)
end

#screen_setupObject



34
35
36
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 34

def screen_setup
  self.title = self.class.send(:get_title)
end

#shouldAutorotateObject



74
75
76
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 74

def shouldAutorotate
  self.should_autorotate
end

#shouldAutorotateToInterfaceOrientation(orientation) ⇒ Object



70
71
72
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 70

def shouldAutorotateToInterfaceOrientation(orientation)
  self.should_rotate(orientation)
end

#update_table_dataObject

emulate the ProMotion table update for formotion



28
29
30
31
32
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 28

def update_table_data
  self.form            = table_data
  self.form.controller = self
  self.tableView.reloadData
end

#viewDidAppear(animated) ⇒ Object



53
54
55
56
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 53

def viewDidAppear(animated)
  super
  self.view_did_appear(animated) if self.respond_to?("view_did_appear:")
end

#viewDidDisappear(animated) ⇒ Object



63
64
65
66
67
68
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 63

def viewDidDisappear(animated)
  if self.respond_to?("view_did_disappear:")
    self.view_did_disappear(animated)
  end
  super
end

#viewDidLoadObject



43
44
45
46
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 43

def viewDidLoad
  super
  self.view_did_load if self.respond_to?(:view_did_load)
end

#viewWillAppear(animated) ⇒ Object



48
49
50
51
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 48

def viewWillAppear(animated)
  super
  self.view_will_appear(animated) if self.respond_to?("view_will_appear:")
end

#viewWillDisappear(animated) ⇒ Object



58
59
60
61
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 58

def viewWillDisappear(animated)
  self.view_will_disappear(animated) if self.respond_to?("view_will_disappear:")
  super
end

#willRotateToInterfaceOrientation(orientation, duration: duration) ⇒ Object



78
79
80
# File 'lib/ProMotion/thirdparty/formotion_screen.rb', line 78

def willRotateToInterfaceOrientation(orientation, duration:duration)
  self.will_rotate(orientation, duration)
end