사과
  • 애플 개발자 문서 한글 번역
  • App Frameworks
    • Foundation
      • 숫자, 데이터와 기본값
      • 문자열과 텍스트
      • 컬렉션
      • 날짜와 시간
      • 데이터 포맷
      • 작업 관리
        • Operation
        • OperationQueue
        • Timer
      • 리소스
        • Bundle
      • 파일 시스템
        • FileManager
      • Notification
        • NSKeyValueObserving
      • URL 로딩 시스템
        • 웹사이트 데이터를 메모리에 저장하기
        • URLSession
          • URLSessionConfiguration
            • urlCache
            • requestCachePolicy
          • configuration
        • URLSessionTask
        • URLRequest
        • URLResponse
        • HTTPURLResponse
        • 캐시 데이터에 접근하기
        • CachedURLResponse
        • URLCache
      • Object Runtime
        • NSValue
    • UIKit
      • UIKit으로 앱 개발
      • 앱과 환경
        • 앱 라이프 사이클 관리하기
        • 앱 실행에 대응하기
        • UIApplication
      • 문서, 데이터와 클립보드
      • Mac Catalyst
        • iPad 앱을 Mac 버전으로 만들기
        • 아이패드 앱의 맥 최적화
      • 뷰와 컨트롤
        • UIView
        • Table Views
          • UITableView
          • UITableViewCell
          • UIRefreshControl
        • UIScrollView
      • View Controllers
        • UIViewController
        • UITableViewController
        • UISearchController
      • 애니메이션과 햅틱
        • 프로퍼티 기반 애니메이션
          • UIViewPropertyAnimator
        • View controller 전환
      • 터치, 누르기, 제스처
        • UIResponder
        • UIKit 제스처 처리
        • 다중 제스처 인식기 조정
        • UILongPressGestureRecognizer
        • UIPanGestureRecognizer
          • maximumNumberOfTouches
          • minimunNumberOfTouches
          • translation(in:)
          • setTranslation(_:in:)
          • velocity(in:)
        • UIGestureRecognizer
    • Swift
      • 스위프트 표준 라이브러리
        • 메모리 직접 관리
          • 포인터 파라미터를 사용하는 함수 호출
          • UnsafePointer
          • UnsafeMutableRawBufferPointer
    • SwiftUI
      • 뷰와 컨트롤
        • View
        • Text
        • TextField
      • 뷰 레이아웃과 표현
      • 그리기와 애니메이션
      • 프레임워크 통합
      • 상태와 데이터 흐름
  • Graphics and Games
    • Core Animation
      • CALayer
      • CAAction
      • CAShapeLayer
      • CADisplayLink
    • Core Graphics
      • CGFloat
      • CGPath
  • App Services
    • Combine
    • WebKit
      • WKWebView
  • Media
    • AVFoundation
      • 시스템 오디오 상호작용
        • AVAudioSession
          • AVAudioSession.Category
            • ambient
            • multiRoute
            • playAndRecord
            • playback
            • record
            • soloAmbient
          • AVAudioSession.Mode
      • AVFoundation 자료형
  • Documentation Archive
    • 번들 프로그래밍 가이드
      • 번들에 대해
      • 번들 구조
    • Key-Value Observing 프로그래밍 가이드
    • Threading 프로그래밍 가이드
      • About Threaded Programming
      • Thread Management
  • ETC
    • Not Found
Powered by GitBook
On this page
  • Declaration
  • Summary
  • 개요
  • 주제
  • Refresh Control 초기화
  • Control 속성 접근
  • Refresh 상태 관리
  • 관련 문서
  • 상속받은 대상
  • 준수하는 프로토콜
  • 같이 보기
  • Data
  1. App Frameworks
  2. UIKit
  3. 뷰와 컨트롤
  4. Table Views

UIRefreshControl

스크롤 뷰 컨텐츠를 새로고침 할 수 있는 표준 컨트롤

PreviousUITableViewCellNextUIScrollView

Last updated 5 years ago

원문 출처

Declaration

class UIRefreshControl : UIControl
@interface UIRefreshControl : UIControl

