Slide 14
Slide 14 text
A look at the landscape
layout code
let toolbarHeight: CGFloat = 50
let contentHeight = view.frame.height - toolbarHeight
let margin = CGFloat(10)
if view.frame.isLandscape()
{
let leftColumnWidth = view.frame.width * 0.34
let rightColumnWidth = view.frame.width * 0.66
let upperRowHeight = contentHeight * 0.66
let bottomRowHeight = contentHeight * 0.34 - topLayoutGuide.length
let upperRowTop = topLayoutGuide.length
let bottomRowTop = upperRowHeight + upperRowTop
savedColorsGrid.frame = CGRect(x: 0, y: upperRowTop, width:
leftColumnWidth, height: upperRowHeight).rectByInsetting(dx: margin, dy: margin)
colorSwatch.frame = CGRect(x: leftColumnWidth, y: upperRowTop, width:
rightColumnWidth, height: upperRowHeight).rectByInsetting(dx: margin, dy: margin)
colorPicker.frame = CGRect(x: 0, y: bottomRowTop, width: leftColumnWidth,
height: bottomRowHeight).rectByInsetting(dx: margin, dy: margin)
rgbWidget.frame = CGRect(x: leftColumnWidth, y: bottomRowTop, width:
rightColumnWidth, height: bottomRowHeight).rectByInsetting(dx: margin, dy: margin)
}