I am very new to swift and I wanted to know about how to set a variable or constant to a specific type
I had some problems with just adding
var myVar = Date()
can anyone help
>Solution :
welcome to stackoverflow
To set a constant or variable to a specific type, use this.
Variables:
var currentDate:Date = Date()
Constants:
let currentDate:Date = Date()
you need to add that colon and then the type