I wonder where can I find source of ShapeEdit app mentioned in the WWDC 2020 SwiftUI videos. All I can find is old ShapeEdit.
Search results for
[tags:wwdc20-10057]
16 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is it posible to enable reordering of elements in an OutlineGroup? I'm looking for something like ForEach.onMove(perform:) that works with a tree like structure.
Given a NSManagedObject like below: public class Folder: NSManagedObject, Identifiable { t@NSManaged public var name: String t@NSManaged public var position: Int16 t@NSManaged public var parentFolder: Folder? t@NSManaged public var folders: Set<Folder> } I'd like to use the new OutlineGroup to build an outline view of the folder structure using a FetchRequest. struct FolderView { @FetchRequest(entity: Folder.entity(), tttttttsortDescriptors: [NSSortDescriptor(keyPath: Folder.position, ascending: true)]) var folders: FetchResults<Folder> tvar body: some View { ttOutlineGroup(folders, children: .folders) { folder in tttLabel(folder.name, systemImage: folder.fill) t} But this doesn't compile, with the following error: Key path value type 'Set<Folder>' cannot be converted to contextual type 'FetchedResults<Folder>?' Any idea? As a bonus, the children should also be ordered by the position (because it's a Set, it's unordered)…
Hi. Curt used some shortcut to wrap codes into curly braces In WWDC20-10031 Stacks, Grids, and Outlines in SwiftUI talk around 11:07. I find it super usefull. Do anybody have an idea what the shortcut is? Thanks.
In Stacks, Grids, and Outlines in SwiftUI - https://developer.apple.com/videos/play/wwdc2020/10031, a recommendation is made to only use lazy stacks when you encounter performance bottlenecks. To quote the session, starting at 4:43: On the other hand, making the stacks within a given hero view lazy doesn't actually confer any benefits. The content is all visible at once, as soon as the view lands on screen. So everything has to be loaded at once, regardless of the container's default behavior. If you aren't sure which stack to use, use VStack or HStack. Adopt lazy stacks as a way to resolve performance bottlenecks that you find after profiling with Instruments. Are there negatives, performance or otherwise, to just always use lazy stacks? I'd like to understand why I shouldn't reach for LazyVStack and LazyHStack first. I understand from the example that using a lazy stack wouldn't confer any benefits, but would we incur any negatives?
I tried to replicate the code as shown in Stacks, Grids, and Outlines in SwiftUI - https://developer.apple.com/videos/play/wwdc2020/10031/ (12:35). They make it feel like it's a very easy thing to do. Just insert a Section and as you could see in the video it will immediately become a collapsable view. Add a header to the section and it will get the bolder text style. I wasn't able to replicate this. xCode Version 12.0 beta (12A6159) Below you can find the code I used. The expected result would be nicely styled, collapsable section headers. The actual result is a non-collapsable section with a weird underline under the name and no arrow. let model: Model = Model() @State private var selection: Set<String> = [] var body: some View { NavigationView { List(selection: $selection) { ForEach(model.canvases) { canvas in Section(header: Text(canvas.name)) { OutlineGroup(canvas.graphics, children: .children) { graphic in Label(graphic.name, systemImage: graphic.icon) } } } } .listStyle(SidebarListStyle()) .navig
Currently the new addition to list has a children: {keypath} to react to child > parent state, I am unable to find a expanded state binding for list with outline support. How can I restore the expanded state in List with OutlineSupport? Will this support be added?
At wwdc20 session 10031, it’s mentioned that: ‘“To learn more about how best to show data in your app, you can download the code for Shape Edit from developer.apple.com. “ Where is the source code for the app? thanks
Can't find source for the 'Shape Edit' example as described in the 'Stacks, Grids, and Outlines in SwiftUI' video.
At the very end of the Stacks, Grids, and Outlines in SwiftUI talk we're told we Experiment with the code for ShapeEdit on the last slide and the presenter says we can download the code for ShapeEdit from developer.apple.com. However I cannot see a link to download on the video's page https://developer.apple.com/wwdc20/10031 , and I cannot see it on the sample code page on the developer site. Would someone at Apple be able to upload this code? Or if it's already available can anyone here show me where to download? many thanks!
How do you select items in a grid view ? There appears to be no equivalent to List(selection:)
Hi! One of my main frustrations with SwiftUI last WWDC was the apparent lack of a View allowing for multiple selections. This year's Stacks, Grids and Outlines in SwiftUI Session even shows a brief snippet with @Binding private var selection: Set<String> which would indicate the possibility of multiple selections with a Picker view in SwiftUI. However the sample code for the app presented there is not available... In short: how should one use Picker or go about creating another view which would allow multiple selections? To stay in the Sandwiches theme of this year's apps: how would one create a Picker allowing selection of multiple ingredients from a list?
Hi Is there a way to enable (multi) selection in a List with sidebar style? Is there a way to enable external keyboard interaction in iPad to perform the selection as in the UIKit counterpart? Thanks
A few of us were discussing the advice for when to use Lazy Stacks in this session, specifically where Cody Brimhall said the following: So it's worth asking, since I made my outer stack lazy, should these stacks be lazy too? In this case, the answer is no. While I want the vertical stack to be lazy specifically because it scrolls, I don't want to spend the time it takes to render everything upfront when most of the content can't be seen without scrolling. On the other hand, making the stacks within a given hero view lazy doesn't actually confer any benefits. The content is all visible at once as soon as the view lands on screen, so everything has to be loaded at once regardless of the container's default behavior. As a rule, if you aren't sure which type of stack to use, use VStack or HStack. Adopt lazy stacks as a way to resolve performance bottlenecks that you find after profiling with instruments. The earlier advice seems to suggest that using a Lazy Stack in a ScrollView is preferred. That rule of thumb
Is there a way for a view to span multiple columns or rows when using LazyVGrid or LazyHGrid? I'm trying to make a calendar and would like to have a row that is the month and year label. I've tried using several LazyVGrid in a LazyVStack, but the scrolling performance seemed pretty poor, so I'm trying to see if I can make a single LazyVGrid work.