Summary

SDKs

  • iOS 6.0+

Framework

  • UIKit

개요

UIRefreshControl 객체는 table view와 collection view를 포함한 모든 에 붙일 수 있는 표준 컨트롤입니다. 이 컨트롤을 스크롤 가능한 뷰에 추가하면 사용자는 표준적인 방법으로 컨텐츠를 새로고침할 수 있습니다. 사용자가 스크롤 가능한 컨텐츠 영역의 상단에서 아래로 드래그를 하면 스크롤 뷰는 Refresh control을 드러내고, progress indicator의 애니메이션을 시작하면서 앱에 노티피케이션을 보냅니다. 개발자는 이 노티피케이션을 사용하여 컨텐츠를 업데이트하고 리프레시 컨트롤을 제거할 수 있습니다.

func configureRefreshControl () {
    //  refresh controll을 UIScrollView 객체에 추가하세요. 
    myScrollingView.refreshControl = UIRefreshControl()
    myScrollingView.refreshControl?.addTarget(self, action:
                                      #selector(handleRefreshControl),
                                      for: .valueChanged)
}

@objc func handleRefreshControl() {
   // 컨텐츠를 업데이트하세요.

   // Refresh control을 제거하세요.
   DispatchQueue.main.async {
      self.myScrollingView.refreshControl?.endRefreshing()
   }
}

Note

주제

Refresh Control 초기화

  • init() 표준 refresh control을 초기화하고 반환합니다.

Control 속성 접근

  • var tintColor: UIColor! Refresh control의 색조

  • var attributedTitle: NSAttributedString? Refresh control에 표시할 스타일 지정된 제목 텍스트

Refresh 상태 관리

  • func beginRefreshing() refresh 작업이 시작됐음을 control에 알립니다.

  • func endRefreshing() Refresh 작업이 끝났음을 control에 알립니다.

  • var isRefreshing: Bool Refresh 작업이 트리거되었고 아직 진행중임을 나타내는 Boolean 값

관련 문서

상속받은 대상

  • UIControl

준수하는 프로토콜

  • CVarArg

  • Equatable

  • Hashable

  • UIAccessibilityIdentification

  • UILargeContentViewerItem

  • UIPasteConfigurationSupporting

  • UIUserActivityRestoring

같이 보기

Data

  • Filling a Table with Data Create and configure cells for your table dynamically using a data source object, or provide them statically from your storyboard.

  • protocol UITableViewDataSource

    UITableViewDataSource 프로토콜은 UITableView 객체에 대한 앱 데이터 모델을 조정하는 객체에서 사용됩니다.

  • protocol UITableViewDataSourcePrefetching

    테이블 뷰의 데이터 요구 사항에 대한 사전 경고를 제공하여 비동기 데이터 로드 작업의 트리거를 허용하는 프로토콜입니다.

  • class UITableViewDiffableDataSourceReference Beta

  • class UITableViewDiffableDataSource Beta

  • typealias UITableViewDiffableDataSourceReference.CellProvider Beta

  • class NSDiffableDataSourceSnapshotReference Beta

  • class UILocalizedIndexedCollation

    An object that organizes, sorts, and localizes the data for a table view that has a section index.

  • protocol UIDataSourceTranslating

    An advanced interface for managing a data source object.

Refresh control은 의 target-action 매커니즘을 통해서 언제 컨텐츠를 업데이트 해야 할지 알려줍니다. Refresh control이 활성화가 되면 세팅된 action 메서드를 호출합니다. action 메서드를 추가할 때에는 아래 예시와 같이 이벤트에 반응하도록 해야 합니다. action 메서드를 사용해서 컨텐츠를 업데이트하고 작업이 끝난 후에는 refresh control의 메서드를 호출하세요.

에는 테이블의 새로고침 동작을 관리하기 위한 목적으로 이 기본 프로퍼티로 포함되어 있습니다.

UIControl
valueChanged
endRefreshing()
UITableViewController
refreshControl
https://developer.apple.com/documentation/uikit/uirefreshcontrol
UIScrollView