Q:

How to code date of birth range to cause an action?

I am trying to build a zodiac sign app for class. I am using a UIDatePicker and an UIImageView to display the image once the user picks a date (date range, say if the date of birth is between a certain date). The zodiac will be revealed in text and also the image appears. So far I have my user interface and all the images ready, but I am not sure how to go with the main code for it to function properly. 
var zodiac = ["Aqurius", "Pisces", ...]

override func viewDidLoad() {
    zodiacSign.text  = zodiac[0]
}

A:

Add an @IBAction by ctrl-dragging from your UIDatePicker in Interface Builder to your view controller.
@IBAction func datePickerChanged(sender: AnyObject) {

  let date = datePicker.date
  // configure your labels and images according to date
}

