Advertisement
Guest User

Untitled

a guest
Nov 11th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #import <UIKit/UIKit.h>
  3. #import <CoreGraphics/CoreGraphics.h>
  4. #import <Foundation/Foundation.h>
  5.  
  6. @interface TFNItemsDataViewControllerBackingStore
  7. -(void)insertSection:(id)arg1 atIndex:(long long)arg2;
  8. -(void)insertItem:(id)arg1 atIndexPath:(id)arg2;
  9. @end
  10.  
  11.  
  12. @interface T1SettingsViewController : UIViewController
  13. @property ( nonatomic, strong) TFNItemsDataViewControllerBackingStore *backingStore;
  14. @property ( nonatomic, strong) NSArray* sections;
  15.  
  16.  
  17. @end
  18.  
  19. @interface TFNTextCell: UITableViewCell
  20. @end
  21.  
  22.  
  23. %hook T1SettingsViewController
  24. -(void)viewWillAppear:(BOOL)arg1
  25. {
  26.     %orig;
  27.    
  28.    
  29.     if([self.sections count] == 2) {
  30.  
  31.  
  32. // setup a new section
  33.  
  34.  
  35.  
  36.     TFNItemsDataViewControllerBackingStore *DataViewControllerBackingStore = self.backingStore;
  37.    
  38.  
  39.     //Insert section at Top "TFNItemsDataViewSectionController"
  40.     [DataViewControllerBackingStore insertSection:0 atIndex:0];
  41.  
  42.  
  43.  
  44.     //insert Row 0 in section 0 "TFNDataViewItem"
  45.     [DataViewControllerBackingStore insertItem:@"Row 0 " atIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
  46.  
  47.  
  48.  
  49.      //Insert Row1 in section 0 "TFNDataViewItem"
  50.         [DataViewControllerBackingStore insertItem:@"Row1" atIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
  51.  
  52.  
  53.     }
  54.    
  55.    
  56.    
  57.    
  58. }
  59.  
  60. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  61.  
  62.  
  63.  
  64. {
  65.  
  66.     if(indexPath.section == 0 && indexPath.row ==1 ) {
  67.  
  68.         TFNTextCell *Tweakcell = [[%c(TFNTextCell) alloc] init];
  69.        
  70.        
  71.         [Tweakcell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
  72.  
  73.         // cell title
  74.         [Tweakcell.textLabel setText:@"your tweak name"];
  75.        
  76.        
  77.        
  78.        
  79.        
  80.         return Tweakcell;
  81.  
  82.     }else if (indexPath.section == 0 && indexPath.row ==0 ) {
  83.        
  84.         TFNTextCell *Settingscell = [[%c(TFNTextCell) alloc] init];
  85.        
  86.         // setup title section
  87.         [Settingscell setBackgroundColor:[UIColor clearColor]];
  88.  
  89. Settingscell.textLabel.font = [UIFont fontWithName:@".SFUIText-Heavy" size:18];
  90.  
  91.        
  92. Settingscell.textLabel.textColor = [UIColor colorWithRed:0.40 green:0.47 blue:0.53 alpha:1.0];
  93.  
  94.         [Settingscell.textLabel setText:@"Settings"];
  95.        
  96.        
  97.        
  98.        
  99.        
  100.         return Settingscell;
  101.     }
  102.        
  103.    
  104.     return %orig;
  105. }
  106.  
  107. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  108. {
  109.     if ([indexPath section]== 0 && [indexPath row]== 1) {
  110.        
  111.         // do anything when cell is clicked
  112.          
  113.         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ROFL"
  114.                                                         message:@"Dee dee doo doo."
  115.                                                        delegate:self
  116.                                               cancelButtonTitle:@"OK"
  117.                                               otherButtonTitles:nil];
  118.         [alert show];
  119.  
  120.     }else {
  121.         return %orig;
  122.     }
  123. }
  124.  
  125.  
  126.  
  127. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement