Post

Replies

Boosts

Views

Activity

Reply to Limit available app languages
I have my app localized for many languages, but I'd like to limit the available app languages to only a subset of those, because the content is not ready for all of them. So in fact the app is not yet localised in those languages. A better practice would be to only add a language when it is readily available. And release a new version. Did I miss something ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Thread 1: signal SIGINT
Some code formatting with formatter (<>) tool will make it easier to read: languageLabels = (MyFunctions.getValue(key: Utils.languageLabelsKey) as! NSDictionary  if i print the a value from the key without using get i.e   languageLabels!.get(key)   print("my labes \(languageLabels[key])")  I get my labes Optional(Done) but when I get using .get  let lngValue = languageLabels!.get(key)  program stop in debug and I have to click continue program execution for the app to continue launching languagesLabels is not nil Could you show get function in MyFunctions There is probably an error there. and how you declared in Utils languageLabelsKey
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How to find physical size of UI element?
You can get the real screen size (in points or pixels): https://stackoverflow.com/questions/4779221/in-iphone-app-how-to-detect-the-screen-resolution-of-the-device And knowing the screen resolution (in points or pixels), you know the physical pixel / point size. Then knowing the size of elements, you know the fraction of screen it is. Hence you can compute its physical size. Or adjust the size (in points) of UI element as needed.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to A question about use 'lowerThan' when I learning 'precedencegroup'
I try the example, but the 'Range' and 'Comparative' show error: Unknown precedence group Names of groups may have changed to: RangeFormationPrecedence ComparisonPrecedence And this compiles: precedencegroup Additive { higherThan: RangeFormationPrecedence, Equivalence } precedencegroup Multiplicative { higherThan: Additive } // module A precedencegroup Equivalence { higherThan: ComparisonPrecedence // lowerThan: Additive // possible, because Additive lies in another module } infix operator ~ : Equivalence Which confirms what you say about the issue with lowerThan. I don't understand the reason why they need to be in different modules to allow lowerThan. And documentation is really minimal on this. Could be worth a bug report on documentation.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to I’m new
Could you explain more what you want to do ? what is main device ? An iPhone, iPad, Mac ? What is the other device ? Cant you use AirDrop to transfer data ? You tagged Interface builder ? Do you want to transfer day between 2 ViewControllers ?
Aug ’21
Reply to Animate a macOS window
Use NSAnimation. For instance, if you want to animate when clicking a button: @IBAction func startAnimation(_ sender: NSButton) { let fixedDuration = 5.0 // set duration as you want, in seconds NSAnimationContext.runAnimationGroup( { (context) in context.duration = fixedDuration             self.view.window?.animator().setFrame(CGRect(x: 0, y: 0, width: 200, height: 200), display: true, animate: true) }) }
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21