Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %hook UITabBar
- -(void)layoutSubviews {
- %orig;
- if(iPhonePLUS && floatyShapes == 0) { // Floaty shape for plus device
- 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;
- UIBezierPath* floatyPath = [UIBezierPath bezierPath];
- [floatyPath moveToPoint: CGPointMake(30, 0)];
- [floatyPath addLineToPoint: CGPointMake(234, 0)];
- [floatyPath addCurveToPoint: CGPointMake(264, 30) controlPoint1: CGPointMake(250.57, 0) controlPoint2: CGPointMake(264, 13.43)];
- [floatyPath addCurveToPoint: CGPointMake(234, 60) controlPoint1: CGPointMake(264, 46.57) controlPoint2: CGPointMake(250.57, 60)];
- [floatyPath addLineToPoint: CGPointMake(30, 60)];
- [floatyPath addCurveToPoint: CGPointMake(0, 30) controlPoint1: CGPointMake(13.43, 60) controlPoint2: CGPointMake(0, 46.57)];
- [floatyPath addCurveToPoint: CGPointMake(30, 0) controlPoint1: CGPointMake(0, 13.43) controlPoint2: CGPointMake(13.43, 0)];
- [floatyPath closePath];
- floatyPath.usesEvenOddFillRule = YES;
- [floatyPath fill];
- CAShapeLayer *tabbarLayer = [[CAShapeLayer alloc] init];
- [tabbarLayer setPath:floatyPath.CGPath];
- self.layer.mask = tabbarLayer;
- } else if (iPhone && floatyShapes == 0) { // Floaty shape for small device
- 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;
- UIBezierPath* floatyPath = [UIBezierPath bezierPath];
- [floatyPath moveToPoint: CGPointMake(30, 0)];
- [floatyPath addLineToPoint: CGPointMake(234, 0)];
- [floatyPath addCurveToPoint: CGPointMake(264, 30) controlPoint1: CGPointMake(250.57, 0) controlPoint2: CGPointMake(264, 13.43)];
- [floatyPath addCurveToPoint: CGPointMake(234, 60) controlPoint1: CGPointMake(264, 46.57) controlPoint2: CGPointMake(250.57, 60)];
- [floatyPath addLineToPoint: CGPointMake(30, 60)];
- [floatyPath addCurveToPoint: CGPointMake(0, 30) controlPoint1: CGPointMake(13.43, 60) controlPoint2: CGPointMake(0, 46.57)];
- [floatyPath addCurveToPoint: CGPointMake(30, 0) controlPoint1: CGPointMake(0, 13.43) controlPoint2: CGPointMake(13.43, 0)];
- [floatyPath closePath];
- floatyPath.usesEvenOddFillRule = YES;
- [floatyPath fill];
- CAShapeLayer *tabbarLayer = [[CAShapeLayer alloc] init];
- [tabbarLayer setPath:floatyPath.CGPath];
- self.layer.mask = tabbarLayer;
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment