Every time I pull to refresh the TableView, the UIRefreshControl appears to be glitchy. Below is the code I am using. Any Ideas?
In AppDelegate:
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().barTintColor = UIColor.red
UINavigationBar.appearance().tintColor = UIColor.white
In UITableViewController:
self.tableView.refreshControl = UIRefreshControl()
if #available(iOS 11.0, *) {
self.navigationController?.navigationBar.prefersLargeTitles = false
} else {
// Fallback on earlier versions
}
self.tableView.refreshControl = refreshCont
A UIRefreshControl object is a standard control that you attach to any UIScrollView object, including table views and collection views. Add this control to scrollable views to give your users a standard way to refresh their contents.
UIRefreshControl isn’t available when the user interface idiom is UIUserInterfaceIdiom. mac. However, you can update your app to provide similar functionality in the Mac idiom. For example, replace the control with a Refresh menu item by creating a UIKeyCommand object with the title “Refresh” and the keyboard shortcut Command-R.
The refresh control lets you know when to update your content using the target-action mechanism of UIControl. Upon activation, the refresh control calls the action method you provided at configuration time. When adding your action method, configure it to listen for the valueChanged event, as shown in the following example code.
When the user drags the top of the scrollable content area downward, the scroll view reveals the refresh control, begins animating its progress indicator, and notifies your app. You use that notification to update your content and dismiss the refresh control.
For me self.extendedLayoutIncludesOpaqueBars = YES
fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With