How do I “hide” a UIRefreshControl?

前端 未结 12 956
醉梦人生
醉梦人生 2020-12-15 16:16

Occasionally my table view won\'t be connected to a service to refresh, and in that case, I don\'t want the UIRefreshControl to be present.

After I add it in viewDid

12条回答
  •  春和景丽
    2020-12-15 16:57

    I solved it this way:

    -(void)updateUIWithAuthState:(BOOL)isAuthenticated {
        self.loginButton.enabled = !isAuthenticated;
        self.loginButton.tintColor = isAuthenticated ? [UIColor clearColor] : nil;
    
        self.logoutButton.enabled = isAuthenticated;
        self.logoutButton.tintColor = isAuthenticated ? nil : [UIColor clearColor];
    
        self.tableView.userInteractionEnabled = isAuthenticated;
        self.data = nil;
        [self.tableView reloadData];
    }
    

提交回复
热议问题