How can I check what device the user is using?

I’m working on an app, and I’d like different layouts for iPhone and iPad. How can I accomplish that?

Try device.metrics. See this link.

@Zenon Try this. Also, do a forum search on deviceMetrics.

function setup()
    for a,b in pairs(deviceMetrics()) do

Thanks. deviceMetrics().platform returns iPad4,7 while deviceMetrics().platformType returns iPad 4G. Not sure where the first one comes from, because I’m on an iPad mini 3.

Google is your friend. See the chart here for how to read devicemetrics: