HarryExtensions 0.5.1

HarryExtensions 0.5.1

Maintained by Harry Ng.



  • By
  • pewepw

HarryExtensions

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 10+
  • Swift 4.2+

Installation

HarryExtensions is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'HarryExtensions'

Usage

1. Stack vertically and horizontally, with UIView anchors extension

let pointStackView = VerticalStackView(arrangedSubviews: [
                availableTitleLabel,
                pointLabel
            ])
addSubview(pointStackView)
pointStackView.anchor(top: topAnchor, leading: leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: 10, left: 15, bottom: 0, right: 0), size: .init(width: 0, height: 40))
        
let profileStackView = HorizontalStackView(arrangedSubviews: [
      nameLabel,
      profileImage
    ], spacing: 10)
addSubview(profileStackView)
profileStackView.anchor(top: topAnchor, leading: pointStackView.trailingAnchor, bottom: nil, trailing: trailingAnchor, padding: .init(top: 10, left: 15, bottom: 0, right: 15), size: .init(width: 0, height: 40))

StackViewExample

And also a handy collection of Swift extensions to boost your productivity

Author

Harry Ng, [email protected]

License

HarryExtensions is available under the MIT license. See the LICENSE file for more info.