Wednesday, July 1, 2026
HomeiOS Developmentios - SnapshotTesting provides random high padding for SwiftUI views

ios – SnapshotTesting provides random high padding for SwiftUI views

[ad_1]

I am attempting to put in writing some Snapshot checks utilizing SnapshotTesting for my SwiftUI views. If I take advantage of

.picture(format: .gadget(config: .iPhone8Plus))

my view will get an additional padding on the high as proven within the first picture. That is utilizing an M1 Mac with Xcode on Rosetta. The humorous factor is, that when the identical code runs on Bitrise CI, it does not add the padding which makes the checks fail on CI.

Alternatively if I take advantage of:

.picture(format: .fastened(width: 375, top: 750))

my view does not get any pointless padding, and all the things works superb on native Xcode and Bitrise CI.

Has anybody ever come throughout such a problem? And if sure, is there a repair that permits us to maintain utilizing gadget configs.

Fixed size
iPhone 8 Plus

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments