Q:

Cannot use instance member 'month' within property initializer; property initializers run before 'self' is available

I am trying to create a 3 or 4 digit integer variable based on the date. So, if the date were March 4th, the number would be 304, and if the date were November 11th, the number would be 1111. However, whenever I try to do it I receive the error on the last line of code: "Cannot use instance member 'month' within property initializer; property initializers run before 'self' is available". How do I fix this?
let day = Calendar.current.component(.day, from: Date())
let month = Calendar.current.component(.month, from: Date())
var todaysDate = month*100+day

A:

You need to do something like below, right now swift compiler doesn't allow this. May be in future it will be more intelligent do the heavy lifting.
class ABC {
    let day = Calendar.current.component(.day, from: Date())
    let month = Calendar.current.component(.month, from: Date())
    var todaysDate: Int

    init() {
        todaysDate = month*100+day
    }
}

