mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 21:15:21 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
95
CovidSafe/UIElements/UIViewExtension.swift
Normal file
95
CovidSafe/UIElements/UIViewExtension.swift
Normal file
|
@ -0,0 +1,95 @@
|
|||
//
|
||||
// UIViewExtension.swift
|
||||
// CovidSafe
|
||||
//
|
||||
// Copyright © 2020 Australian Government. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
extension UIView {
|
||||
|
||||
@IBInspectable
|
||||
var cornerRadius: CGFloat {
|
||||
get {
|
||||
return layer.cornerRadius
|
||||
}
|
||||
set {
|
||||
layer.cornerRadius = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var borderWidth: CGFloat {
|
||||
get {
|
||||
return layer.borderWidth
|
||||
}
|
||||
set {
|
||||
layer.borderWidth = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var borderColor: UIColor? {
|
||||
get {
|
||||
if let color = layer.borderColor {
|
||||
return UIColor(cgColor: color)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
set {
|
||||
if let color = newValue {
|
||||
layer.borderColor = color.cgColor
|
||||
} else {
|
||||
layer.borderColor = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var shadowRadius: CGFloat {
|
||||
get {
|
||||
return layer.shadowRadius
|
||||
}
|
||||
set {
|
||||
layer.shadowRadius = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var shadowOpacity: Float {
|
||||
get {
|
||||
return layer.shadowOpacity
|
||||
}
|
||||
set {
|
||||
layer.shadowOpacity = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var shadowOffset: CGSize {
|
||||
get {
|
||||
return layer.shadowOffset
|
||||
}
|
||||
set {
|
||||
layer.shadowOffset = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var shadowColor: UIColor? {
|
||||
get {
|
||||
if let color = layer.shadowColor {
|
||||
return UIColor(cgColor: color)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
set {
|
||||
if let color = newValue {
|
||||
layer.shadowColor = color.cgColor
|
||||
} else {
|
||||
layer.shadowColor = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue