Manual layout engine in swift.