Anybody know how to do that?
Search results for
swiftui
16,623 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Does this help? https://stackoverflow.com/questions/56784722/swiftui-send-emailI'd be interested in your code once you figure it out.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Error Domain=render service Code=12 Rendering service was interrupted UserInfo={NSLocalizedDescription=Rendering service was interrupted}Also, I use the MacOS Catalina beta 4
Could you detail the context of this error ? On which XCode operation ?What is the code that causes error ?Could this help ?https://stackoverflow.com/questions/56773951/crash-on-canvas-swiftui
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Going through some learning materials on SwiftUI, I'm trying to wrap a view inside a NavigationLink but it appears unresolved.struct LandmarkList: View { var body: some View { NavigationView { List(landmarkData) { landmark in NavigationLink(destination: LandmarkDetail()) { LandmarkRow(landmark: landmark) } }.navigationBarTitle(Text(Landmarks)) } } }This is the error I get:Use of unresolved identifier 'NavigationLink'; did you mean 'NavigationView'?
I've actually made progress on this, but my current problem is how do I ask for calendar event permission from with a SwiftUI view? The alert will not be shown.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I am trying to convert the UI an App of mine to SwiftUI.My app displays an UITableView, where the cells have the propertyUITableViewCell.AccessoryType.detailDisclosureButtonThat means: An information button and a disclosure (chevron) control are displayed on every row.Pressing the button shows Information about the cell Data (modal)Pressing the chevron pushes a Detail-View onto the NavigationView-Stack and displays it.How do I achieve this behavior using SwiftUI?
Which version of XCode ?I do not see any deprecation information.Seems you followed exactly this tutorialh ttps://developer.apple.com/tutorials/swiftui/building-lists-and-navigationDid you check your import ?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Xcode 11b4 is telling me that SwiftUI's relativeWidth property for views is deprecated, but it shows up in a LOT of documentation as if it's still in use.I do this app thing as a part-time hobby, and I'm so excited for SwiftUI's potential, and I know that it's beta, but it seems like having the beta docs synched with the beta SDK would make the learning process a tiny bit less frustrating.
I can't get past the same. Got XCode 11.0 beta 2. According to doc NavigationLink is a part of SwiftUI, no additional imports needed 😟
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Hi,I'm working on a app with a List as my main view. Previously I was using a TableViewController to present content. I wanted to know if there is a way to have reusable rows in List to make it more optimized like reusable cells, because this app is loading a lot of rows from an API (list of users and posts) which can be infinite as the user scrolls in the view. I'm currently doing it this way:import SwiftUI struct TimelineView : View { // The custom class containing users and posts @ObjectBinding var timeline: Timeline var body: some View { List { // Show users Section(header: Text(timeline_section_users)) { ForEach(timeline.userObjects) { user in // The view for a user UserView(user: user) } } // Show posts Section(header: Text(timeline_section_posts)) { ForEach(timeline.postObjects) { post in // The view for a post PostView(post: post) } } // Load more Section { Text(Loading...).onAppear() { // When this text appears, we call the API for more content self.timeline.loadContent() } } } .listStyle(.g
Hi,I am experimenting with SwiftUI and Combine after watching https://developer.apple.com/videos/play/wwdc2019/226/ ( Data Flow Through SwiftUI ).So I created a Publisher to load some data via network call, something like this:var countriesPublisher: AnyPublisher<[Country], Never> = { let urlSession = URLSession.shared let url = URL(string: https://www.ralfebert.de/examples/countries.json)! return urlSession .dataTaskPublisher(for: url) .map { $0.data } .decode(type: [Country].self, decoder: JSONDecoder()) .assertNoFailure() // todo: no error handling right now .receive(on: RunLoop.main) .eraseToAnyPublisher() }()And I want to use this in a SwiftUI view. Now the WWDC talk recommended to use @State to hold the data, subscribe to it via onReceive and copy it to the internal state. This works, f.e.:struct CountriesListView: View { @State var countries = [Country]() var body: some View { List(countries) { country in Text(country.name) } .onReceive(countriesPublisher) { countries i
I added @EnvironmentObject to a property in a SwiftUI view as part of the official tutorial Adding User Interaction and added the .environmentObject modifier to the preview. However, I get the error:Cannot preview in this file - MyApp.app may have crashedThis error now appears in every SwiftUI project, even ones without EnvironmentObject or a blank SwiftUI template, so I cannot use previews. I have tried rebooting several times, and made sure the command line tools are set to Xcode 11. How can I fix this? Thanks!
Did you do an option-clean-build Folder in XCode ?Did you read the release notes of XCode 11.4:SwiftUI Tutorials Known IssuesAfter following Section 7, Step 7 in the Building Lists and Navigation tutorial in Xcode, you might encounter an error in your projectʼs SceneDelegate.swift file. (51334559)Workaround: Update line 14 of SceneDelegate.swift to use LandmarkList instead of LandmarkDetail:window.rootViewController = UIHostingController(rootView: LandmarkList())After following Section 5, Step 3 in the Handling User Input tutorial in Xcode, you might encounter an error in the preview provider. (51341785)Workaround: Undo the change to the LandmarkDetail initializer, so that you only add the environmentObject(_:) modifier:struct LandmarkDetail_Preview: PreviewProvider { static var previews: some View { LandmarkDetail(landmark: landmarkData[0]) .environmentObject(UserData()) } }
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: