Latest 0.2.4
License MIT
Platforms ios 9.0

CI Status


To run the example project, clone the repo, and run pod install from the Example directory first or use:

try pod 'SYNEBorder'


Swift 4


SYNEBorder is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SYNEBorder'


let rect = CGRect(x: 0, y: 0, width: 200, height: 300)
let view = UIView(frame: rect)

// Note: Using view.border creates a new border reference if one does not exist.
// To check if a border exists without creating a border reference, use:
if view.hasBorder {
    // view does have a border
} else {
    // view does not have a border

// Add a dotted, black border with all corners rounded
view.border.update(edges: .all, corners: .allCorners, width: 1, color: .black, radius: 20, dotted: true)

// Update the topLeft corner to be solid instead of dotted
view.border.corners.topLeft.dotted = false

// Update the bottom edge to be green
view.border.edges.bottom.color = .green

// Update the width of all borders to 2
view.border.width = 2

// Update left corners to a radius of 10, keeping all previous settings
view.border.update(corners: .left, width: 1, color: .black, radius: 10, dotted: true)

// Create and configure a new border
let border = Border(width: 1, color: .black)

// Setting the border removes the old border and applies the new border's settings
view.border = border

// Remove all borders and corner rounding, returning the view to its original state

// To hide the border without removing it, use:
view.border.isHidden = true

// To change the border's alpha value, use:
view.border.alpha = 0.5

// To create a copy of the border, use:
let newBorder = view.border.copy()
// This will change the width of newBorder but will not change the width of view.border.
newBorder.width = 5 

See example project for more samples.




SYNEBorder is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SYNEBorder",
    "version": "0.2.4",
    "summary": "Swiftly create custom UIView borders with SYNEBorder.",
    "description": "Swiftly create custom UIView borders with SYNEBorder.nnEach corner and each edge of the UIView can be customized with a border of different color, radius, and/or width. Borders can also be dotted.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "shawnynicole": "[email protected]"
    "source": {
        "git": "",
        "tag": "Release/0.2.4"
    "platforms": {
        "ios": "9.0"
    "swift_version": "4.0",
    "source_files": "SYNEBorder/Classes/**/*"

Pin It on Pinterest

Share This