iOS 14 has Changed (or broken?) SwiftUI GeometryReader

前端 未结 2 1060
醉梦人生
醉梦人生 2021-01-02 11:25

As of today\'s release of iOS 14.0 my iOS code, which depends heavily on GeometryReader for layout, is no longer working well. I.e, layout has been kind of randomized.

2条回答
  •  自闭症患者
    2021-01-02 12:04

    Editing my previous answer as its now obviously bad advice

    From https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

    Rebuilding against the iOS 14, macOS 11, watchOS 7, and tvOS 14 SDKs changes uses of GeometryReader to reliably top-leading align the views inside the GeometryReader. This was the previous behavior, except when it wasn’t possible to detect a single static view inside the GeometryReader. (59722992) (FB7597816)

    Which says, to me at least, that the previous behaviour was buggy by their standards - despite it matching the conventions for other layout containers like VStack. And that this behaviour is the new normal.

提交回复
热议问题