UIView
class UIView : UIResponder, NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem, UITraitEnvironment, UICoordinateSpace, UIFocusItem, UIFocusItemContainer, CALayerDelegate
-
Adding constraints to view
Declaration
Swift
public func addConstraints(from view: UIView, top: CGFloat = 0)
Parameters
view
UIView to add constraints to.
top
Top anchor. default value
0
-
Taking a screenshot of the current view state.
Declaration
Swift
public func screenshot() -> UIImage
Return Value
UIImage screenshot
-
Adding a shadow effect.
Declaration
Swift
public func addShadow(withOpacity opacity: Float = 0.35, withColour colour: UIColor = .black, withRadius radius: CGFloat = 5, withOffset offset: CGSize = CGSize(width: 0.0, height: 2.0))
Parameters
opacity
The opacity. default value
0.35
colour
The color. default value
.black
radius
The radius. default value
5
offset
The offset: default value CGSize(width: 0.0, height: 2.0)