Search results for

swiftui

16,607 results found

Post

Replies

Boosts

Views

Activity

Reply to Simulator says "Lost connection to background transfer service"
I am getting this same issue - everything has been a barrier during this development.First the WatchOS SwiftUI would not layout correctly in Beta 1 and would throw the layout with even a Apple Sign In button, and some pods would cause a Error Trap 6 warning and never run!Now all that is fixed this issue is happening! `Error Domain=NSURLErrorDomain Code=-1005 The network connection was lost. UserInfo={NSErrorFailingURLStringKey=https://`Completely blocked for another 2 weeks?!
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’19
SwiftUI on different devices
Hi all, I just finished watching all the WWDC sessions on SwiftUI, and I'm super excited to get started working with it. Before starting my first SwiftUI app though, I realized they never really showed how to build for multiple devices in the WWDC sessions. Does anyone know the best practice for this? Essentially what I'm asking is lets say I want to build the Landmarks app they demoed. I want to build macOS, tvOS, and iOS versions. How would I develop this app to use similar source code for all platforms? Would I write all the platform files in one Xcode project or separate? If in one, how do you decide which one to build and preview in Xcode at a certain time? And most importantly how do you tell App Store Connect which file is associated with which platform? Any help is appreciated. Thanks
2
0
1.8k
Jul ’19
Sequential animation?
Is sequential animation possible in SwiftUI? As in do animation 1, when finished do animation 2, etc.I understand that SwiftUI is basically UI based off state, so if I could just get a notification when my an animation ends or if be able to tack on a closure to an animation to be called when an animation ends, I feel like I could set up my sequential animation. I'm not seeing any way to do either of these things though, anyone have any luck in this area?
2
0
907
Jul ’19
Reply to List updates very slowly and blocks UI
Sorry, I don't have much useful to say other than me too.I have a similar situation — a list of 5009 items, and a filter box. Filtering to 2752 items takes up to about 30s, and filtering the 2752 down to 17 takes nearly as long. Filtering 17 to 9 is instantaneous. Filtering back up again is equally slow.Instruments shows the vast majority of the time is spent in CollectionChanges.formChanges<A, B>(from:to:) in SwiftUI, but that doesn't give me a lot of hints as to how to speed it up. I tried cutting down the collection passed to List down to just IDs, but that made no appreciable difference.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’19
Using Combine, SwiftUI and Multipeer Networking
Hi,I'm just getting into using Combine with SwiftUI to update state. I have a test app I'm using to build a UI around Multipeer Networking. My Swift is a little rusty currently.Here's some code to show the context of my problem...Here's my controller object that for now handles the session, browser and advertiser. It's a BindableObject using a PassthroughSubject as Publisher.class PeerDatasource: NSObject, BindableObject, MCSessionDelegate, MCNearbyServiceBrowserDelegate, MCNearbyServiceAdvertiserDelegate { typealias PublisherType = PassthroughSubject var didChange = PassthroughSubject<Void, Never>() private var session: MCSession? var peers: [MCPeerID] { if let session = self.session { return session.connectedPeers } return [MCPeerID]() } var browser: MCNearbyServiceBrowser? var advertiser: MCNearbyServiceAdvertiser? //rest of class... }Upon a peer changing state I call didChange like so...func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) { DispatchQueu
2
0
1.4k
Jul ’19
Reply to List updates very slowly and blocks UI
I take a guess here… as SwiftUI is trying to find out which elements of the collection have been changed, it compares the existing elements with the changed list. It looks like the scaling behavior is pretty exponential here, and this process should have a lot opportunity for optimization.Until then, it might help to enforce a reload of the list instead of using a dynamic binding.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’19
application(open: options:) not being called
Any idea if SwiftUI prevents applications from responding to further calls to application() after an app is up and running? I've a custom document type registered for an iOS test app, and 'opening' the document brings the app into focus as expected, but application(open:options:) never recieves a call to open the document. I'm unsure if there's some new security method in play (google and rtfm have revealed nothing so far), or if SwiftUI apps just never recieve/process that call. --Mike
2
0
1.6k
Jul ’19
Reply to TabbedView with Images under macOS
Given the vertiable dearth of documentation on SwiftUI (yeah, a little sarcasm lol), and a bit of testing, I'm going to 'assume' that the tabItem modifier only accepts the first 'View' passed to it. Passing additional views of any type seems to have no results, even if they are built in a seperate struct and passed in as a single view. I didn't test using my own 'viewbuilder' however. Going to follow this to see what I can learn from others though.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’19
Reply to class implementing View and bindings
I don't think you'll be able to access State variables as members of a class (even though I think internally there's 'no difference'). Maybe file a bug since you're technically accessing the variable inside the body and getting a thrown error. Out of curiosity, what activity makes a class easier than a struct for describing a SwiftUI view? I've ran into more than a few things where I've fallen back on appkit or uikit and wrapped classes in a representable view, but haven't ran into any task yet outside of incorporating other kit code that requires a class. I only ask because I'm pretty new to Swift in general, so I'm learning how much I don't know yet, and i'm curious. I've 20 years of coding in c++ and java (work related), but I'm curious what I don't know here lol.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’19
Reply to SwiftUI viewWithTag
The 'swiftui'-ish way to do it, would be to declare a state variable, use the contents of that variable for your text field, and modify the contents of that variable from the list (possibly by embedding your List items in 'buttons' and utilizing their 'action's. As far as directly referencing the field, assign it to a variable. Then you can reference it directly in code. let myTextField = textField()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’19
Swiftui list row with multiple buttons?
Can one get multiple buttons to work when included in a List row?This problem can be seen in the completed version of the Apple tutorial. There, the HikeDetail or HikeView each work when previewed by itself - one can select different graphs by the Elevation, Heart Rate, and Pace buttons. However, this view does not work properly when it is included in the ProfileSummary List(). When tapping on one of the buttons, the view collapses. This is because all buttons are activated, rather than just the one tapped.It seems that List() is deciding that if it sees a button in the row, it will change multiple behaviors: 1) The button is no longer tinted - if one uses a simple button, it is tinted outside of a List. (Note: The tutorial is playing with colors to show blue/gray - even in the List view). 2) The button no longer flashes when pressed/tapped. 3) A tap in the row activates the actions of all buttons included in that row.I can understand that this might be the desired behavior to make the simplest row - when onl
22
0
28k
Jul ’19