I have created a app using reactive cocoa signals. In my app I have created some RacSignals and then merged the signals into a single signal and subscribed to it. Now if User logs out, I want a way to cancel all the signals that I have merged. Is there a way to cancel all active RacSignals in a single go? or cancelling the merged signal will cancel all the signals merged to it.
Dispose combined reactive cocoa signals
1.2k views Asked by user3168555 AtThere are 2 answers
Nicolai Dahl
On
Mateusz is right but I have a feeling you're not entirely sure what the semantics of disposing a RACDisposable are. So here goes:
In the example of Mateusz only the subscription is cancelled (disposed of), but the signal lives on (as long as it is not dealloced of course).
A RACSignal lives on even if there are no subscriptions to it, and it can potentially continue sending next values as long as it is not ended by an error or a complete event.
If by "Cancelling" a signal you mean stop subscribing to the next values, then disposing the disposable is the way to go. If "Cancelling" means completing the signal then have a look at the takeUntil: method, which completes the returning signal at your convenience (this will still not complete the original signal however)
Hope that helped a bit
Related Questions in IOS
- URLSession requesting JSON array from server not working
- Incorrect display of LinearGradientBrush in IOS
- Module not found when building flutter app for IOS
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Expo Deep linking on iOS is not working (because of Google sign-in?)
- On iOS, the keyboard does not offer a 6-character SMS code
- Hi, there is an error happened when I build my flutter app, after I'm installing firebase packages occurs that error
- The copy/paste functionalities don't work only on iOS in the Flutter app
- Hide LiveActivityIntent Button from Shortcuts App
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Actionable notification api call not working in background
- Accessibility : Full keyboard access with scroll view in swiftui
- There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'XXXX'
- I am getting "binding has not yet been initialized" error when trying to connect firebase with flutter
Related Questions in IPHONE
- How to control the volume of an iPhone programmatically in objective-c
- my website crash on safari The site sometimes crashes and I can't recover the crash
- Postal Framework crash in iPhone but runs successfully in simulator
- Xcode 15 building failure when using iphone 15 as simulator, using ios 17
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- Any problem with creating provisioning profile with old Iphone?
- Does anyone know how to make iPad layout the same as iPhone's? Size wise the text and overall layout get's smaller when I run the app on the iPad
- Keyboard not appearing when connecting smart card reader to iPhones with type-c port. i.e. iPhone 15/ 15 pro
- Access the list of SIM mobile numbers installed in the iPhone
- Can we produce haptics and record from microphone the haptic sound at the same time on iOS?
- SwiftUI's localized string do not load from main bundle despite using the main bundle identifier (an xcode bug?)
- Cordova iOS only app upload through transport requires WKWatchKitApp
- Amazon s3 video is not played on Iphone
- build getting failed for ios xcode build -flutter app
- "Error when Importing 'mysdk' into iOS Demo App: dyld Library not loaded: @rpath/MQTTClient.framework/MQTTClient"
Related Questions in COCOA
- In what context can we use an unqualified #selector() expression in Swift?
- How can I trigger macOS system gamepad API based on a value received from iOS app through core bluetooth
- Using sort descriptors in Outline View
- NSTableView to NSOutlineView Drag & Drop not accepting drop
- How to remove horizontal line in bottom of section NSTableView?
- CGSRegionRef: How is an arbitrary region represented as union of rects?
- Listen for Touch Events on MacOS (Trackpad)
- Window "yanks" when moving
- Writing NSFilePromiseProviders to pasteboard blocks app on quit
- Basic ImGui program doesn't render, leaks memory and crashes
- NSTokenField suggestion using context menu in swift
- How to link multiple text views to a single text storage in TextKit 2
- I would like to know why I’m not getting IBOutlets connected in an App’s window
- How to make a custom event loop in Cocoa?
- Why is restoreWindow(withIdentifier:state:) called after applicationDidFinishLaunching(_:)?
Related Questions in RACSIGNAL
- Reactive ObjC emit sequence with time interval
- The command is disabled and cannot be executed
- ReactiveCocoa 5, ReactiveSwift network sub-request handling & best practice
- Reactive Cocoa 5 and ReactiveSwift network requests handling
- Migrate from RACSignal to ReactiveSwift or RAC5
- RACSignal: RACSignal code is not executed
- RACSignal: Handling incompatible block pointer types
- RACSignal: Signal is never invoked
- How to Cancel NSURLSessionDataTask 'Inside' A RACSignal
- ReactiveCocoa RACObserve self model trouble
- ReactiveCocoa Ambiguous reference to member RACSignal
- How can I create a synchronous method from a block in iOS
- Retrying RACObserve until success
- ReactiveCocoa `rac_textSignal` map completed event
- When should/must I declare/instantiate ReactiveCocoa objects as stored properties versus local variables?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
check this issue on GitHub.
So you can do sth. like this:
and when you want to cancel: