UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];

[refreshControl addTarget:self action:@selector(listRefresh:) forControlEvents:UIControlEventValueChanged];

[listview addSubview:refreshControl];


- (void) listRefresh:(UIRefreshControl *)refreshControl{

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        [self getList];

        dispatch_async(dispatch_get_main_queue(), ^{

            [refreshControl endRefreshing];

        });

    });

}

'iPhone Dev' 카테고리의 다른 글

alamofire response를 object형태가 아닌 json형태로 받기  (0) 2018.10.30
리스트 페이지 처리  (0) 2016.06.22
앱 실행 시 모달뷰 띄우는 방법  (0) 2016.06.21
UIAlertController 사용  (0) 2016.05.12
enable bitcode  (0) 2016.04.26
Posted by 떡공이
,