1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// IBTSegmentedControl.m
// XFFruit
//
// Created by Xummer on 4/11/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#import "IBTSegmentedControl.h"
@implementation IBTSegmentedControl
#pragma mark - Life Cycle
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self _init];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
if (!IBT_IOS7_OR_LATER) {
self.clipsToBounds = YES;
}
}
#pragma mark - Private Method
- (void)_init {
if (!IBT_IOS7_OR_LATER) {
self.layer.borderColor = IBT_TINTCOLOR.CGColor;
self.layer.borderWidth = 1.0f;
self.layer.cornerRadius = 4.0f;
self.layer.masksToBounds = YES;
}
}
@end