Tag Archives: swift

How not to generate deterministic random numbers in Swift

Deterministic and random are opposites but sometimes we want a way to generate and reproduce the same sequence of random numbers when a program is run. Swift language is now more than 8 years in the making but still does … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Basic File I/O in Swift

In this post we learn how to do basic file I/O in Swift. We will create a file and write some text to it. All code here is w.r.t. Swift 5.7.2. First we need to import Foundation: Then we create … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Basic 2D Drawing in Swift

It’s quite hard to find any Swift examples on the web. It took me hours to write a simple program that draws a rectangle in Swift and saves it to a file. 50% of the code that comes up in … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Getting Started with Swift

I decided to use some holidays I had to learn the Swift programming language. Below are the steps I followed to get started (and some gotchas I ran into) which is often the hardest part. I did not want to … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Swift vs. C# Performance

I am always a sucker for performance. Recently I migrated a .NET GDI+ app to Swift. There were several reasons for it: To my surprise the C# code runs way faster than Swift. The difference is not because of GDI+ … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment