Guest User

Untitled

a guest
Apr 17th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #import <Foundation/Foundation.h>
  2. #import "generated-headers/SwiftTweak-Swift.h"
  3.  
  4. @interface Cask (Cask)
  5. -(void)initPrefs;
  6. -(void)loadPrefs;
  7. @end
  8.  
  9. Cask * cas = nil;
  10.  
  11. void loadPrefs() {
  12. cas = [[objc_getClass("Cask") alloc] init];
  13. [cas loadPrefs];
  14. }
  15.  
  16. %ctor{
  17. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.ryannair05.caskprefs/prefsupdated"), NULL, CFNotificationSuspensionBehaviorCoalesce);
  18. cas = [[objc_getClass("Cask") alloc] init];
  19. [cas initPrefs];
  20. loadPrefs();
  21. [AutoHookImplementor swiftInit];
  22. }
Advertisement
Add Comment
Please, Sign In to add comment