Created
September 10, 2015 15:46
-
-
Save 0x7466/d5dbe9df9001b6c63007 to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// TFImageView.swift | |
// Lome | |
// | |
// Created by Tobias Feistmantl on 10/09/15. | |
// Copyright (c) 2015 Tobias Feistmantl. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
class TFImageView: UIImageView { | |
@IBInspectable var circularImage: Bool = false { | |
didSet { | |
if circularImage { | |
layer.cornerRadius = frame.size.width / 2 | |
clipsToBounds = true | |
} else { | |
layer.cornerRadius = 0 | |
clipsToBounds = false | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment