Hi,
Ankit Garg
21

Hi,

just move your layout code to viewDidLayoutSubviews method

func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
topLabelView.frame.origin.x = view.safeAreaInsets.left
topLabelView.frame.origin.y = view.safeAreaInsets.top
topLabelView.frame.size.height = 300
topLabelView.frame.size.width = view.bounds.width — view.safeAreaInsets.left — view.safeAreaInsets.right
}

Also, I suggest you to see example
https://github.com/rosberry/SafeAreaExample