21 lines
528 B
Swift
21 lines
528 B
Swift
|
|
//
|
||
|
|
// UITraitCollection+MacLike.swift
|
||
|
|
// App
|
||
|
|
//
|
||
|
|
// Created by James Magahern on 2/11/21.
|
||
|
|
//
|
||
|
|
|
||
|
|
import UIKit
|
||
|
|
|
||
|
|
extension UITraitCollection {
|
||
|
|
public func alwaysPadLike() -> UITraitCollection {
|
||
|
|
if self.userInterfaceIdiom == .mac {
|
||
|
|
// Override traits to be iPad like on mac. We dont want small list cells here.
|
||
|
|
let desiredTraits = UITraitCollection(userInterfaceIdiom: .pad)
|
||
|
|
return UITraitCollection(traitsFrom: [ self, desiredTraits ])
|
||
|
|
}
|
||
|
|
|
||
|
|
return self
|
||
|
|
}
|
||
|
|
}
|