MARoundButton
Updated
MARoundButton
MARoundButton is a simple UIButton subclass written in Swift 2.2 Swift 3.0 that allows for easy rounding of UIButtons. MARoundButton supports Interface Builder as well as directly through code. MARoundButton is my first open sourced project, albeit a simple one. If you are interested in using MARoundButton it can be found on Github.
Installation
MARoundButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MARoundButton'
How To Use
MARoundButton can be used through StoryBoards by adding a UIButton to the View and under the identity inspector select MARoundButton as the class and the module. All the properties can be changed within the attributes inspector tab.
MARoundButton can also be used through code just like a normal UIButton. Just remember to set the Round button properties.
StoryBoard Example
New content
Swift Example
First import MARoundButton
import MARoundButton
Next setup a button similar to the following:
let btn = MARoundButton(frame: CGRect(x: 20, y: 40, width: 50, height: 50))
btn.backgroundColor = UIColor.brown
btn.setTitle("BTN", for: .normal)
btn.tintColor = UIColor.white
// MARoundButton
btn.borderColor = UIColor.black
btn.border = 2
btn.corner = 23
btn.borderAlpha = 0.5
self.view.addSubview(btn)
TODO
- Finish documentation
- Add a demo project
- Add code demo for Objective-C
Author
Tyler Miller
License
MARoundButton is available under the MIT license. See the LICENSE file for more info.