Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Weather App with Swift (Retired) Data Modeling With Structures Customizing Dates

Billy Chan
Billy Chan
4,527 Points

Hi there, I've been experiencing problems compiling my bit of code for the second part of this quiz.

I receive a "Bummer! Your code can't be compiled" error from the online compiler; however, when I preview the output, I see no errors. Furthermore, when I paste the block of code into an Xcode Playground, I also receive no error and everything compiles. What's going on?

date_formatter.swift
import Foundation
let secondsSinceBirth = NSTimeInterval(1200000000)
var dateOfBirth = NSDate(timeIntervalSince1970: secondsSinceBirth)

let dateFormatter = NSDateFormatter()
dateFormatter.timeStyle = .ShortStyle
dateFormatter.dateStyle = .MediumStyle

var stringDate = dateFormatter.stringFromDate(dateOfBirth)

2 Answers

We are working on a solution to this right now. We should it have in place in the next 2 hours. Sorry for the trouble.

The fix is live. Happy learning!

Billy Chan
Billy Chan
4,527 Points

Great! Just tested this and can confirm everything is fixed. Thank you!

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Most likely what happened is your code is fine but not exactly what the challenge is looking for. I'm sorry I can't help, I don't know Swift. I did find this post on the forum though.