Date Format

  The following tables are for a developer’s reference, to show the Date Format in Swift 4.   Using dateStyle and timeStyle properties let formatter = DateFormatter() formatter.dateStyle = .full formatter.timeStyle = .full let dateString = formatter.string(from: Date()) Tuesday, October 30, 2018 at 9:48:38 PM Pacific Daylight Time     Using format strings let formatter = … Continue reading “Date Format”

Remainder Operator

Basic Operators in Swift Addition (+) Subtraction (-) Multiplication (*) Division (/)  Remainder Operator (%)     (similar to the Mod or Modulo operator in some other languages) The Remainder Operator Here is a brief explanation of the remainder operator (%) as it works in the Swift language, quoted from Swift’s website: The remainder operator (a % … Continue reading “Remainder Operator”