Adrian

1.8K posts

Adrian banner
Adrian

Adrian

@DevAndArtist_

I develop mainly in Swift. https://t.co/SuzJNPeicN

Germany Katılım Kasım 2013
23 Takip Edilen122 Takipçiler
Adrian
Adrian@DevAndArtist_·
@chriseidhof this helped me a lot in understanding the layout process of SwiftUI's views. One great discovery was that I was able to identify a significant bug in the original framework, which I reported and Apple already fixed (view dimensions caching bug).
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@chriseidhof here is my HStackLayout: github.com/UndefinedAlgor… The actual algorithm was based on what @DaveAbrahams could tell me. There are 3 steps to determine the flexibility. 2 parts are cached. Propose 0 and infinity on the main axis, the last step is the remaining space.
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@chriseidhof just found the HStack related blog post on objc.io. I did re-implement a huge chunk of SwiftUI's layout system including alignment APIs, which does support custom alignment keys just like the original. However for stacks I'm missing layout priority.
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@natfriedman Is there a mobile app roadmap somewhere? I‘m highly interested when projects will be in the queue.
English
0
0
0
0
Nat Friedman
Nat Friedman@natfriedman·
Our mobile elves have been hard at work crafting powerful new code review features for the GitHub apps. Pretty amazing what you can do from your phone now. (Note: these are middle-earth elves, not Keebler elves. No disrespect to Keebler – great cookies!)
GitHub@github

We’ve updated GitHub for mobile! Now code review is even easier, faster, and more productive – turn off line wrapping, leave multi-line comments, and more. Download at github.com/mobile

English
6
15
162
0
Adrian
Adrian@DevAndArtist_·
@bzamayo @_inside Not even iOS is ready. iPadOS will make speakers on iPad Pro 2018 start produce random crackling noise. (I think it‘s a HW design flaw which got patched with iOS back in days after initial release, but iPadOS 14 broke this again.) It‘s my second unit with that issue.
English
0
0
0
0
Benjamin Mayo
Benjamin Mayo@bzamayo·
iOS 14 tomorrow. I’m not ready. No one is ready.
English
17
142
981
0
Adrian
Adrian@DevAndArtist_·
@phausler Result: Am I nothing to you?
English
0
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab One nit about the article. Drop the VStack in your honey grid and rephrase the paragraph. Stacks cannot and will never underflow its children. That would completely break their behavior. The overflowing happens with `frame` modifier, not the VStack.
English
0
0
0
0
The SwiftUI Lab
The SwiftUI Lab@SwiftUILab·
Did you know you can build a honeycomb with LazyVStack and little effort? New article "Impossible Grids with SwiftUI" is out now. I cover grid basics first, and then we take it one step further. The honeycomb is just one example. Enjoy! 🐝 #iosDev #SwiftUI swiftui-lab.com/impossible-gri…
English
11
37
305
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab Sorry it took me days to come back to this. I will check your example later and compare it to mine which behaved differently. 🧐
English
0
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab Just today I tried nesting scroll views and used a lazy stack. The scroll position is lost on reappearance. Yesterday I managed to keep a hosting controller alive, however its root view‘s state will have a band new state due to the issue that the hierarchy was detached.
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab Are you sure about the state restoration part of lazy api‘s? In general everything that is removed and readded will start with a brand new state. Try using a scroll view or an active animation in a lazy cell or remove/readd it, it won‘t keep the active state.
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@chriseidhof @state @ObservedObject What do you mean I shouldn‘t? Not every object should be observable and represent some kind of state. This totally the case at the `App` level, or would you want to create fileprivate singletons instead?
English
1
0
0
0
Chris Eidhof (back for a bit)
Here's a first draft of a decision tree for how to define your SwiftUI properties...
Chris Eidhof (back for a bit) tweet media
English
27
340
1.9K
0
Adrian
Adrian@DevAndArtist_·
@chriseidhof @state @ObservedObject State’s wrappedValue is still mutable and the PW will re-create your object as it wasn‘t designed to be lazy like StateObject. Instead use StateObject and let the object have `let objectWillChange = Empty<Never, Never>(…: false)` to indicate that it won‘t send any signals.
English
1
0
0
0
Chris Eidhof (back for a bit)
This is a simplification, there are many exceptions: for example, you could use a regular property or even @State for objects (instead of @ObservedObject) but then you won't be notified of changes.
English
1
1
12
0
Adrian
Adrian@DevAndArtist_·
@chriseidhof @jckarter Small nitpick: the `view` part can be generalized because we now have `App`, `Scene` and what not in WidgetKit.
English
0
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab Nothings seems to have changed there. I‘ll send you a gist with my workaround if you want to look at it (possibly for you next article, unless you‘re already done with it 😅).
English
1
0
0
0
The SwiftUI Lab
The SwiftUI Lab@SwiftUILab·
@DevAndArtist_ Yes, gestures were a little messy last year. I haven't look at them this year yet. 😬
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab I mean, I build a workaround using pure SwiftUI, but there is a small bug which requires the `isTracking` state. However gestures are a nightmare in SeiftUI. The order of gestures, their combinations, etc. all things matter and produce other results.
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab Here is also a possible challenge for your article, which I couldn’t crack: There seems to be no way to create/observe states like `isTracking` and/or `isDecelerating` for the scroll view. I really need to build a custom picker that always centers, but I can’t. 😭
English
1
0
0
0
Adrian
Adrian@DevAndArtist_·
@SwiftUILab LazyHStack is interesting but it‘s type shadowing and clarly should be an anti-pattern. I‘d rather give it a different name or a small prefix.
English
1
0
1
0
The SwiftUI Lab
The SwiftUI Lab@SwiftUILab·
Hi, here’s a new post about how to handle backward compatibility in SwiftUI to avoid plaguing your code with “available” checks. We’ll also explore how to combine the new App protocol and the old UIApplicationMain in the same app. swiftui-lab.com/backward-compa… #iOSDev #SwiftUI
The SwiftUI Lab tweet media
English
9
31
224
0