UIView
public extension UIView
-
Consider view with alpha <0.01 as invisible because it stops receiving touches at this level: “This method ignores view objects that are hidden, that have disabled user interactions, or have an alpha level less than 0.01”. This one also checks all superviews for the same parameters.
Declaration
Swift
var isVisible: Bool { get }
-
Checks wheter view is visible in containing window.
Declaration
Swift
var isVisibleInWindow: Bool { get }
-
View width
Declaration
Swift
var width: CGFloat { get set }
-
View height
Declaration
Swift
var height: CGFloat { get set }
-
View size
Declaration
Swift
var size: CGSize { get set }
-
Checks if code runs inside animation closure
Declaration
Swift
@available(iOS 9.0, *) static var isInAnimationClosure: Bool { get }
-
Returns
true
if view can be animated. That meanswindow
is notnil
and application state is.active
.Declaration
Swift
var isAnimatable: Bool { get }
-
Undocumented
Declaration
Swift
func fadeInAnimated()
-
Undocumented
Declaration
Swift
func fadeOutAnimated()
-
Makes corner radius euqal to half of width or height
Declaration
Swift
func makeRound()
-
Returns closest UIViewController from responders chain.
Declaration
Swift
var viewController: UIViewController? { get }
-
Gets view’s top most superview
Declaration
Swift
var rootView: UIView { get }
-
Returns all view’s subviews
Declaration
Swift
var allSubviews: [UIView] { get }
-
Returns all view’s subviews
Declaration
Swift
var allVisibleSubviews: [UIView] { get }
-
All view superviews to the top most
Declaration
Swift
var superviews: DropFirstSequence<UnfoldSequence<UIView, (UIView?, Bool)>> { get }
-
All view superviews to the top most
-
Creates image from view and adds overlay image at the center if provided
Declaration
Swift
func getSnapshotImage() -> UIImage?
-
Ends editing on view and all of it’s subviews
Declaration
Swift
@IBAction func endEditing()
-
Checks if window is not nil before calling becomeFirstResponder()
Declaration
Swift
func becomeFirstResponderIfPossible()
-
Is activity indicator showing?
Declaration
Swift
var isShowingActivityIndicator: Bool { get }
-
Shows activity indicator. It uses existing one if found in subviews. Calls to -showActivityIndicator and -hideActivityIndicator have to be balanced or hide have to be forced.
Declaration
Swift
func showActivityIndicator()
-
Hides activity indicator. Calls to -showActivityIndicator and -hideActivityIndicator have to be balanced or hide have to be forced.
Declaration
Swift
func hideActivityIndicator(force: Bool = false)
Parameters
force
Force activity indicator hide
-
Creates constraints between self and provided view for top, bottom, leading and trailing sides.
Declaration
Swift
@available(iOS 9.0, *) func constraintSides(to containerView: UIView, insets: UIEdgeInsets = .zero)
Parameters
containerView
Container view containing
self
.insets
Insets to the
containerView
..zero
by default.
-
Undocumented
Declaration
Swift
@IBInspectable var borderColor: UIColor? { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var borderWidth: CGFloat { get set }
-
Sets border width equal to 1 pixel
Declaration
Swift
@IBInspectable var borderOnePixelWidth: Bool { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var cornerRadius: CGFloat { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var shadowColor: UIColor? { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var shadowOffset: CGPoint { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var shadowOpacity: Float { get set }
-
Undocumented
Declaration
Swift
@IBInspectable var shadowRadius: CGFloat { get set }
-
Apply square path for shadow. This increases performance for shadow drawing in case shadow is square.
Declaration
Swift
@IBInspectable var shadowApplyPath: Bool { get set }
-
Undocumented
See moreDeclaration
Swift
enum ViewState
-
Undocumented
Declaration
Swift
func configure(viewState: ViewState)