Reputation: 519
I have a TableView in my application which displays some events. When I click on it, it navigates to the event clicked. My struggle is, that the whole navigation process / animation looks very ugly. The rows disappear when the new ViewController is already present.
I managed to screenshot it, so you could understand better how it looks.
Code looks like this:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: false)
guard let parent = parentVC else { return }
guard let id = twoDimensionalEventArray[indexPath.section].events[indexPath.row].eventID else { return }
parent.gotoEvent(eventID: id)
}
func gotoEvent(eventID: Int) {
let event = eventArray[eventID]
let eventVC = SingleEventViewController(event: event)
self.navigationController?.pushViewController(eventVC, animated: true)
}
Does someone know how to solve this issue?
Because two people suggested I provide my Viedloading of the SingleEventVuewController, here it is:
init(event: Event) {
thisEvent = event
super.init(nibName: nil, bundle: nil)
setupDefaultValues()
self.view.backgroundColor = .white
}
override func viewDidLoad() {
super.viewDidLoad()
applyDefaultValues()
setupNavBar()
setupViews()
confBounds()
getSnapshotForLocation()
}
Upvotes: 0
Views: 63
Reputation: 811
Set background color content view of cell as white in storyboard . Please refer the screenshot
Upvotes: 0
Reputation: 215
Set the backgroundColor to white like self.view.backgroundColor = .white
in viewDidLoad()
of the detail view controller or you could set it in storyboard if you done it that way.
Upvotes: 1