forked from und3fined/StoreSwitcher2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tweak.mm
38 lines (30 loc) · 970 Bytes
/
Tweak.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#import <UIKit/UIKit.h>
#import "SSViewController.h"
@interface AppStoreAccountViewController: UIViewController
@end
%hook AppStoreAccountViewController
- (id)init {
return %orig;
}
- (void)viewDidLoad {
%orig;
UIBarButtonItem *switcherButton =
[[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"/var/jb/Library/Application Support/StoreSwitcher/switcher"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(openSwitcher:)
];
[self navigationItem].leftBarButtonItems = @[[self navigationItem].leftBarButtonItem, switcherButton];
}
%new
- (void)openSwitcher:(UIButton *)button {
SSViewController *viewController = [[SSViewController alloc] init];
[viewController setModalPresentationStyle:UIModalPresentationPageSheet];
[self presentViewController:viewController animated:YES completion:nil];
}
%end
%ctor {
%init(AppStoreAccountViewController = objc_getClass("AppStore.AccountViewController")
);
}