Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

CollectionScreen#on_load never gets called #775

@sfsekaran

Description

@sfsekaran

To whom it may concern,

In the documentation, the CollectionScreen should call the on_load method once viewDidLoad gets called. Via manual testing, I found this doesn't happen.

I also believe I found the issue in the code.

The following method, view_did_load, calls on_load, and is common to all screens:
https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/lib/ProMotion/screen/screen_module.rb#L38

In ProMotion::Collection#viewDidLoad, which is an include of CollectionScreen, you'll notice that self.view_did_load is never called:
https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/lib/ProMotion/collection/collection.rb#L19

Whereas in ScreenModuleViewController#viewDidLoad, it is called (as it should be):
https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/app/screens/screen_module_view_controller.rb#L13

Please fix! :) Meanwhile, I will override viewDidLoad in my subclass of PM::CollectionScreen, and place the following code there:

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

Best regards,
Sathya Sekaran

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions