Latest 0.1.1
License MIT
Platforms ios 8.0, requires ARC
Dependencies SnapKit

BoxesView is a UIView for iOS that lays out subviews as boxes, much like a simplified version of a UICollectionView.

It completely layed out using auto layout constraints and therefore fits in modern apps. It’s a simplified version of a UICollectionView that doesn’t need any delegate or data source. You just configure the number of columns you want and set the views that you want to be displayed in boxes.

Screenshot 1
Screenshot 2



  • Swift 2.0
  • iOS 8.0+
  • Xcode 7.2+


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

source ''
platform :ios, '8.0'

pod "BoxesView"

Then, run the following command:

$ pod install


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

Add to your project

Use the BoxesView in your project as you would use any other UIView. For example in a Storyboard. The BoxesView has an intrinsic height so you do not have to specify a height for it (although you can give it a explicit height). The simple assign the boxes views to it:

@IBOutlet weak var boxesView: BoxesView! {
    didSet {
        boxesView.boxes = [

The boxes will be layed out in a similar fashion as in a Collection View.


There are a few options available to a BoxesView. These are all variables with @IBInspectable and thus can be set in your Storyboard.

  • [x] columns Determines the number of columns that your BoxesView should have. Defaults to 2
  • [x] rowHeight Use this to specify a fixed row height. If you specify -1 (which is the default) your box views need to have an (intrinsic) height and the row height will be determined by the box in the row with the greatest height.


This library depends on SnapKit to create the necessary auto layout constraints.


Lammert Westerhoff, [email protected]


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

Latest podspec

    "name": "BoxesView",
    "version": "0.1.1",
    "summary": "A UIView layed out in boxes",
    "description": "BoxesView is a UIView that lays out subviews as boxes, much like a simplified version of a UICollectionView",
    "homepage": "",
    "screenshots": [
    "license": "MIT",
    "authors": {
        "Lammert Westerhoff": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "dependencies": {
        "SnapKit": [
    "pushed_with_swift_version": "2.3"

Pin It on Pinterest

Share This