Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // TableViewDesign.swift
- // Tutor Demo
- //
- // Created by Macmini on 06/12/21.
- //
- import Foundation
- import UIKit
- @IBDesignable class TableViewDesign: UIView
- {
- @IBInspectable var cornerRedius: CGFloat = 10
- @IBInspectable var shadowColor : UIColor? = UIColor.black
- @IBInspectable var shadowOffSetWidth : Int = 0
- @IBInspectable var shadowOffSetHeight : Int = 0
- @IBInspectable var shadowOpacity : Float = 0.2
- override func layoutSubviews()
- {
- layer.cornerRadius = cornerRedius
- layer.shadowColor = shadowColor?.cgColor
- layer.shadowOffset = CGSize(width: shadowOffSetWidth, height: shadowOffSetHeight)
- let shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRedius)
- layer.shadowPath = shadowPath.cgPath
- layer.shadowOpacity = shadowOpacity
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement