Search results for

swiftui

16,583 results found

Post

Replies

Boosts

Views

Activity

Reply to How can I add an image and text to a tab bar item with TabbedView?
It's under SwiftUI Known IssuesThe tabItemLabel(_:) modifier doesn’t accept @ViewBuilder closures. Workaround: Wrap the views you pass to the modifier in a VStack: MyView().tabItemLabel(VStack { Image(resourceName) Text(Item) }) Source : https://developer.apple.com/documentation/ios_ipados_release_notes/ios_ipados_13_beta_2_release_notes.tabItemLabel(VStack { Image(ic_zoom_out) Text(Item) }).tag(2)It's working for me using Local Image Assets but not with SF Symbols.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
Reply to Core Data Model SwiftUI
The framework is a mix of Microsoft's MVVM and Facebook's DOM-based React framework.- Based on the recommended approach (XCode Preview session), you should not mutate the Core-Data Entity.- Instead, the bindings to the ViewModel triggers update of the UI.- This also makes sure that your UI is dependent on design time ViewModel (and not run time core-data)= Better testing, better preview support, better maintenance.The big unknown is how performant SwiftUI will be in the real word
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
SwiftUI Preview on HDD
Has anyone successfully used SwiftUI previews on a machine with a mechanical disk drive?Both the first and second betas of Xcode have been unable to generate previews on this installation.Results are any of a variety of errors, extraordinarily long compile times, inability to launch the simulator, a kernel panic or being logged out.An unmodified project created using the Xcode single-view template simply doesn't work.The experience is akin to using an ill-behaved Desk Accessory in System 7 :-(It's unclear whether the problem is with Xcode itself or the Catalina installation.Wondering if anyone has been through this and resolved the problem?
5
0
2.2k
Jun ’19
Reply to Style a List
From Session 216 SwiftUI Essentials:A List add its ownPrimitive Views (Like the Divider between different rows)Just our List, ForEach takes a Collection of Data an a View Builder that map each Data Item in is own View, but unlike List ForEach doesn't add any Visual Effect on its own, so if you use ForEach you must provide a Divider if you want it.Divider()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
Using print()
I am trying to get myself going with swiftUI. I was playing with the code below and trying to get the print() to work to see some variables during runtime in the preview window. Unfortunately it won't run once I add the print(), I get an Expected Declaration flag. Any info on using print() would be great as I have spent a few hours wondering around Google looking for answers with no luck so far.import SwiftUI struct ContentView : View { @State var username: String = let word1 = Username let word2 = Password print() var body: some View { VStack(alignment: .leading) { Text(Login) .font(.title) .multilineTextAlignment(.center) .lineLimit(nil) Text(Please) .font(.subheadline) HStack(alignment: .center, spacing: 10) { Text(Username: ) TextField($username, placeholder: Text(type something here...)) .textFieldStyle(.roundedBorder) } HStack(alignment: .center, spacing: 10) { Text(Password: ) TextField($username, placeholder: Text(type something here...)) .textFieldStyle(.roundedBorder) } }.padding(
5
0
6.8k
Jun ’19
Reply to Is SwiftUI backwards compatible with iOS 12 and below?
As long as SwiftUI remains annotated to iOS 13 only, there is no incentive for app developers to:- Mix in SwiftUI views with existing apps- Beta test new SwiftUI apps that can only be distributed by TestFlight to users that install iOS 13 public beta- Use SwiftUI at all if a new app's intended audience must include older iOS devices (such as banking apps)I can understand the reasoning why SwiftUI is currently iOS 13 only, but I do not understand why there is not even a statement of intent that this will change in the upcoming months. The only hint might be that there were demonstrations at WWDC of how SwiftUI can coexist with apps that have existing storyboards. Forward compatibility alone is not good enough. SwiftUI will be adopted by the developer community much more rapidly if and when it is announced to be backward compatible.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
How to get and set SwiftUI List scroll position?
Just getting started with SwiftUI. Exciting stuff.I understand that List would be one of the main building blocks that I can use in place of UI/NSTableView. One thing I haven’t seen yet: how to get and set the scroll position? Specifically, my list would consist of “read” and “unread” items. When the user first enters the list, everything is unread, so the list can start at the top. As new items scroll into view, they become “read”. When the user now leaves the list, and later returns, the list should scroll to the first “unread” item. So I am not so much interested in the pixel-level scroll offset, but rather, how do I scroll the viewport into the right location so that the user would see the desired info. The API could be something like “scroll the list such that model object X is visible in the middle” (with or without animation).The read/unread state is easily expressible as a model object property. I’m having trouble with how to bind it to the list scrolling in this new declarative world of ours
13
0
19k
Jun ’19
SwiftUI Tutorial - the case of the missing row
I'm working through the Handling User Input tutorial, which I am assuming many of you have done as well.If I preview LandmarkList immediately after Section 2, Step 3 with showFavoritesOnly set to true, I get a blank cell when showFavoritesOnly is set to true.After completing Section 3, Step 1 -- with the iteration through landmarkData being driven by the ForEach, this problem resolves itself -- the blank cell is no longer visible when showFavoritesOnly is set to true.Can someone please explain why this extra blank cell is showing up?
0
0
461
Jun ’19
Splitview in SwiftUI
Hello,Does anybody know how to create a splitview in SwiftUI for the iPad?I mean a view like Settings, left the options and right the details.If I use HSplitView(), I got the error: 'HSplitView' is unavailable in iOS.VSplitView() got the same error.Kind Regards,Kitty
12
0
16k
Jun ’19
Reply to How to make a resizable HSplitView for macOS?
Assuming that you want to use the Master-Details pattern, I think that Approach should be to use Navigation Controls and not use the List (as list will require using binding and glue-code to display Details: this is a lot of work for a basic UI pattern, way too complex).The Master-details pattern, on WWDC slides uses Navigation controls:https://developer.apple.com/videos/play/wwdc2019/216/ at 55:10 and slide 278 onwards.The issue appers to be that Mac implemention of SwitUI is pretty buggy and thus Navigation is not available. I am pretty sure that Developers at Apple are getting beaten eveyday to fix SwiftUI (fill the the gap between over-promised and under-delivered features). I am skeptical that it Mac SwitUI will be even ready for September Release.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19