0

Good day! I just want to ask if how can I add this Custom pull to refresh to my Swift project with Parse, I have a PFQueryTableViewController with pullToRefreshEnabled set to true so i get the default Spinning Butthole animation. I want to add the said Custom Pull to refresh animation. I tried doing the tutorial, but I'm getting an error Cannot override mutable property 'refreshControl' of type 'UIRefreshControl?' with covariant type 'UIRefreshControl' What should i do? Thanks!

The Tom
  • 2,790
  • 6
  • 29
  • 33
LEVIS OGCPAS
  • 229
  • 4
  • 11
  • Can you tell us what you've tried? What about posting some code to show where the error is? – pbush25 Jul 08 '15 at 12:20
  • when I'm adding a variable like this `var refreshControl = UIRefreshControl()` i get this error `Cannot override mutable property 'refreshControl' of type 'UIRefreshControl?' with covariant type 'UIRefreshControl'` – LEVIS OGCPAS Jul 08 '15 at 12:48
  • Did you try following the instructions in the tutorial? It should be `var refreshControl: UIRefreshControl!` and then in your `ViewDidLoad()` is where you set `refreshControl = UIRefreshControl()` where you would then add the `subView` to your `View`. – pbush25 Jul 08 '15 at 13:04
  • Yup, I cant run it because its giving me an error. It i use this `var refreshControl: UIRefreshControl!` the error that I'm getting is this `Cannot override with a stored property 'refreshControl'` – LEVIS OGCPAS Jul 08 '15 at 13:17
  • 1
    You might have to give it a different name because I think the `PFQueryTableView` has that property already. Try `var customRefreshControl: UIRefreshControl!` – pbush25 Jul 08 '15 at 13:29
  • Yup it works now, But when I run it, I get this error on `customTbView.addSubview(customrefreshControl)` like this `fatal error: unexpectedly found nil while unwrapping an Optional value (lldb)` – LEVIS OGCPAS Jul 08 '15 at 13:32
  • Did you initialize it in `ViewDidLoad()`? `customRefreshControl = UIRefreshControl()`. Of course this would be done before trying to `addSubview()` – pbush25 Jul 08 '15 at 13:38
  • I have this in my viewDidLoad, `customrefreshControl = UIRefreshControl() customrefreshControl.backgroundColor = UIColor.clearColor() customrefreshControl.tintColor = UIColor.clearColor() customTbView.addSubview(customrefreshControl) loadCustomRefreshContents()` – LEVIS OGCPAS Jul 08 '15 at 13:45

0 Answers0