     // MARK: - Internal properties
     
     let title = UILabel()
+    let segmentedContainer = UIView()
     let segmentedControl = UISegmentedControl(items: [NSLocalizedString("Date", comment: "Title for date in segmented control"), NSLocalizedString("Time", comment: "Title for time in segmented control")])
     let datePicker = UIDatePicker()
     let removeDateBorder = UIView()


import UIKit

@IBDesignable open class DateChooser: UIView {
    
    // MARK: - IB Inspectable properties

    // MARK: - Internal functions
    
    func updateDatePicker() {
        guard computedCapabilities.contains(.dateAndTimeSeparate) else { return }
        datePicker.datePickerMode = segmentedControl.selectedSegmentIndex == 0 ? .date : .time
        datePicker.minuteInterval = minuteInterval
    }
    
    func dateChanged() {
        updateDate()
        delegate?.dateChanged(to: datePicker.date)
    }
    
    func removeDate() {
        datePicker.date = Date()
        title.text = nil
        delegate?.dateChanged(to: nil)
    }
    
    func setDateToCurrent() {
        let now = Date()
        datePicker.date = now
        updateDate()
        delegate?.dateChanged(to: now)
    }
    
    func saveChanges() {
        delegate?.dateChooserSaved()
    }
    
}
