Question: In Objective-C I use generics and like them a lot, in swift I want to use Array but in Objective-C its accessible only as a Array, so it looks like I need to return NSMutableArray while losing type signature that Swift doesn't support? 
Is this how it's supposed to work?

Answer: 
I ended up writing my own UIView to solve the problem. I doubt if it's very robust, but it solves my immediate needs. Please, comment if you have an improvements to suggest.

```
import UIKit

class FlowLayout: UIView {
private var hgapValue: CGFloat = 0.0
private var vgapValue: CGFloat = 0.0

var hgap: CGFloat {
    set(newValue) {
        hgapValue = (newValue < 0) ? -newValue : newValue
    }
    get {
        return hgapValue
    }
}

var vgap: CGFloat {
    set(newValue) {
        vgapValue = (newValue < 0) ? -newValue : newValue
    }
    get {
        return vgapValue
    }
}

//initWithFrame to init view from code
override init(frame: CGRect) {
    super.init(frame: frame)
    setupView()
}

//initWithCode to init view from xib or storyboard
required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    setupView()
}

override func didAddSubview(_ subview: UIView) {
    refreshLayout()
}

//common func to init our view
private func setupView() {
    // backgroundColor = .red
}

public func refreshLayout() {
    var x: CGFloat = 0.0
    var y: CGFloat = 0.0

    for subview in subviews {
        subview.frame.origin.x = x
        subview.frame.origin.y = y
        x += subview.frame.width + hgapValue
        if x + subview.frame.width >= (subview.superview?.frame.width)! {
            x = 0.0
            y += subview.frame.height + vgapValue
        }

    }
    setNeedsDisplay()
}

}

```
In interface builder, using UIStackView to achieve a simple alternative. 

You can also turn on auto layout to make it naturally.