I am currently using a JASidePanel for my application and I have a UITableViewcontroller with a UIRefreshControl as one of the ViewControllers for it. The width of my tablev
Swift 5:
There are a couple of ways to change UIRefreshControl position. The setup of the refresh control is done with the most convenient way.
Example where the refresh control is part of the scroll view:
let refresher = UIRefreshControl()
refresher.addTarget... // Add a proper target.
scrollView.refreshControl = refresher
Please note that you can use tableView instead of the scrollView.
Option 1: You can play with the frame/bounds of the view.
scrollView.refreshControl?.refreshControl.bounds.origin.x = 50
Option 2: Or you can do it using Auto Layout.
scrollView.refreshControl?.translatesAutoresizingMaskIntoConstraints = false
scrollView.refreshControl?.topAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
scrollView.refreshControl?.centerXAnchor.constraint(equalTo: view.centerXAnchor, constant: -50).isActive = true