Post

Replies

Boosts

Views

Activity

Comment on Does Swift has a string builder class?
Sure, it does not equate. But each language has its own optimisations relative to Strings handling (and there are many). Are you sure that those other languages do not create an interim String when using appendFormat ? In anycase, form developer point of view, creating an intermediate String is not an issue (unless I missed something).
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Comment on Array drop
You're welcome, the forum is precisely for this. What is misleading is that drop is not "drop where" but "drop while". The expanded form makes it clearer: let newarr = arr.drop (while: { exc.contains($0) } )
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Comment on Array drop
You're welcome, the forum is precisely for this. What is misleading is that drop is not "drop where" but "drop while". The expended form makes it clearer: let newarr = arr.drop (while: { exc.contains($0) } )
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Comment on On/Off Button Title in updateUI()
I get an X Expected Expression next to it.: could you show a screenshot with the error ? I read ∞@main. Is it what you typed or just an error in the post ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on Is Macbook air m1 base version-8gb ram,256gb ssd enough?
OK, if you have no huge file, nor video editing, your configuration should work. But try to imagine what you want to do 3 years from now… Have a good day.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on Any way to get array by reference?
thanks for feedback. But bizarre, I see the 2 answers to your question.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on How to run a higher version of xcode on a lower version of iOS
How did you set the deployment targets ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on A question about Swift enum syntax
OK, you were referring to allCases, not the case declaration
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Get row index when user click a button in NSTableCellView
Thanks for feedback. It should work with very similar approach for AppKit.Just replace UITableViewCell by NSTableCellView and use row(for view: NSView)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Type 'User' does not conform to protocol 'Decodable'
@Scott it seems convertFromSnakeCase and underscores are incompatible. Removing any o the 2 solves the issue. As exposed in Apple documentation, with convertFromSnakeCase, fee_fi_fo_fum converts to: feeFiFoFum: underscores are removed and replace by following uppercase.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on View won't update in ForEach loop
Thanks for the feedback. Don’t forget to close the thread by marking the correct answer.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Inconsistent behavior in invoking a Swift method from a different class?
Could you post a complete minimal project to replicate the issue ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Does Swift has a string builder class?
Sure, it does not equate. But each language has its own optimisations relative to Strings handling (and there are many). Are you sure that those other languages do not create an interim String when using appendFormat ? In anycase, form developer point of view, creating an intermediate String is not an issue (unless I missed something).
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on JSONEncoder with dictionary of objects?
This is another interesting way to do it: https://stackoverflow.com/questions/48297263/how-to-use-any-in-codable-type
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Mystery Inverted Bool
Question in fact: why do you even need Dispatch ? If I understand your code, you are alre in the main queue. So try remove a y Dispatch call.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Alpha Value of UIButton set in a storyboard is reset on Light/Dark Mode Transition
That may be interesting to share code.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Array drop
You're welcome, the forum is precisely for this. What is misleading is that drop is not "drop where" but "drop while". The expanded form makes it clearer: let newarr = arr.drop (while: { exc.contains($0) } )
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Array drop
You're welcome, the forum is precisely for this. What is misleading is that drop is not "drop where" but "drop while". The expended form makes it clearer: let newarr = arr.drop (while: { exc.contains($0) } )
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23