Search results for

swiftui

16,580 results found

Post

Replies

Boosts

Views

Activity

SwiftUI Tutorial EditMode
In section 2 of Working with UI Controls the instructions state to add `@Environment(.editMode) var mode` to the `ProfileHost` view and use that binding to show either the profile summary or the profile editor:if self.mode?.value == .inactive { ProfileSummary(profile: profile) } else { Text(Profile Editor) }When previewing the canvas in live mode it seems the `mode` variable is always nil and thus it never shows the profile editor. Tapping the edit button seems to have no effect.
6
0
7.0k
Jun ’19
Reply to How do I implement a WebView (WebKit) in SwiftUI?
You can wrap views with `UIViewRepresentable`:// // WebView.swift // Todos // // Created by Bradley Hilton on 6/5/19. // Copyright © 2019 Brad Hilton. All rights reserved. // import SwiftUI import WebKit struct WebView : UIViewRepresentable { let request: URLRequest func makeUIView(context: Context) -> WKWebView { return WKWebView() } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } } #if DEBUG struct WebView_Previews : PreviewProvider { static var previews: some View { WebView(request: URLRequest(url: URL(string: https://www.apple.com)!)) } } #endif
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
XCode11 Beta canvas not visible
I followed the instructions in this tutorial. https://developer.apple.com/tutorials/swiftui/creating-and-combining-viewsMy problem is that i cannot see the canvas to press resume. I can run the code on the simulator, but the canvas does not show up. Even after switching to Editor only and back to Editor & Canvas. Where do i go wrong?Secondly XCode11 generates a if DEBUG block around the second block of code in ContentView.swift. This is different in the tutorial.Like:#if DEBUGstruct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() }}#endifI am using XCode11 Beta M11336w on an iMac2017 with Mojave with all normal updates installed.
2
0
1.4k
Jun ’19
MacBook Pro Retina 2012 in 2019?
Will live preview in SwiftUI and the Xcode 11 works on MacBook Pro Retina 2012 perfectly well? The MacBook Pro 2012 still great in 2019? I'm thinking about buying me one. I have a low budget and I need a MacBook Pro that will work for 3-5 years from now, being me a ”Pro” user.
12
0
6.9k
Jun ’19
Reply to MacBook Pro Retina 2012 in 2019?
I am typing this from a mid-2012 retina MBP which is running Catalina and Xcode 11 just fine. SwiftUI previews take a few seconds to come up, but work great.My one concern is that you mention wanting it to work 3–5 years from now. While it might still be suitable for general use then (my mom, for example, gets by running the latest version of MS Office on High Sierra on a mid-2010 MBP), it may not support the latest versions of the operating system or Xcode at that time. As you may be aware, mid-2012 is the oldest MacBook Pro that can officially run macOS Catalina, so I would expect support to be dropped in some subsequent release.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’19
Reply to SwiftUI Collection View
I thought the same ... i'm interested in the thread.Maybe SwiftUI is still very very, very, young and does not offer this capability out of the box and in the first iteration we will require to wrap an UICollectionView from UIKit, same as MapView tutorial. The same will apply to other components like PageControl if I'm not wrong, i don't see it.Probably very soon will start to come out 3rd parties views as libraries. It would be super easy to use them as new, more evoluted, building blocks and than in future Apple will absorbe them in newer version of SwiftUI proposing their enhanced variant.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19
Reply to SwiftUI Collection View
You're right.Regarding using PageControl with SwiftUI, there is a tutorial on it (Interfacing with UIKit).However, collection views are such a widely used component accoss all Apple platforms that it would be useful to have it out of the box. I understand it may be much harder to implement than List, because of how much versatile it can be, but I really hope it will be added in the future.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19