A Objective C impltation for Runkeeper design switch control, it is a clone from DGRunkeeperSwitch
- iOS 7.0 or higher (May work on previous versions, just did not test it. Feel free to edit it).
- ARC
Open and run the RCRunkeeperSwitchDemo.xcodeproj
in Xcode to see RCRunkeeperSwitch in action.
pod 'RCRunkeeperSwitch'
All you need to do is drop RCRunkeeperSwitch.h
and RCRunkeeperSwitch.m
file into your project
RCRunkeeperSwitch *runkeeperSwitch = [[RCRunkeeperSwitch alloc]initWithLeftTitle:@"Feed" rightTitle:@"Leaderboard"];
runkeeperSwitch.backgroundColor = [UIColor colorWithRed:239.0/255.0 green:95.0/255.0 blue:49.0/255.0 alpha:1.0];
runkeeperSwitch.selectedBackgroundColor = [UIColor whiteColor];
runkeeperSwitch.titleColor = [UIColor whiteColor];
runkeeperSwitch.selectedTitleColor = [UIColor colorWithRed:239.0/255.0 green:95.0/255.0 blue:49.0/255.0 alpha:1.0];
runkeeperSwitch.titleFont = [UIFont fontWithName:@"HelveticaNeue-Medium" size:13];
runkeeperSwitch.frame = CGRectMake(50, 20, CGRectGetWidth(self.view.bounds) - 100, 30);
runkeeperSwitch.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self.view addSubview:runkeeperSwitch];
You are welcome to fork and submit pull requests!