SOLVED: Help With Error: "No Exact Matches In Call To Initializer"

Hello, wise and kind people! Mostly total Swift/SwiftUI noob here (have some python experience - very different!), though I've worked through Paul's SwiftUI iDine tutorial. Wanting to level up my skills through practice, and build myself a simple practice app, but can't seem to solve the above, fairly opaque, error. I'm trying to build a simple calendar date object overlaying a date on a photo, and just set (for the moment) the date overlay to today's date. Styling not done yet, obvi. Here's my code, in the SwiftUI view object. What am I doing wrong? Have tried various versions of return types, various places declaring the function, and trying various unwrapping/coalescing options at the various declarations/assignments and can't seem to find anything that works. Thank you!

struct CalendarDay: View { var body: some View { ZStack() { Image(systemName: "photo") .resizable() .aspectRatio(contentMode: .fit) .background(Color.gray) .foregroundColor(Color.black) .cornerRadius(40) Text(getTodayDate()) .font(.headline) } } func getTodayDate() -> Any? { let now = Date() let calendar = Calendar.current let components = calendar.dateComponents([.day], from: now) return components.day } } struct CalendarDay_Previews: PreviewProvider { static var previews: some View { CalendarDay() } }

Tag » App Storage No Exact Matches In Call To Initializer