Snap.swift icon indicating copy to clipboard operation
Snap.swift copied to clipboard

UITraitCollection support

Open piercifani opened this issue 7 years ago • 1 comments
trafficstars

When writing layout code, you should rely on the view/viewController's traitCollection instead of just the frame of the view.

However, when executing the snapshot tests for a device, the traitCollection during the test execution is the same as the current simulator, which is not ideal when using expect(view).toMatchSnapshot(for: .allDevices) since an invalid collection is passed here.

We should either notify this in the documentation or (preferably) override the traitCollection of the UIView using override trait collection

piercifani avatar Mar 17 '18 11:03 piercifani

hey sorry for not answering before, I've been a little off, I'm checking now into making a better version but I don't understand the issue, could you provide more information or maybe opening a PR?

Thanks!!

skyweb07 avatar Sep 19 '18 17:09 skyweb07