ฉันกำลังใช้การดึงเพื่อรีเฟรชสำหรับการรีเฟรชข้อมูลตามปกติในมุมมองตาราง
นี่คือรหัสของฉัน
-(void)addUIRefreshControl{
//Instantiate and Configure Refresh Control
self.refreshControl = [[UIRefreshControl alloc] init]; // initialize refresh control
self.refreshControl.tintColor = [UIColor appBaseColor]; // set tint color
[self.refreshControl addTarget:self
action:@selector(refreshAPI)
forControlEvents:UIControlEventValueChanged]; // add target
[self.tableView addSubview:self.refreshControl]; // add the refresh control
}
-(void)refreshAPI{
if ([APP_DELEGATE isNetAvailable]) {
[self fetchAPI];
}else{
if (self.refreshControl) {
[self.refreshControl endRefreshing]; //end refreshing
}
}
}
ทุกอย่างทำงานได้ดีบนอุปกรณ์ iOS & Simulator ยกเว้น iPhone X มีใครแนะนำได้ไหมว่าฉันทำอะไรผิด
ขอบคุณ