Post

Replies

Boosts

Views

Activity

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
Reply to How To Position Controls With SwiftUI
I personally find that placing precisely objects is a critical limit (or constraint) with SwiftUI. What I do (sometimes with mixed results) is to group objects in separate Views (red-bordered in the image). It makes it easier to position objects (with HStack / VStack) in each view and then position the views. Hope that helps.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25