Post

Replies

Boosts

Views

Activity

Reply to Sufficient mac for Xcode web app development project
Depends on how large the web app is. If this is the only development you plan, you could get a try, even though you will face hurdles from time to time. More generally, I have found by experience: 16 GB are really necessary if you have mid or large size projects 1 TB of storage is really a minimum Processing power is not the issue screen size is important to work efficiently with Xcode. 13" is probably too small, except to start learning, but you can later attach an external monitor. And finally, MacBookAir 2020 will not support new OS versions (and hence new Xcode) for a long time.
Sep ’25
Reply to How di
The reason here: self.xaxis.text is an optional (may be nil). So you have to address it with the nil coalescing operator var xoutput = self.xaxis.text ?? "0" Which is equivalent to: var xoutput : String if self.xaxis.text != nil { xoutput = self.xaxis.text! } else { xoutput = "0" } or a bit more compact: var xoutput = "0" if self.xaxis.text != nil { xoutput = self.xaxis.text! } For more on this: https://www.hackingwithswift.com/example-code/language/what-is-the-nil-coalescing-operator Note that in the example print("Hello, \(name ?? "Anonymous")!") the final ! is not for unwrapping, it is just an exclamation point to be printed at the end of text. If you were sure it cannot be nil, you could also unwrap directly, but that is really risky. var xoutput = self.xaxis.text! Once you are sure that string is a string, not an optional, you can pass it to Double() to convert String to Double. But here again, if the content is not a number (eg: "abc", Double will return nil. And in all cases it returns an optional. So here again, use the nil coalescing operator to unwrap (transform optional to a real value) safely.
Sep ’25
Reply to UIStepper can't reach min/max value
I checked and got the same behaviour, in 18.4 and 26.0. It may well be an intended behaviour. In fact, with the 18.4 behaviour, once you reach 0.7 and then step up, you get 1.2 and not the original value of 1.0. Which may cause problem as it may be hard to find back this 1.0 value. So effectively, we have now to implement it in code. Problem is that down stepper is disabled when you hit 1.0. 2 possible workarounds: set stepper behaviour as wrap (not ideal) set minimum to 0.5 and manually adjust in IBAction to limit to 0.7: if value < 0.7, set to 0.7 if value is between 1.1 and 1.3 (0.7 + 0.5 when you step up back from 0.7), set to 1.0 Not ideal, but I've not found a better way.
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’25
Reply to How di
What error message do you get ? Where ? During compilation or execution ? But you declare xoutput as a String (a text) var xoutput = self.xaxis.text and later use it in a computation. distance = velocityi * 0.1 + (1/2) * xoutput * pow(0.1, 2) You should try;: var xoutput = Double(self.xaxis.text) ?? 0.0 In addition, you repeat while x == 1 { } As x never change, this will repeat infinetely. Is it what you want ?
Sep ’25
Reply to Looking for advice on app architecture
I agree that SwiftUI is not the best to develop complex Mac apps. I have developed some, but they are iOS looking, not MacOS. So, for complex apps, I do prefer AppKit. I wonder if an app like Excel could be developed fully with SwiftUI. IMHO, no. But I would be pleased to be proved wrong.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to Looking for advice on app architecture
I agree that SwiftUI is not the best to develop complex Mac apps. I have developed some, but they are iOS looking, not MacOS. So, for complex apps, I do prefer AppKit. I wonder if an app like Excel could be developed fully with SwiftUI. IMHO, no. But I would be pleased to be proved wrong.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to Looking for advice on app architecture
I agree that SwiftUI is not the best to develop complex Mac apps. I have developed some, but they are iOS looking, not MacOS. So, for complex apps, I do prefer AppKit. I wonder if an app like Excel could be developed fully with SwiftUI. IMHO, no. But I would be pleased to be proved wrong.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to Looking for advice on app architecture
I've been able to develop pretty complex apps for Mac in SwiftUI, but in fact it is more iOS looking than genuine Mac app. In particular, I do not try to use menus. SwiftUI is great to rapidly develop an app (noting that full fledge Mac App with AppKit is pretty complex). But for sophisticated apps, I feel AppKit much more suited. I wonder if Excel could be developed fully in SwifUI. IMHO, I don't think so.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to How To Position Controls With SwiftUI
You can position the views with position modifier. And if you want to position relative to screen width for instance, use screenSize @State var screenSize : CGSize = CGSize(width: 1200, height: 800) // Will be computed in .onAppear .onAppear { screenSize = CGSize(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) When you need to position, in the middle .position(x: screenSize.width / 2, y: 50) If you have to adapt to view resize: .readSize { newSize in screenSize = newSize }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to Using private API
I'm not Apple engineer, but my understanding is that private API may change without notice. Hence, if you use in your app, what worked in an OS version may crash with the next release. That's bad for user and for reputation of iOS / MacOS.
Topic: UI Frameworks SubTopic: General
Sep ’25