Swiftpack.co - AndreasVerhoeven/AveCommonHelperViews as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AndreasVerhoeven.
AndreasVerhoeven/AveCommonHelperViews 1.0.0
Commonly used helpers views for UIKit (ShapeView, GradientView, ContentTextView, RoundRectView)
⭐️ 1
🕓 2 years ago
.package(url: "https://github.com/AndreasVerhoeven/AveCommonHelperViews.git", from: "1.0.0")


Commonly used helpers views for UIKit (ShapeView, GradientView, ContentTextView, RoundRectView, CircleView, FixedSizeView)


This is a small collection of commonly used UIView subclasses. For example, GradientView wraps CAGradientLayer and works with dynamic UIColors as well as UIView-based-animations.


A small UITextView subclass that disallows selecting text and scrolling, but does allow interacting with links. This is useful if you want to show complex text with embedded links, but do not want text selection.


A view that wraps CAGradientLayer, supports dynamic UIColors and UIView-based-animations.

Common helpers are:

  • setVerticalLinearGradient()
  • setHorizontalLinearGradient()
  • setVerticalLinearFadeOut()
  • setHorizontalLinearFadeOut()
  • setVerticalLinearFadeIn()
  • setHorizontalLinearFadeIn()
  • setColors(_:, locations: startPoint: endPoint: type:)

Each of those also have equivalent init methods:

  • init(verticallyFrom:to:)
  • init(horizontallyFrom:to:)
  • init(verticallyFadingOutFrom:)
  • init(verticallyFadingInTo:)
  • init(horizontallyFadingOutFrom:)
  • init(horizontallyFadingInTo:)
  • init(colors: locations:startPoint:endPoint:type)


let fadeOutView = GradientView(verticallyFadingOutFrom: .white)


A view that provides easy access to cornerRadius, borderWidth and borderColor. Supports dynamic UIColor and UIView-based-animations.


let roundRectView = RoundRectView(cornerRadius: 12, borderWidth: 1, borderColor: .separator, clipsToBounds: true)


A view that wraps CAShapeLayer. Supports dynamic UIColor and UIView-based-animations.


let shapeView = ShapeView()
shapeView.fillColor = .red
shapeView.path = UIBezierPath(ovalIn: CGRect(x:0, y: 0, width: 100, height: 100))


A view which has constraints to always be a circle and adjusts it's cornerRadius to be so. Size can be set thru fixedSize, which is animatable.


let circleView = CircleView(size: 44, backgroundColor: .red, clipsToBounds: true)

let otherCircle = CircleView(size: 20, backgroundColor: .red)


A view that has constraints set up so it's always a fixedSize, fixedWidth or fixedHeight. The size can easily be changed using a parameter and size changes can force layout of the superview.

This view is useful when you have a fixed and possibly dynamically changing fixed size: you don't need to keep track of the constraints.


let view = FixedSizedView(width: 100, automaticallyLayoutSuperviewOnChange: .whenInAnimationBlock)
view.fixedWidth = 200

let otherView = FixedSizedView(size: CGSize(width: 100, height: 200))
otherView.fixedHeight = 30


Stars: 1
Last commit: 47 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics