-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTweak.x
31 lines (24 loc) · 862 Bytes
/
Tweak.x
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
#import <UIKit/UIKit.h>
#import "BJBrainyQuotes.h"
@interface NCNotificationNoContentView : UIView
@end
%hook NCNotificationNoContentView
- (id)init {
if ((self = %orig)) {
UILabel *label = [self valueForKey:@"_noNotificationsLabel"];
label.text = @"Loading quote...";
label.lineBreakMode = NSLineBreakByWordWrapping;
label.numberOfLines = 0;
[BJBrainyQuotes parseQuotesAuthors:^(NSArray *authors, NSArray *quotes) {
NSUInteger qCount = quotes.count;
if (qCount == authors.count) {
u_int32_t hit = arc4random() % qCount;
dispatch_async(dispatch_get_main_queue(), ^{
label.text = [NSString stringWithFormat:@"%@\n- %@", quotes[hit], authors[hit]];
});
}
}];
}
return self;
}
%end