쑤야의 개발 블로그

고정 헤더 영역

글 제목

메뉴 레이어

쑤야의 개발 블로그

메뉴 리스트

  • 홈
  • 태그
  • 분류 전체보기 (98)
    • Algorithm (52)
    • CS (0)
    • AI (15)
      • PyTorch (4)
      • 논문 (3)
      • Open3D (7)
      • DL (0)
    • iOS (30)
      • RxSwift (4)
      • Combine (4)
      • Swift (1)
    • ETC (1)
      • 기타 (1)

검색 레이어

쑤야의 개발 블로그

검색 영역

컨텐츠 검색

iOS/Combine

  • throttle

    2024.02.29 by 쑤야.

  • Combine은 withLatestFrom을 제공하지 않는다

    2023.12.25 by 쑤야.

  • RunLoop.main과 DispatchQueue.main

    2023.12.13 by 쑤야.

  • Combine과 함께 NotificationCenter 사용해보기

    2023.12.10 by 쑤야.

throttle

https://developer.apple.com/documentation/combine/fail/throttle(for:scheduler:latest:) throttle(for:scheduler:latest:) | Apple Developer Documentation Publishes either the most-recent or first element published by the upstream publisher in the specified time interval. developer.apple.com RxSwift와 Combine을 사용하면서 throttle에 대해 들어보기는 했는데, 제대로 사용해 보거나 공부해 본 적이 없다. throttle에 대해 학습하고, 현재 진행 중인 프로젝트에도 적..

iOS/Combine 2024. 2. 29. 13:51

Combine은 withLatestFrom을 제공하지 않는다

RxSwift의 withLatestFrom RxSwift에서 withLatestFrom은 방출 기준이 되는 observable이 방출될 때마다 다른 observable의 최신 값을 가져와 결합한 후, observable을 방출한다. Combine은? Combine에서 다른 publisher들을 모아서 재방출할 수 있는 연산자로 zip, merge, combineLatest 3가지가 있는데 아쉽게도 withLatestFrom와 같은 기능을 수행하는 연산자는 없다. combineLatest가 최신 값을 가져와 방출하는 특징을 가지고 있다. 하지만 기준으로 설정한 publisher가 새로운 이벤트를 방출할 때에 대해서만 이벤트가 방출되는 것이 아니라, 기준에 상관없이 결합된 다른 publisher들이 새로운 ..

iOS/Combine 2023. 12. 25. 00:25

RunLoop.main과 DispatchQueue.main

비동기 프로그래밍에서 UI 업데이트를 진행해야 할 때는 반드시 메인 스레드에서 동작하도록 설정해줘야 한다. Combine의 경우 receive(on:) 메서드에 스케줄러를 설정해 주면 된다. 이때 RunLoop.main과 DispatchQueue.main을 통해 메인 스레드 지정이 가능한데, 둘의 차이점에 대해 궁금해져서 구글링을 해보았다. Combine의 스케줄러 Combine의 스케줄러는 언제, 어떻게 클로저를 실행시킬 지 정의한다. 스케줄러들은 Scheduler 프로토콜에 순응하며, RunLoop.main과 DispatchQueue.main도 이 프로토콜을 채택하고 있다. URLSession.shared .dataTaskPublisher(for: URL(string: "https://picsum.p..

iOS/Combine 2023. 12. 13. 00:26

Combine과 함께 NotificationCenter 사용해보기

문서 살펴보기 https://developer.apple.com/documentation/foundation/notificationcenter NotificationCenter | Apple Developer Documentation A notification dispatch mechanism that enables the broadcast of information to registered observers. developer.apple.com 1. post object: notification을 보내는 객체 userInfo: notification에 추가로 담아야 하는 정보 처음에 object에 보내고 싶은 데이터를 보내는 줄 알았다. (사실 그냥 편하게 딕셔너리 사용안하고 데이터 전송하고 싶었던 것..

iOS/Combine 2023. 12. 10. 18:21

추가 정보

인기글

최신글

페이징

이전
1
다음
TISTORY
쑤야의 개발 블로그 © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바