Skip to content

Instantly share code, notes, and snippets.

@0x7466
Created September 10, 2015 15:46
Show Gist options
  • Save 0x7466/d5dbe9df9001b6c63007 to your computer and use it in GitHub Desktop.
Save 0x7466/d5dbe9df9001b6c63007 to your computer and use it in GitHub Desktop.
//
// 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