iPhone – Get Position of UIView within entire UIWindow

The position of a UIView can obviously be determined by view.center or view.frame etc. but this only returns the position of the UIView in relation to it’s immediate superview. I need to determine the position of the UIView in the entire 320×480 co-ordinate system. For example, if the UIView is in a UITableViewCell it’s position … Read more

How to resolve: ‘keyWindow’ was deprecated in iOS 13.0

I’m using Core Data with Cloud Kit, and have therefore to check the iCloud user status during application startup. In case of problems I want to issue a dialog to the user, and I do it using UIApplication.shared.keyWindow?.rootViewController?.present(…) up to now. In Xcode 11 beta 4, there is now a new deprecation message, telling me: … Read more

How to tell if UIViewController’s view is visible

I have a tab bar application, with many views. Is there a way to know if a particular UIViewController is currently visible from within the UIViewController? (looking for a property) 17 s 17 The view’s window property is non-nil if a view is currently visible, so check the main view in the view controller: Invoking … Read more