In my ios applicaiton, the segment control is setting itself according to the storyboard even when some coordinates have been specified inside the viewDidLoad() function.
override func viewDidLoad() { super.viewDidLoad()
changeBackground()
changeBackground2()
trainSearchView.layer.cornerRadius = 12
passengerCheckinView.layer.cornerRadius = 12
trainsStatusVIew.layer.cornerRadius = 12
trainFrom.hidden = true
trainTo.hidden = true
trainNumber.hidden = true
trainName.hidden = false
activityIndicator.hidden = true
daySelector.addE
dispatch_async(dispatch_get_main_queue()){
self.radioTrainNumber.frame = CGRectMake(self.betweenStation.frame.origin.x, self.betweenStation.frame.origin.y + 40, self.radioTrainNumber.frame.size.width, self.radioTrainNumber.frame.size.height)
self.radioTrainName.frame = CGRectMake(self.radioTrainNumber.frame.origin.x, self.radioTrainNumber.frame.origin.y + 40, self.radioTrainName.frame.size.width, self.radioTrainName.frame.size.height)
self.trainName.frame = CGRectMake(self.trainFrom.frame.origin.x, self.radioTrainName.frame.origin.y + 40, self.trainName.frame.size.width, self.trainName.frame.size.height)
self.daySelector.frame = CGRectMake(self.daySelector.frame.origin.x, self.trainName.frame.origin.y + 55, self.daySelector.frame.size.width, self.daySelector.frame.size.height)
self.searchButton.frame = CGRectMake(self.searchButton.frame.origin.x, self.daySelector.frame.origin.y + 55, self.searchButton.frame.size.width, self.searchButton.frame.size.height)
let borderTrainSearch = UIView()
borderTrainSearch.frame = CGRect(x: self.trainSearchLabel.frame.origin.x + self.trainSearchLabel.frame.size.width, y: self.trainSearchLabel.frame.origin.y, width: 5,height: self.trainSearchView.frame.size.height )
borderTrainSearch.backgroundColor = UIColor.blackColor()
}
}
@IBAction func dayChanged(sender: UISegmentedControl) {
if flagForRadioPosition {
daySelector.frame = CGRectMake(daySelector.frame.origin.x, radioTrainName.frame.origin.y + 55, daySelector.frame.size.width, daySelector.frame.size.height)
}
else {
self.daySelector.frame = CGRectMake(self.daySelector.frame.origin.x, self.trainName.frame.origin.y + 60, self.daySelector.frame.size.width, self.daySelector.frame.size.height)
}
}