Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit bf551df

Browse files
author
张国晔
committed
Restructure Files
1 parent 84eadc3 commit bf551df

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARCHS = armv7 armv7s arm64
2-
TARGET = iphone:clang:7.0:5.0
2+
TARGET = iphone:clang:7.1:5.0
33

44
include theos/makefiles/common.mk
55

Tweak.h

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@interface PSSpecifier
2+
@property(strong, nonatomic) NSString *identifier;
3+
@end
4+
5+
@interface PSListController
6+
- (PSSpecifier *)specifier;
7+
@end

Tweak.m

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#import "Tweak.h"
2+
3+
%hook PSListController
4+
5+
- (NSInteger)tableView:(id)view numberOfRowsInSection:(NSInteger)section {
6+
if ((section == 0) && [[self specifier].identifier isEqualToString:@"General"])
7+
return %orig(view, section) - 1;
8+
else
9+
return %orig(view, section);
10+
}
11+
12+
- (id)tableView:(id)view cellForRowAtIndexPath:(NSIndexPath *)indexPath {
13+
if ((indexPath.section == 0) && (indexPath.row > 0) && [[self specifier].identifier isEqualToString:@"General"])
14+
return %orig(view, [NSIndexPath indexPathForRow:indexPath.row + 1 inSection:indexPath.section]);
15+
else
16+
return %orig(view, indexPath);
17+
}
18+
19+
- (void)tableView:(UITableView *)view didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
20+
if ((indexPath.section == 0) && (indexPath.row > 0) && [[self specifier].identifier isEqualToString:@"General"])
21+
return %orig(view, [NSIndexPath indexPathForRow:indexPath.row + 1 inSection:indexPath.section]);
22+
else
23+
return %orig(view, indexPath);
24+
}
25+
26+
%end

Tweak.x

-32
This file was deleted.

Tweak.x

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Tweak.m

0 commit comments

Comments
 (0)