Skip to content

Commit

Permalink
UIView Interface builder ext
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamonek committed Jan 8, 2016
1 parent 96708f0 commit 2e75cf8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions UIView.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// UIViewExt.swift
//
// Created by Jamone Alexander Kelly on 1/7/16.
// Copyright © 2016 Jamone Kelly. All rights reserved.
//

import UIKit
import Foundation

extension UIView {

@IBInspectable var cornerRadius: CGFloat {
get { return layer.cornerRadius }
set {
layer.cornerRadius = newValue
layer.masksToBounds = newValue > 0
}
}

@IBInspectable var borderWidth: CGFloat {
get { return layer.borderWidth }
set { layer.borderWidth = newValue }
}

@IBInspectable var borderColor: UIColor {
get { return UIColor(CGColor: layer.borderColor!) ?? UIColor() }
set { layer.borderColor = newValue.CGColor }
}

}
4 changes: 4 additions & 0 deletions UIView.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios'>
<timeline fileName='timeline.xctimeline'/>
</playground>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
6 changes: 6 additions & 0 deletions UIView.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
</TimelineItems>
</Timeline>

0 comments on commit 2e75cf8

Please sign in to comment.