Advertisement
Guest User

Untitled

a guest
Jul 12th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. In plist:
  3.         <dict>
  4.             <key>cell</key>
  5.             <string>PSGroupCell</string>
  6.             <key>footerCellClass</key>
  7.             <string>SQDPrefBannerView</string>
  8.         </dict>
  9. */
  10.  
  11.  
  12. @protocol PreferencesTableCustomView
  13. - (id)initWithSpecifier:(id)arg1;
  14.  
  15. @optional
  16. - (CGFloat)preferredHeightForWidth:(CGFloat)arg1;
  17. - (CGFloat)preferredHeightForWidth:(CGFloat)arg1 inTableView:(id)arg2;
  18. @end
  19.  
  20. @interface SQDPrefBannerView : UITableViewCell <PreferencesTableCustomView> {
  21.     UILabel *label;
  22. }
  23.  
  24. @end
  25. //banner
  26. @implementation SQDPrefBannerView
  27.  
  28. - (id)initWithSpecifier:(PSSpecifier *)specifier {
  29.     self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
  30.     if (self) {
  31. #define kWidth [[UIApplication sharedApplication] keyWindow].frame.size.width
  32.         CGRect labelFrame = CGRectMake(0, -15, kWidth, 120);
  33.  
  34.  
  35.  
  36.         label = [[UILabel alloc] initWithFrame:labelFrame];
  37.  
  38.         [label.layer setMasksToBounds:YES];
  39.         [label setNumberOfLines:1];
  40.         label.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:40];
  41.  
  42.         label.textColor = [UIColor colorWithRed:90/255.0 green:151/255.0 blue:188/255.0 alpha:1.0];
  43.         label.textAlignment = NSTextAlignmentCenter;
  44.         label.text = @"“Quotifications”"; //set text here
  45.         label.alpha = 0.0;
  46.         [self addSubview:label];
  47.  
  48.         //fade in, optional
  49.         //if you remove this then remove the line setting the alpha to 0.0
  50.         [UIView animateWithDuration:1.3 animations:^() {
  51.             label.alpha = 1.0;
  52.         }];
  53.  
  54.     }
  55.     return self;
  56. }
  57. - (CGFloat)preferredHeightForWidth:(CGFloat)arg1 {
  58.     CGFloat prefHeight = 100.0;
  59.     return prefHeight;
  60. }
  61. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement