I want to create if statements testing for which device the app is running on. For example, if the app is running on an iPhone 5s, change node positioning. Does anyone know how to create these statements? Thanks.
I want to test for the screen size.
EDIT:
I've found the answer. I download the SDK from here using Cocopods. Once instilled, I implemented the following code, so I could test for the size of the screen. I can then add where I want to nodes to be positioned in the if statements. It's a bit of a pain, but it's the best solution I could come up with.
let device = Device()
let iPhone4sSizedGroup: [Device] =
[.iPhone4, .iPhone4s, .Simulator(.iPhone4), .Simulator(.iPhone4s)]
if device.isOneOf(iPhone4sSizedGroup) {
}
let iPhone5sSizedGroup: [Device] =
[.iPodTouch5, .iPodTouch6, .iPhone5, .iPhone5s, .iPhone5c, .Simulator(.iPhone5), .Simulator(.iPhone5s), .Simulator(.iPhone5c), .Simulator(.iPodTouch5), .Simulator(.iPodTouch6)]
if device.isOneOf(iPhone5sSizedGroup) {
}
let iPhone6sSizedGroup: [Device] =
[.iPhone6, .iPhone6s, .Simulator(.iPhone6), .Simulator(.iPhone6s)]
if device.isOneOf(iPhone6sSizedGroup) {
}.