Articles tagged 'swift'

Page 2 of 3

Understanding the RunLoop model by creating a basic shell Oct 1 2019

When we find ourselves listening for events, reacting to those events, and then going back to listening for more events, we have ourselves an Event-Loop. Having an event-loop is a common scenario. So common that Apple decided to provide us with a model...

Read More...

Using BSD Sockets in Swift Sep 24 2019

Apple provides many useful network frameworks. Network.framework (you can check my previous article on Network.framework if you want to see an example) is the latest. But sometimes we need to go deeper, and the abstractions might get in the way. In...

Read More...

Understanding Objective-C and Swift interoperability Sep 16 2019

There are many reasons to use more than one programming language in a project. In some cases, a lot of work has gone into building a framework (years maybe). Rewriting the whole framework to have the codebase in the same programming language, might...

Read More...

Building a server-client application using Apple's Network Framework Sep 10 2019

Apple's network APIs are many, the older APIs are well documented, and you'll find lots of examples. Not so much about the new Network framework. One factor might be that the name is not that search-friendly. In this post, I'll explain how to use the...

Read More...

Understanding a few concepts of macOS applications by building an agent-based (menu bar) app Sep 3 2019

With advances in the frameworks and tools we use to develop software, creating a new app seems like magic. We just click a few buttons, and everything is created for us. I enjoy magic, but I think that sometimes we end up being Framework "users" without...

Read More...

Using Xcode's visual debugger and Instruments' modules to prevent memory overuse Aug 27 2019

An essential step before you deliver your application to your users is to make sure that your app is not overusing your user's resources. In this post, I'll show how to use Xcode's visual debugger and the command-line counterparts to check for common...

Read More...

Understanding XCUITest screenshots and how to access them Aug 20 2019

Getting the screenshots of your app doesn't need to be complicated, and it shouldn't require you to install additional applications to do it. Sure you can use any other third-party library, but sometimes simple is better. Also, it is always fun to...

Read More...

Solutions to common scenarios when using UITextField on iOS Aug 5 2019

At some point on your app development career, you'll find yourself working with text fields to get some data from the user. Collecting data from the user sometimes involves additional work than merely reading text from an UITextField. For example,...

Read More...

Building a CLI tool using Swift and Vapor's Console module Jul 30 2019

Building a command-line interface (CLI) tools is a complicated task. We work on the logic of our application and also have to deal with other details like parsing parameters, handling the correct display directives depending on the TTY, etcetera. Vapor...

Read More...

Using Swift for scripting Jul 23 2019

Swift is a powerful language. It can be used to create command-line tools, iOS apps, watch OS apps, macOS apps and server-side applications. However, sometimes, we only need to complete a small task, maybe do some automation on our local setup or build...

Read More...

Sharing information between iOS app and an extension Jul 16 2019

If you decided to create an Extension for your app (maybe a Today Extension), you will quickly find out that you need to access data from your main app. And soon after, you will find out that you can't access files in your main app directly from the...

Read More...

Text extraction tools for macOS and iOS app localization Jul 10 2019

Localization is not only translating content but adapting the content to culture, language and customs. This makes our apps more intuitive and engaging for our users. We can localize not only text, but we can also localize images, sounds, shortcuts...

Read More...