Post

Replies

Boosts

Views

Activity

Reply to Coalescing @Published changes?
Thanks for showing the additional code. But unfortunately, your code contains some unknown things: OrderedSet, IncomingMessage, Message, ChatMessageCell. Someone would be able to help you with the currently shown info, but I cannot. Hope your issue would be solved soon. Good luck.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to How do I properly use class variables?
 I'm trying to avoid the use of a global variable, as that's a poor solution, Please do not forget, using too many class variable is as poor as, or poorer than using a global variable. but I'm starting to wonder if Swift supports the concept of these class variables in the same way that other languages I've used do. What sort of languages are you accustomed? You can write something like this: class Foo { private static var _a: String = "" class var a: String { set { self._a = newValue } get { return self._a } } } class Bar: Foo { func printit() { print(Foo.a) } } Foo.a = "abc" let someBar = Bar() someBar.printit() But not sure if this is what you want.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Required content for platform tvOS simulator is missing. Please reinstall Xcode.
My internet connection is slow. I don't want to download 11 GB Xcode. Could someone help me? Better find a good place where you can use broadband internet. The recent Xcode works with tight communications with Apple's servers. You will meet many other messages and cannot run or distribute your app unless you do things in the right way. Generally, installing Xcode through More Download pages - https://developer.apple.com/download/more/ may work in a little less stable communications environment, but you need to download 11GB Xcode and many more hidden components.
May ’21
Reply to Page Switching
Writing an initialization code of Views in Button actions does not make sense. Write a code to show other views using NavigationLink or sheet or something else, and change the @State variable for it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to iPhone IDE
maybe someone can think about developing one. Unfortunately, there are many agreements or contracts between Apple and us developers. So, most developers believe that third party developers cannot develop a fully functional IDE on iPhone or iPad. You can write a feature request to Apple using the Feedback Assistant - https://developer.apple.com/bug-reporting/. You may already know and may not think it as a fully functional development tool, but Swift Playgrounds is a good tool to learn programming in Swift.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Configuring MIDiSysexSendRequest (Data types)
MIDICompletionProc is a typealias of a closure type, as shown in the doc - https://developer.apple.com/documentation/coremidi/midicompletionproc. typealias MIDICompletionProc = (UnsafeMutablePointerMIDISysexSendRequest) - Void You may need to pass a global function or a closure of @convention(c). completionRefCon is any type of pointer which points to some stable address while MIDI process is running. Or it can be nil. So, for example, you can write something like this: // Define a global function, somewhere outside any classes func handleMIDISysexSendRequestCompletion(_ request: UnsafeMutablePointerMIDISysexSendRequest) { //... } class SomeClass { //... func someFunc(...) { //... var request = MIDISysexSendRequest( destination: endPoint, data: dataPointer, bytesToSend: dataSize, complete: isComplete, reserved: (0,0,0), completionProc: handleMIDISysexSendRequestCompletion, completionRefCon: nil ) let result = MIDISendSysex(&request) print(result) //... } }
Topic: Programming Languages SubTopic: Swift Tags:
May ’21