Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <UIKit/UIKit.h>
- #import <CoreGraphics/CoreGraphics.h>
- #import <Foundation/Foundation.h>
- @interface TFNItemsDataViewControllerBackingStore
- -(void)insertSection:(id)arg1 atIndex:(long long)arg2;
- -(void)insertItem:(id)arg1 atIndexPath:(id)arg2;
- @end
- @interface T1SettingsViewController : UIViewController
- @property ( nonatomic, strong) TFNItemsDataViewControllerBackingStore *backingStore;
- @property ( nonatomic, strong) NSArray* sections;
- @end
- @interface TFNTextCell: UITableViewCell
- @end
- %hook T1SettingsViewController
- -(void)viewWillAppear:(BOOL)arg1
- {
- %orig;
- if([self.sections count] == 2) {
- // setup a new section
- TFNItemsDataViewControllerBackingStore *DataViewControllerBackingStore = self.backingStore;
- //Insert section at Top "TFNItemsDataViewSectionController"
- [DataViewControllerBackingStore insertSection:0 atIndex:0];
- //insert Row 0 in section 0 "TFNDataViewItem"
- [DataViewControllerBackingStore insertItem:@"Row 0 " atIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
- //Insert Row1 in section 0 "TFNDataViewItem"
- [DataViewControllerBackingStore insertItem:@"Row1" atIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
- }
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if(indexPath.section == 0 && indexPath.row ==1 ) {
- TFNTextCell *Tweakcell = [[%c(TFNTextCell) alloc] init];
- [Tweakcell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
- // cell title
- [Tweakcell.textLabel setText:@"your tweak name"];
- return Tweakcell;
- }else if (indexPath.section == 0 && indexPath.row ==0 ) {
- TFNTextCell *Settingscell = [[%c(TFNTextCell) alloc] init];
- // setup title section
- [Settingscell setBackgroundColor:[UIColor clearColor]];
- Settingscell.textLabel.font = [UIFont fontWithName:@".SFUIText-Heavy" size:18];
- Settingscell.textLabel.textColor = [UIColor colorWithRed:0.40 green:0.47 blue:0.53 alpha:1.0];
- [Settingscell.textLabel setText:@"Settings"];
- return Settingscell;
- }
- return %orig;
- }
- -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if ([indexPath section]== 0 && [indexPath row]== 1) {
- // do anything when cell is clicked
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ROFL"
- message:@"Dee dee doo doo."
- delegate:self
- cancelButtonTitle:@"OK"
- otherButtonTitles:nil];
- [alert show];
- }else {
- return %orig;
- }
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement