Posts

Post marked as solved
5 Replies
5.3k Views
I've been trying to make and view an @IBDesignable view in Interface Builder, but unfortunately with little success.When I select the view in my Storyboard, the Custom Class inspector shows the Designables: highlight as "updating", without any changes regardless of my actions.I've done a clean build and build, and the build compiles with no warnings.When I run the code in the simulator, I'm able to see the resulting visual code and there's no warnings or errors, but it doesn't appear to be showing up in the Interface Builder.I've tried removing the DerivedData and then restarting my laptop and Xcode to clear any ephemeral issues, to no effect.I have "Automatically Refresh Views" disabled at the moment - I've tried it both enabled and disabled, with no effect.When I attempt to select the view and choose Editor -> Debug Selected Views, the status spinner at the top of XCode shows "Preparing to debug instance of "GridColorSelectionView" - and an error is reported in Xcode:The specific PID changes with the attempts, but the error code is consistent. I've looked in ~/Library/Logs/DiagnosticReports/, but not seen anything that would give me a hint of what might be failing.Is there something I'm missing, a setting or something - or does anyone have a suggestion on how I might be able to debug this issue?I'm not conversant enough to know if this is an issue with something I've done (or am doing), or if it's a candidate for a bug report on Xcode.- This is with the latest Xcode - Version 10.2 (10E125), running on MacOS 10.14.4 (18E226)
Posted
by heckj.
Last updated
.
Post not yet marked as solved
0 Replies
744 Views
I'm trying to capture snapshots as a visual validation of the state of a view in my UI tests. The work that I want to capture is after an async view is loaded (currently an embedded MapKit view). I'm wondering if there's a way that I can expose a marker when the Map has completed its loading and rendering to UIApplication() through the usability system, even if it's something I intentionally expose up from the app with my own code that isn't done by default. Right now I'm waiting on a Link to show up with: UIApplication().links["Legal"].waitForExistence(timeout: 2) as Map is currently exposing a link to legal from within itself after the rendering is set up, but that's a detailed side effect of MapKit specifically. For other views that my code loads asynchronously, can I do something to expose an event or callback book that I can react to within the UIApplication() structure to know that relevant background processing has completed, or is observing for UIElements to exist in some form the only exposed way of getting this kind of information?
Posted
by heckj.
Last updated
.
Post not yet marked as solved
1 Replies
724 Views
Each of the tag pages says that's related to a specific thing - the whole point of the tag. Quite number of recent tags are for WWDC sessions, which is awesome. However, those tag pages - while they list the WWDC session - don't provide any linked way of getting back to that session or its details. For example, the tag page: https://developer.apple.com/forums/tags/wwdc20-10091 burns up this huge visual space with a description of the session, but nothing in that content provide an actual *link* to the content: https://developer.apple.com/videos/play/wwdc2020/10091 The whole WWDC+Forums thing would be hugely improved by not treating these as separate resources, but allowing or encouraging them to intermix, and just adding a single active link from the tag page header to the session itself would be a good start.
Posted
by heckj.
Last updated
.
Post marked as solved
2 Replies
766 Views
I love what I'm seeing about MX*Diagnostic (MXCrashDiagnostic - https://developer.apple.com/documentation/metrickit/mxcrashdiagnostic and friends) and the capability to use it to track down crashes and issues. What I'd like to know is if there's a way I can trigger the diagnostic output deterministically at the end of the CI-driven integration test so that I can build in a scan for these and harvest them to help identify regressions. Without such na mechanism, am I left having to leave the device (or simulator) running for a huge amount of time and hope for the best? I want to use this specifically with CI, which may have multiple runs per day - and would like to identify which runs of code were aligned without something akin to a "spend a day testing this single iteration of the code" kind of constraint.
Posted
by heckj.
Last updated
.
Post not yet marked as solved
1 Replies
593 Views
There are a lot of articles and questions already on the forums from the past years - but which didn't include tags since they weren't part of the system earlier. However, I can still see my past articles - so it would be nice if I could go back and retroactively tag those articles. Then, perhaps, there's be at least ONE article related to Combine in the forums... and with a great answer from Quinn that really helped me.
Posted
by heckj.
Last updated
.
Post marked as solved
2 Replies
1.7k Views
I'm working with Combine in Xcode 11 beta 3 and IOS 13 beta 3, and I'm hitting an odd compiler error. I'm not sure if I'm not specifying something sufficiently or completely, or if this is a error with the swift compiler not being able to correctly infer what it needs to know.I have a UIImageView reference, and I'm making my code is a Combine pipeline that retrieves a URL to populate that imageview and then (tries to use) assign to set it into place.The short form of this code (full code at https://github.com/heckj/swiftui-notes/blob/master/UIKit-Combine/ViewController.swift#L167-L231):URLSession.shared.dataTaskPublisher(for: URL(string: firstUser.avatar_url)!) // ^^ this hands back (Data, response) objects .handleEvents(receiveSubscription: { _ in DispatchQueue.main.async { self.activityIndicator.startAnimating() } }, receiveCompletion: { _ in DispatchQueue.main.async { self.activityIndicator.stopAnimating() } }, receiveCancel: { DispatchQueue.main.async { self.activityIndicator.stopAnimating() } }) .map { $0.data } // ^^ pare down to just the Data object .map { UIImage(data: $0)!} // ^^ convert Data into a UIImage with its initializer .subscribe(on: self.myBackgroundQueue) // ^^ do this work on a background Queue so we don't ***** // with the UI responsiveness .catch { err in return Just(UIImage()) } .receive(on: RunLoop.main) // ^^ and then switch to receive and process the data on the main // queue since we're messin with the UI .assign(to: \.image, on: self.githubAvatarImageView)This sequence of code results in the compiler error:/Users/heckj/src/swiftui-notes/UIKit-Combine/ViewController.swift:166:26: error: type of expression is ambiguous without more context .assign(to: \.image, on: self.githubAvatarImageView) ^~~~~~~If I instead use sink subscriber, then it applies just fine: .sink(receiveValue: { image in self.githubAvatarImageView.image = image })Is there something I should be doing to make the express less ambiguous, or a means to writing this a different form of constructing the keypath that would resolve this?
Posted
by heckj.
Last updated
.