Saturday, July 2, 2022
HomeiOS Developmentios - SnapshotTesting provides random high padding for SwiftUI views

ios – SnapshotTesting provides random high padding for SwiftUI views


I am attempting to write down some Snapshot assessments utilizing SnapshotTesting for my SwiftUI views. If I exploit

.picture(format: .machine(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 assessments fail on CI.

Alternatively if I exploit:

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

my view does not get any pointless padding, and the whole lot works wonderful on native Xcode and Bitrise CI.

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

Fixed size
iPhone 8 Plus

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments