Category Archives: Swift

Swift issues and solutions

Drag gesture recognizer for iOS development (with initial touch location)

As everybody knows, when using a mouse on a computer a drag operation occurs when the mouse button is pressed, then the device is moved, and eventually the button is released. It’s a continuous and precise operation. In iOS we have … Continue reading

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

Testing Swift deinit

As you probably know, Swift uses ARC for memory management (presumably to improve performance over classic garbage collection based systems). That means it is very important that you do use weak (or unowned) references whenever cycles could form. For example, when you implement … Continue reading

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

Swift impressions

After about one year of (intermittently) learning Swift and recently also using the language in a (hopefully) real project, I can conclude that it is very powerful, yet clean, easy to read and understand (that is important!), and does an exceptional job on preventing human errors … Continue reading

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

Why I love Swift protocol extensions

Let’s develop a small framework, allowing client developers to use working schedule objects. Each schedule would be based on an interval of days: from a start day to a finish day (specified by numbers). Optionally, client developers may configure specific … Continue reading

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

Embedding custom Cocoa macOS 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 , , , , , | 1 Comment