Comments (12)
Make sure you are unregistering properly or else everytime you register, it adds a new handler.
from swifteventbus.
from swifteventbus.
Make sure you are unregistering properly or else everytime you register, it adds a new handler.
THIS was killing me and I guess I didn't read the docs... thank you for pointing this out!!!
from swifteventbus.
Hi @AskarAli.
As you probably know, we developers are just that, developers. Not witches, nor magicians, even if sometimes people believe so.
That being said, we can't just guess the problem without more information. Can you provide more insight, your use case in particular? How are you using SwiftEventBus? Are you sure you're not posting multiple times? Just throw us a bone here please. :)
Thanks for using SwiftEventBus by the way.
from swifteventbus.
I have used this for a test purpose while tapping a button i have sent the post code as you mentioned in usage and printed the value thats it
from swifteventbus.
Can you share the code? Or the project?
from swifteventbus.
I have the same issue. I have used the event bus in a couple projects but the number of times a message is received is unpredictable. I put in traps to print to debug console when the POST is done and then inside the listener I print when the message is received. I even try unregistering the event inside the onMainThread routine, but even with that I sometimes get an extra call as if the message was posted again (but it was not). I don't have an isolated project at the moment to send. The event bus is in several places in my projects, but the duplicate calls of the listener are problematic. I did not notice for some time as mostly I was just using it to know when to reload a table. A second or third call to reload the table was not a problem - not noticeable. But later I used the events to control more complex sequential logic (e.g. doing multiple reads from firebase).
from swifteventbus.
I have exactly the same problem right know. Let me know if you need code in order to understand my problem.
from swifteventbus.
If more than one OC project is better
from swifteventbus.
@AskarAli Print instance in onMainThread
if all address are different then may be problem in your code!!
from swifteventbus.
@AskarAli please make sure that you are subscribing to event in viewWillAppear and unregister in view viewWillDisappear
from swifteventbus.
@AskarAli @jscarney @mikeuv Just make sure to call SwiftEventBus.unregister(YOUR_TARGET_OBJECT) before subscribing/registering. Had the same problem.
SwiftEventBus does not filter out multiple subscriptions of a target.
from swifteventbus.
Related Issues (20)
- WatchOS support HOT 1
- why the versoin is also 2.2.0 HOT 3
- should I call SwiftEventBus.unregister(self) in deinit HOT 1
- Your 3.0.0 tag has the wrong podspec version (2.2.0) HOT 1
- can't get the newest version in the standard way
- How to create an new instance HOT 1
- Conflicting overloading functions HOT 2
- Publish 3.0.1 to Cocoapods HOT 1
- Update swift version to 5
- Swift Package Manager HOT 5
- Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.1 compiler: HOT 3
- Static.instance.cache is not clearing automatically unless unregister the target
- compiler warning HOT 1
- Check if event is already registered HOT 4
- Cocoapods downloads 5.0.0 instead of the latest
- Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.4.2 compiler HOT 2
- Update podspec to 5.1.0 HOT 1
- event only triggered once
- Could you add the SWIFT_VERSION attribute in at least one of the targets? HOT 1
- Why hasn't it been updated in years
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swifteventbus.