Sha256: 9df0dceea6f0277cee4fcf7b899b09901cbc28b83bac9a9dd5dd88a0f14d1309

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

motion_require '../support/mp_view_controller.rb'
motion_require '../views/layout.rb'
motion_require '../screens/_base_mixin.rb'
motion_require './extensions/_indicators_mixin'
motion_require './extensions/_navigation_bar_mixin'
motion_require '../helpers/has_authorization'
motion_require '../helpers/has_search_bar'
module MotionPrime
  class BaseScreen < MPViewController
    include Layout
    include ScreenBaseMixin

    # extensions
    include ScreenIndicatorsMixin
    include ScreenNavigationBarMixin

    # helpers
    include HasAuthorization
    include HasSearchBar

    def render
    end

    def default_styles
      [:base_screen, self.class_name_without_kvo.underscore.to_sym]
    end

    def will_appear
      unless @on_appear_happened
        setup view, styles: default_styles do
          render
        end
      end
      @on_appear_happened = true
    end

    # def dealloc
    #   pp 'Deallocating Screen'
    #   super
    # end

    def visible?
      self.isViewLoaded && view.window
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
motion-prime-0.4.5 motion-prime/screens/base_screen.rb