Chris Eidhof

@chriseidhof
11 Followers
212 Following
37 Posts
Building stuff at objc.io
Personalhttps://chris.eidhof.nl
Workhttps://www.objc.io
@dlx ¿what would this look like in Spain?
@mackuba @krzyzanowskim very aware of that :). There are some new APIs, but the question was about targeting iOS 14.
@mackuba @krzyzanowskim I know this probably doesn’t come from a bad place but I literally get this feedback almost every time I help anyone!
@nomeata danke für ttttool, mein Kind wächst zweisprachig auf und so kann ich ihr auch Niederländische Bücher und Spiele anbieten :)
@Alexbbrown @krzyzanowskim the overlay takes on the reported size of the text. You might enjoy this Swift Talk collection: https://talk.objc.io/collections/swiftui-layout-explained
Swift Talk Collection: SwiftUI Layout Explained

We explain SwiftUI's layout system by re-implementing parts of it from scratch. We start with the basic view protocols and implement fixed and flexible frames, alignment, stacks and much more.

@Alexbbrown @krzyzanowskim yes, the fixedSize makes sure we measure something that's independent of whatever it was proposed. The frame both proposes that width as well as makes sure the entire button becomes that width.
@Migueldeicaza @krzyzanowskim that's very kind of you, just trying to help! Merry Christmas!
@Alexbbrown @krzyzanowskim the feedback loop is broken because we're proposing nil using fixedSize.
@helge @krzyzanowskim those only help for positioning, not for sizing.
@krzyzanowskim the key problem is that the layout system is top-down, and you cannot size yourself according to siblings. So some parent is responsible to make them the same width (based on their individual widths!). This is the simplest way I know of doing this that's backwards-compatible (you could abstract this further btw). https://gist.github.com/chriseidhof/51076f16b6725ff8b17f99cc656d17be
maxwidth.swift

GitHub Gist: instantly share code, notes, and snippets.

Gist