Note that there are some explanatory texts on larger screens.

plurals
  1. POUIRefreshControl weirdness
    primarykey
    data
    text
    <p>Just started to use "UIRefreshControl" today, and noticed some weird things.</p> <p>If I created the UIRefreshControl in InterfaceBuilder, and wire it all up, my selector never gets called. IB says that the control should fire on the "value changed" message, and should call my code, but never does.</p> <p>So I abandoned doing this in Interface Builder, and just decided to do this in the code. Not too many lines. So I put this code inside of my "viewDidLoad" routine:</p> <pre><code>self.refreshControl = [UIRefreshControl new]; [self.refreshControl addTarget:self action:@selector(doStuff:) forControlEvents:UIControlEventValueChanged]; NSMutableParagraphStyle* paragraphStyle = [NSMutableParagraphStyle new]; paragraphStyle.alignment = NSTextAlignmentCenter; self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to refresh" attributes:@{NSParagraphStyleAttributeName : paragraphStyle}]; </code></pre> <p>It draws fine, but the refresh-control is visible when the view first appears. I'd prefer that it not be visible until the user actually pulls down on the table. I'm making a call to a web-service, and wait for the results to come back, then I populate the table. So, you only see the control for a second or two. But it just looks weird.</p> <p>So, the questions are:<br> 1. Is this a known bug that you can't wire up the control solely from Interface Builder?<br> 2. Is there a way to add this control to the table-view controller, without it appearing until the user actually wants to see it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload