The following code compiles ok in one function:
let stop:UnsafeMutablePointerObjCBool
stop.initialize(to: false)
text.enumerateAttribute(kStyleKey,
in: NSRange(location: 0, length: text.string.count),
options: []) { (value, range, stop) in
but the following code which is virtually the same fails the initialise with the error "Constant 'stop' being used before being initialised" :
let stop:UnsafeMutablePointerObjCBool
stop.initialize(to: false)
attributedText.enumerateAttribute(kStyleKey,
in: NSRange(location: selectedRange.location, length: selectedRange.length),
options: []) { (value, range, stop) in
Any suggestions - looks like a compiler issue to me.
Post
Replies
Boosts
Views
Activity
I have been trying to compile and run an example App embedded in a Swift package, but failed. I have extracted the app and tried building it but it can't find the package and nothing I do fixes it. Can someone please let me into the secret.
For no apparent reason the po command has stopped working. It simply produces no output, no errors, nowt! I haven't changed Xcode (I am using v12 beta 3 for new work and v12.2 for production. Both are failing. The problem began today with v12.2 while I was working with the Test App. I've tried a clean build, restarting Xcode and rebooting. I've even tried it on a production app with the same results.
So, at this point in time I am scuppered. Any suggestions most welcome.
I have been developing a SwiftUI app for about a year now. From the early days the UI had EditButtons working OK. These stopped working when Xcode 12 came along. I reported this to the Feedback assistant, but have a had no reply. The issue is still there in the latest release candidate 12.2 beta 4. The code below is the test app I sent to Apple. It works if you remove .navigationViewStyle (in this test app, but not in my app). If anyone thinks I have made a mistake and that the issue is down to me, please let me know, otherwise if anyone from Apple is reading this please fix it. It seems rather fundamental to me.
import SwiftUI
struct ContentView: View {
@State private var myArray: [String] = ["One", "Two", "Three"]
var body: some View {
NavigationView {
VStack {
List {
ForEach(myArray, id: \.self) { item in
Text(item)
}
.onDelete { indexSet in
myArray.remove(atOffsets: indexSet)
}
}
}
.navigationBarTitle("Navigation")
.navigationBarItems(trailing: EditButton())
}.navigationViewStyle(StackNavigationViewStyle())
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
I have a .toolbar modifier that contains ToolbarItems. The compiler is failing with 'ToolbarItem' is only available in iOS 14.0 or newer'. I have Xcode 12 beta 2 installed, the deployment target set to iOS 14 and a simulator running ios14. This looks like a beta version error. Has anyone else encountered it?
I have a UIView embedded in a UIViewRepresentable. I need this view to be movable and resizable. I can get it to move, but not resize, inasmuch as its frame size changes, but it isn't redrawn at the new size. I need some way for the view to communicate the size change to its SwiftUI container and for that to redraw it. Any suggestions?
I just upgraded to 10.15.6 beta 3 then straight away I'm offered 10.16! There is no 10.16 on the dev website. When I try installing it says it needs another 7Gb. There is already 53Gb available, so what is going on here? I've also read that 10.16 is actually Bug Sur beta masquerading as Catalina and I haven't elected to beta test Big Sur so, again, what is going on?
Can anyone let me know where I can get the document paper size details on IOS independently of a print activity?
Is it possible to use a Coredata persistent file via UIManagedDocument in a DocumentGroup. This can be done via DocumentBrowserViewController using UIKit. It would be great if that’s possible.