iOS - Display a progress indicator at the center of the screen rather than the view
问题 I want to display a progress indicator at the center of the screen, NOT the view. It should be the center of the view because the view is scrollable. Most answers only tells how to center it in the view. I have this code: let screenBound = UIScreen.main.bounds let progressIndc = UIActivityIndicatorView() progressIndc.frame = CGRect(x: screenBound.width / 2 - 10, y: screenBound.height / 2 - 10, width: 20, height: 20) progressIndc.hidesWhenStopped = true progressIndc.color = UIColor.gray