iOSthemem0d

Untitled

Feb 25th, 2020
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. %hook UITabBar
  2.  
  3. -(void)layoutSubviews {
  4. %orig;
  5.  
  6. if(iPhonePLUS && floatyShapes == 0) { // Floaty shape for plus device
  7.  
  8. CGRect newFrame = self.frame; newFrame.size.width = 264; newFrame.size.height = 60; newFrame.origin.x = SCREEN_WIDTH*0.18; newFrame.origin.y = SCREEN_HEIGHT*0.90; self.frame = newFrame;
  9.  
  10. UIBezierPath* floatyPath = [UIBezierPath bezierPath];
  11. [floatyPath moveToPoint: CGPointMake(30, 0)];
  12. [floatyPath addLineToPoint: CGPointMake(234, 0)];
  13. [floatyPath addCurveToPoint: CGPointMake(264, 30) controlPoint1: CGPointMake(250.57, 0) controlPoint2: CGPointMake(264, 13.43)];
  14. [floatyPath addCurveToPoint: CGPointMake(234, 60) controlPoint1: CGPointMake(264, 46.57) controlPoint2: CGPointMake(250.57, 60)];
  15. [floatyPath addLineToPoint: CGPointMake(30, 60)];
  16. [floatyPath addCurveToPoint: CGPointMake(0, 30) controlPoint1: CGPointMake(13.43, 60) controlPoint2: CGPointMake(0, 46.57)];
  17. [floatyPath addCurveToPoint: CGPointMake(30, 0) controlPoint1: CGPointMake(0, 13.43) controlPoint2: CGPointMake(13.43, 0)];
  18. [floatyPath closePath];
  19. floatyPath.usesEvenOddFillRule = YES;
  20. [floatyPath fill];
  21.  
  22.  
  23. CAShapeLayer *tabbarLayer = [[CAShapeLayer alloc] init];
  24. [tabbarLayer setPath:floatyPath.CGPath];
  25.  
  26. self.layer.mask = tabbarLayer;
  27.  
  28. } else if (iPhone && floatyShapes == 0) { // Floaty shape for small device
  29.  
  30. CGRect newFrame = self.frame; newFrame.size.width = 264; newFrame.size.height = 60; newFrame.origin.x = SCREEN_WIDTH*0.15; newFrame.origin.y = SCREEN_HEIGHT*0.90; self.frame = newFrame;
  31.  
  32. UIBezierPath* floatyPath = [UIBezierPath bezierPath];
  33. [floatyPath moveToPoint: CGPointMake(30, 0)];
  34. [floatyPath addLineToPoint: CGPointMake(234, 0)];
  35. [floatyPath addCurveToPoint: CGPointMake(264, 30) controlPoint1: CGPointMake(250.57, 0) controlPoint2: CGPointMake(264, 13.43)];
  36. [floatyPath addCurveToPoint: CGPointMake(234, 60) controlPoint1: CGPointMake(264, 46.57) controlPoint2: CGPointMake(250.57, 60)];
  37. [floatyPath addLineToPoint: CGPointMake(30, 60)];
  38. [floatyPath addCurveToPoint: CGPointMake(0, 30) controlPoint1: CGPointMake(13.43, 60) controlPoint2: CGPointMake(0, 46.57)];
  39. [floatyPath addCurveToPoint: CGPointMake(30, 0) controlPoint1: CGPointMake(0, 13.43) controlPoint2: CGPointMake(13.43, 0)];
  40. [floatyPath closePath];
  41. floatyPath.usesEvenOddFillRule = YES;
  42. [floatyPath fill];
  43.  
  44.  
  45. CAShapeLayer *tabbarLayer = [[CAShapeLayer alloc] init];
  46. [tabbarLayer setPath:floatyPath.CGPath];
  47.  
  48. self.layer.mask = tabbarLayer;
  49. }
  50. %end
Advertisement
Add Comment
Please, Sign In to add comment