Category Archives: Swift

Swift issues and solutions

Embedding custom Cocoa views with xibs into frameworks

Ever thought of defining a custom Cocoa class (inheriting from NSView or a descendant), associate it with a xib to be able to define its UI with xCode designer, and then put everything into a framework that you could reuse … Continue reading

Posted in macOS | Tagged , , , , , | Leave a comment

“Local” git repo remote on iCloud

Disappointingly, Apple doesn’t (yet?) have cloud based git repo hosting (and it seems even xCode server which previously could have allowed teams to host repos on macOS Server doesn’t offer this anymore, either – maybe awaiting for code integration features … Continue reading

Posted in iOS, macOS, Swift | Tagged , , , , , , , | 1 Comment

Asynchronously awaiting for Swift await

Async-await pattern that is now common in many modern programming languages (having been introduced by C# a few years ago) is unfortunately not yet available in Swift. While it was proposed for implementation, it has not (yet) been identified as a … Continue reading

Posted in Swift | Tagged , , , , , | Leave a comment

Swift events

Swift does not have built-in .NET-like events. (I admit, I was used to have them in C#, although implementing the weak pattern in .NET was not the easiest job either.) Instead, in Swift there are two common patterns that developers (and even Apple) … Continue reading

Posted in Swift | Tagged , , , , , | 1 Comment

Swift selectors and number of arguments

In Swift, you can create and “perform” a #selector like below (e.g. in an iOS app) and it seems to work just fine (i.e. executes the “selected” function): class Obj1 : NSObject {     var value: String?     … Continue reading

Posted in iOS, macOS, Swift | Tagged , , , , , | Leave a comment