Skip to content

Conversation

krystiansliwa
Copy link
Contributor

@krystiansliwa krystiansliwa commented Jul 1, 2020

Summary

After reviewing iOS code I realized that it can be simplified and optimized a bit.

This PR changes a way of handling controllers in native code.
Previously each view had associated controller that was stored in the memory and each time updated with view if needed. Now controller is created or reused on demand for a particular view.
Also current implementation uses the same method of creating/reusing controller for gesture-based and goTo navigation inside swiper which simplify code.

Some of the previous issues like ViewControllerHierarchyInconsistency should be resolved now.

For storing controllers I decide to use NSHashTable with "weak option" so we are sure that controllers are not retained.

To improve readability I extracted Events classes to corresponding files and moved some methods/properties declarations from .h to .m files.

Test Plan

Just check if it works. There was no API changes, only implementation was changed.

Checklist

  • I have tested this on a device and a simulator

@troZee troZee changed the base branch from master to next July 5, 2020 18:59
@troZee
Copy link
Collaborator

troZee commented Jul 5, 2020

@krystiansliwa
Thank you for veeery big refactor. I really appreciate it. I left only one comment. Once merge conflict resolved, I will merge it.

Good job :D

@krystiansliwa krystiansliwa force-pushed the feature/improve-ios-code branch from b6ec5ae to c7f1a14 Compare July 8, 2020 11:53
@troZee troZee assigned troZee and unassigned krystiansliwa and troZee Jul 9, 2020
@troZee troZee changed the base branch from next to master July 9, 2020 13:11
@troZee troZee merged commit cc659b4 into callstack:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants