title: Set a datestyle in Swift
body: <p>I want to set a datestyle in Swift.
  I've already done this in Objective-c, this is the objective-c code.</p>
  
  <pre><code>NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
  
  [dateFormatter setDateStyle:(NSDateFormatterMediumStyle)];
  
  NSDateFormatter *timeFormatter = [[NSDateFormatter alloc]init];
  
  [timeFormatter setDateFormat:@"h:mm a"];
  
  NSString *fireDate = [dateFormatter stringFromDate:notification.fireDate];
  NSString *fireTime = [timeFormatter stringFromDate:notification.fireDate];
  NSString *dateTime = [NSString stringWithFormat:@"%@ - %@", fireDate, fireTime];
  </code></pre>
  
  <p>Now I want this in swift. I already come up with this: </p>
  
  <pre><code>var dateFormatter = NSDateFormatter()
  var timeFormatter = NSDateFormatter()
  
  timeFormatter.dateFormat = "h:mm a"
  //code to set date style.....
  var fireDate: NSString = dateFormatter.stringFromDate(notification.fireDate)
  var fireTime: NSString = timeFormatter.stringFromDate(notification.fireDate)
  var dateTime: NSString = "\(fireDate) - \(fireTime)"
  </code></pre>
  
  <p>But I can't figure out how to set the date style in Swift. With <code>NSDateFormatterMediumStyle</code></p>