This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NaturalMotion.swift | |
// | |
// Created by Maciej Swic on 2014-06-06. | |
// Released under the MIT license. | |
// | |
import UIKit | |
extension UIView { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source for the Accidental Tech Podcast (ATP) T-Shirt: | |
// http://www.marco.org/2014/04/29/atp-shirts | |
// | |
// By Troy Gaul, June 2, 2014. | |
// | |
// Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license. | |
// https://gist.github.com/marcoarment/2542cd28cb5df0aa97d8 | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setupConstraints() | |
{ | |
let views: NSArray = [view1, view2, view3] | |
views.autoDistributeViewsAlongAxis(.Horizontal, withFixedSpacing: 10.0, insetSpacing: true, matchedSizes: false, alignment: .AlignAllTop) | |
// if you don't like creating an intermediate constant, the following works using Xcode 6.1 GM: | |
[view1, view2, view3].autoDistributeViewsAlongAxis(.Horizontal, withFixedSpacing: 10.0, insetSpacing: true, matchedSizes: false, alignment: .AlignAllTop) | |
} |