Created
March 11, 2017 20:18
-
-
Save kakobotasso/c2ecd55149965a2d5acf52e7d1fdc8da to your computer and use it in GitHub Desktop.
Como deixar imagens redondas com Swift alterando o Storyboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@IBDesignable class ProfileImageView: UIImageView { | |
@IBInspectable var cornerRadius: CGFloat = 0 { | |
didSet{ | |
self.layer.cornerRadius = cornerRadius | |
} | |
} | |
@IBInspectable var borderWidth: CGFloat = 0 { | |
didSet{ | |
self.layer.borderWidth = borderWidth | |
} | |
} | |
@IBInspectable var borderColor: UIColor = .white { | |
self.layer.borderColor = borderColor | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class ViewController: UIViewController { | |
@IBOutlet weak var ivProfile: ProfileImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment