GBA-8-19/Delta/Experimental Features/Features/gp_uiview.swift
2024-06-14 17:15:51 +08:00

34 lines
892 B
Swift

//
// gp_uiview.swift
// Hthik
//
// Created by 16 on 2024/5/31.
// Copyright © 2024 Hthik. All rights reserved.
//
import Foundation
import UIKit
class ViewModifier {
//
static func setCornerRadius(of view: UIView, radius: CGFloat) {
view.layer.cornerRadius = radius
view.clipsToBounds = true
}
//
static func setBorder(of view: UIView, color: UIColor, width: CGFloat) {
view.layer.borderColor = color.cgColor
view.layer.borderWidth = width
}
//
static func setShadow(of view: UIView, color: UIColor, opacity: Float, offset: CGSize, radius: CGFloat) {
view.layer.shadowColor = color.cgColor
view.layer.shadowOpacity = opacity
view.layer.shadowOffset = offset
view.layer.shadowRadius = radius
}
}