Open sfsekaran opened 8 years ago
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.
CollectionScreen
on_load
viewDidLoad
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
view_did_load
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
ProMotion::Collection#viewDidLoad
self.view_did_load
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
ScreenModuleViewController#viewDidLoad
Please fix! :) Meanwhile, I will override viewDidLoad in my subclass of PM::CollectionScreen, and place the following code there:
PM::CollectionScreen
def viewDidLoad super self.view_did_load if self.respond_to?(:view_did_load) end
Best regards, Sathya Sekaran
Hi @sfsekaran, thanks for reporting this. This should be a simple fix and we'd welcome a pull request with accompanying tests.
To whom it may concern,
In the documentation, the
CollectionScreen
should call theon_load
method onceviewDidLoad
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
, callson_load
, and is common to all screens: https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/lib/ProMotion/screen/screen_module.rb#L38In
ProMotion::Collection#viewDidLoad
, which is an include ofCollectionScreen
, you'll notice thatself.view_did_load
is never called: https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/lib/ProMotion/collection/collection.rb#L19Whereas in
ScreenModuleViewController#viewDidLoad
, it is called (as it should be): https://github.com/infinitered/ProMotion/blob/a40c03ca89e21c21ef4c2fc35d5d3b85ea4c77de/app/screens/screen_module_view_controller.rb#L13Please fix! :) Meanwhile, I will override
viewDidLoad
in my subclass ofPM::CollectionScreen
, and place the following code there:Best regards, Sathya Sekaran