My App had no such warnings before updating to 13.3, but now it claims I'm updating from a background thread. A simple print will make these warnings stop, so something is wrong:
@MainActor private func runOnMain(_ action: @escaping () async -> ()) async {
//print("", terminator: "")
await action()
}
simply uncommenting that print() makes all the warnings go away, so I think 13.3 has an issue here... Is anyone else seeing this?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When an Array has an Element type that is an optional, I'd like to count the non-nil elems. Is there a way to do this with just a var? How can I say that Element is an Optional<T>, without introducing T via the generic func? Thanx.
extension Array {
func someCount<T>() -> Int where Element == Optional<T> {
self.reduce(0) { count, elem in count + (elem == nil ? 0 : 1)
}
}
I've upgraded to 10.2 and now when I try to commit, Xcode says "No author information was supplied by the version control system". There is an option to "Fix", which takes me to preferences, where I added my name -- but still no success.How do I get git to work again on 10.2?
I have a multiplatform project in Xcode 13.3.1, but when I try to run a unit by clicking the diamond in the gutter, the linker fails. From the link line in the log, it looks as if it isn't even linking with my app at all.
I also noticed that I had to put in my own
@testable import NameOfMyApp
instead of Xcode generating that line like it does for single-platform projects, so that makes me wonder if this something extra i need to do since this project is multiplatform?
Everything compiles fine, but the linker seems to be forgeting to link with my app...
If i have a struct inside a function, swift keeps telling me is doesn't conform to Comparable, even though the same definition is fine outside of a function -- why is this?
Foo fails Comparable here:
func foo() {
struct Foo : Equatable, Comparable {
let x: Int
let y: Int
static func (lhs: Foo, rhs: Foo) - Bool {
return lhs.x+lhs.y rhs.x+rhs.y
}
}
}
My app is working as expected in the simulator on iOS 12.1, but not on my iOS 11.x device, and it is just a layout issue. I'm not aware of any major changes in layout constraints from 11 to 12, so I'm perplexed... I upgraded an older device from iOS 10 to 12 and my app layout works on it, so it seems something changed between iOS 11 and 12 regarding layout, but I don't know what that is...How can I get a simulator running iOS 11.x to debug? I'll start debugging on my actual 11.x device, but I would also like to know how to get a simulator running older iOS versions? xcodebuild -showsdks says I only have 12.1 iphone/simulator 12.1 -- how do I run 11.x in the simulator, or older iOS versions in general in the simulator?