Files
rmq/templates/controller/app/controllers/name_controller.rb
Todd Werth fc15ff2ef2 Added generators/templates to rmq command-line tool, such as:
rmq create controller foo
rmq create view foo_bar
2013-10-08 08:51:00 -07:00

38 lines
969 B
Ruby

class <%= @name_camel_case %>Controller < UIViewController
def viewDidLoad
super
rmq.stylesheet = <%= @name_camel_case %>ControllerStylesheet
rmq(self.view).apply_style :root_view
# Create your views here
end
# Remove if you are only supporting portrait
def supportedInterfaceOrientations
UIInterfaceOrientationMaskAll
end
# Remove if you are only supporting portrait
def willAnimateRotationToInterfaceOrientation(orientation, duration: duration)
rmq.all.reapply_styles
end
end
__END__
# You don't have to reapply styles to all UIViews, if you want to optimize,
# another way to do it is tag the views you need to restyle in your stylesheet,
# then only reapply the tagged views, like so:
def logo(st)
st.frame = {t: 10, w: 200, h: 96}
st.centered = :horizontal
st.image = image.resource('logo')
st.tag(:reapply_style)
end
# Then in willAnimateRotationToInterfaceOrientation
rmq(:reapply_style).reapply_styles