Problem I got a 2D grid (n x n matrix). The user selects his player in this 2D grid and […]
Category: Swift
NSLog-like logging framework for iOS
Problem I am writing a logging framework for iOS. The idea is to create a behavior similar to NSLog to […]
Implementing the Hashable Protocol in Swift with the DJB hash function
Problem A while back I made a custom String struct (see github repo) because of the difficulties in dealing with […]
Quickselect algorithm in Swift
Problem I recently answered a question on Stack Overflow about finding the k-largest element in an array, and present my […]
Pure Swift solution for socket programming
Problem I have spend quite some time now to find out how exactly to do socket programming in Swift (Xcode […]
Custom caching class in Swift
Problem I’m using Swift 4.0 and I’m using UserDefaults in my project for storing Strings like login or something. I […]
Asynchronous Array.map
Problem I put together an asynchronous map function for Swift’s Array using Grand Central Dispatch. It’s called with a transform […]
Music player in Swift
Problem I made a simple mp3 player that plays, pauses and stops a given song, shows the time elapsed, and […]
iOS Swift 3 app that requests data from the Stack Exchange API
Problem This is my first Swift app, so I want to improve everything that I can about my code and […]
Prevent a UITextField from being input with aphabetic characters
Problem The goal is to disallow typing alphabetic characters as input in a UITextField. Please tell me if this approach […]