Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Update swizzling trigger #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update swizzling trigger #112

wants to merge 2 commits into from

Conversation

congsun
Copy link

@congsun congsun commented Mar 16, 2021

Issue
If Visualizer.sharedInstance is not invoked before app is active, calling start function won't work. This is because the swizzling relies on the appBecomeActive notification, and the notification registration is upon initialization of Visualizer.

Fix

  • Put the swizzling function in the initialization process of Visualizer.sharedInstance. This guarantees whenever the start is called, we'll always get the function swizzled.
  • Remove the unnecessary bool check: As the singleton is guaranteed to be executed once in the application lifecycle, we won't need to worry about the function gets swizzled back.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant