Skip to content

No Respring Theme Switch

CoolStar edited this page Mar 3, 2017 · 3 revisions

No-Respring Theme Switch

Note: Currently running apps may need to be closed and reopened for theme changes to take effect within them.

Anemone will soon support switching themes without a respring. Anemone extensions and 3rd party tweaks may request Anemone to notify them when the theme is changing so they may reload images or other settings from the themes as needed.

Currently supported assets for no-respring theme switch:

  1. Home Screen Icons
  2. Icon Masks
  3. Docks
  4. Folder Icons
  5. Folder Backgrounds
  6. Preference Icons
  7. In-App Resources, blurs, colors and tints.

Switching themes from your tweak without a respring

  1. Call /usr/bin/recache --no-respring to clear Optitheme caches
  2. In SpringBoard, call [[ANEMSettingsManager sharedManager] forceReloadNow];

Event Handler

Objective C protocol

Create a subclass of NSObject that implements the following protocol.

@protocol AnemoneEventHandler
-(void)reloadTheme;
@end

Registering your protocol

To register your protocol, simply call addEventHandler: on ANEMSettingsManager (header available in https://github.com/AnemoneTeam/Anemone/wiki/Extensibility).

Note: ANEMSettingsManager must exist for this call to work. It is recommended to dlopen AnemoneCore.dylib before you call addEventHandler: to make sure Anemone is present.