I have a four buttons layout. In portrait they should be shown one above the other. In landscape they should be in two columns each with two buttons.
I implement the but
Swift 4 code for the accepted answer:
if (self.view.traitCollection.horizontalSizeClass == .compact) { ... }