Measuring function execution time

This is a very quick one. For an app I’m working on I wanted to measure how long it took a given function to complete.  I typically don’t do this, as most functions are very fast, but this one involved a server fetch and some background processing. Anyhow, I’m getting distracted, here it is -easy […]

Get Date Day, Month or Year in Swift 3.0

Just a quick update to show how to get Date Day, Month or Year in Swift 3 //Here I’m creating the calendar instance that we will operate with: let calendar = NSCalendar.init(calendarIdentifier: NSCalendar.Identifier.gregorian)         //Now asking the calendar what month are we in today’s date: let currentMonthInt = (calendar?.component(NSCalendar.Unit.month, from: Date()))!           //Now […]