-
Notifications
You must be signed in to change notification settings - Fork 1
Single device definition
Adam Gr edited this page May 5, 2018
·
3 revisions
- Device definition object must allow to set device UI specific properties
- size
- safeAreaInsets
- layoutMargins
- horizontalSizeClass
- verticalSizeClass
- preferredContentSizeCategory
- layoutDirection
- directionalLayoutMargins
- ?
- Single device must be accessible for Swift and Objective-C
- New device definition can be created at any time outside library (no needs to update library in case of new device release)
Use NSObject subclass with DeviceViewMockable protocol conformance
class Phone_4Inches: NSObject, DeviceViewMockable {
var name = "iPhone SE"
var size = .init(width: 320.0, height: 568.0)
var layoutMargins = .init(top: 8.0, left: 16.0, bottom: 8.0, right: 16.0)
...
}