cesarferreira / swifteventbus Goto Github PK
View Code? Open in Web Editor NEWA publish/subscribe EventBus optimized for iOS
License: MIT License
A publish/subscribe EventBus optimized for iOS
License: MIT License
Can you please update the podspec to 5.1.0?
Since I am using a podspec myself I can only reference a version, not a tag.
Thanks
Hi
I use "SwiftEventBus.post" when user clicks on the notification and open the app.
but in another side "onMainThread" not fired.
is there an issue or I miss up some thing.
can you help me?
Thanks
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99.
any plans to support watchOS?
Hi there!
I'm using this pod in a KMM (Kotlin Multiplarform) project, of course for the iOS version of the app.
The problem is that I'm not able to add the snippet ENV['SWIFT_VERSION'] = '5' to the generated podfile, and because of that, I'm getting the following error:
pod install Analyzing dependencies Pre-downloading:
SwiftEventBusfrom
https://github.com/cesarferreira/SwiftEventBus.git`, tag 5.1.0
Downloading dependencies
Installing SwiftEventBus (5.0.0)
[!] Unable to determine Swift version for the following pods:
SwiftEventBus
does not specify a Swift version and none of the targets (ios
) integrating it have the SWIFT_VERSION
attribute set. Please contact the author or set the SWIFT_VERSION
attribute in at least one of the targets that integrate this pod.It will not be possible to add custom code to the podfile until Kmm reaches the version 1.9.0 (currently 1.7), I suppose it will take more than a year.
Would it be possible to include the workaround mentioned in the error message?
Thanks in advance!
Hello, should I call SwiftEventBus.unregister(self) in deinit, or just leave it. thx
Seeing build errors when compiling with XCode 6.3 beta 3 / Swift 1.2:
/Users/ragrait/ios/Rdio/Pods/SwiftEventBus/SwiftEventBus/SwiftEventBus.swift:48:43: Invalid use of '()' to call a value of non-function type 'UInt'
This is happening in 3 different places, but they're all variants on this:
let id = ObjectIdentifier(target).uintValue()
Looks like the trailing parens cause a syntax error in Swift 1.2
I want to install SwiftEventBus 2.0.0 by cocoapods, So I input Podfile below and execute pod install
.
pod 'SwiftEventBus', '~> 2.0.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
But error is occured.
[!] A dependency with an external source may not specify version requirements (SwiftEventBus).
please help me.
how to use this lib for ios 7 ?
These two functions conflicting
open class func post(_ name: String, sender: AnyObject?)
open class func post(_ name: String, sender: NSObject?)
Swift 4.2 by calling
SwiftEventBus.post("notification", sender: 1) // not working
SwiftEventBus.post("notification", sender: 1 as AnyObject) // working
I'm having an issue with updating UI with a SwiftEventBus.post fired on a background thread.
The issue happens when i'm making a network request for authenticating a user.
We have an event for when the user is authenticated. When the user is authenticated, we fire off a SwiftEventBus event(which looks to be done on a background thread).
The completion handler for the subscriber to the authentication event also publishes an event to notify the UI to update, but the event never gets caught by it's subscriber. The view controller that subscribes to the "navigate" event set's the subscription handler's "onMainThread" to true, but method never seems to get called.
Am I supposed to ensure that events relate to updating UI need to be fired on the main thread, or is this a known issue?
Is there a swift 3 version if this library?
if not is there instructions for using it in legacy swift 2.3 mode?
Hi,
I would like to create a new instance of the event bus class. How would I do that? As far as I can see there are no open initializers.
Thanks.
Where will SwiftEventBus.onBackgroundThread execute as iOS won't allow background execution without telling mode of background? Do I need to do some configuration to work in background?
I have installed SwiftEventBus in my project using Carthage and it shows me this error while running my project.
I used Xcode 12.5.1 and 13 beta.
Can someone please help how I can resolve this?
'pod install' fails for a macOS project with this message:
Pre-downloading: 'SwiftEventBus' from 'https://github.com/cesarferreira/SwiftEventBus.git', tag '2.1.2'
[!] The platform of the target '[...]' (OS X 10.12) is not compatible with 'SwiftEventBus (2.1.0)', which does not support 'osx'.
Static.instance.cache is not clearing automatically unless unregister the target
doing
pod 'SwiftEventBus' always brings 2.1.2
doing pod 'SwiftEventBus', '~>3.0.1' also does not work
only pod 'SwiftEventBus', :git => 'https://github.com/cesarferreira/SwiftEventBus.git', :branch => 'master'
works
is there a configuration issue ?
I have installed SwiftEventBus in my project using Carthage and it shows me this error while running my project. I am using Xcode 11.1, also check this in 11.3.
Can someone please help how I can resolve this ?
Is there any way i can find if the current view controller (self
) is already registered for at least one event?
Even if I only send it once, my registered closure is called multiple times.
So today i have to unregister when receiving the event for the first time.
Note that I'm certain that the posting of the event happens only once, I added a breakpoint and it only stopped once.
Sending:
SwiftEventBus.post(BUS_EVENT_1_DETECTED, sender: myData)
Event listener in my view controller viewDidLoad() function :
SwiftEventBus.onBackgroundThread(self, name:BUS_EVENT_1_DETECTED) { result in
//listen only once as this event may be casted multiple times.
SwiftEventBus.unregister(self, name:BUS_EVENT_1_DETECTED)
let data:MyData = result.object as! MyData
// then do stuff here with my data.
}
Any ideas ?
Thanks.
The last update was 2 years ago
when I use cocoapods ,set ios plaform 9.0, then the log:Specs satisfying the SwiftEventBus (from
https://github.com/cesarferreira/SwiftEventBus.git`, tag 2.0.1
), SwiftEventBus (= 2.0.0)` dependency were found, but they required a higher minimum deployment target.
I try to set plaform 10.0 ,it's ok
When i call postToMainThread or simple post onMainThread is calling many times . triggering count is not predictable .
Hello,
:git tag is not available for dependencies defined in Podspec, and I am unable to use 3.0.1 version in my framework.
Can you please publish it to Cocoapods as well?
I post the event in UITabBarController, and subscribe in HomeViewController. There relation is
UITabBarController -> UINavigationController(rootViewController: HomeViewController). All the operations are in the main thread but the event can only be triggered once.
Hi.
I'm on Xcode 12 + Swift 5
Adding this line to my Podfile
pod 'SwiftEventBus', :tag => '5.1.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
downloads 5.0.0 instead of 5.1.0.
Update all pods
Updating local specs repositories
Analyzing dependencies
Pre-downloading: `SwiftEventBus` from `https://github.com/cesarferreira/SwiftEventBus.git`, tag `5.1.0`
Downloading dependencies
Installing SwiftEventBus 5.0.0
I see the Podspec is set to 5.0.0.
Would that be the reason it pulls 5.0.0?
Sorry I'm new to iOS development.
I think this will be great if have a isRegisterd
method to prevent registering for an instance multiple times.
Hi,
How this lib can be testable ?
Hi @cesarferreira,
How to use this in pod spec as dependency?
Unable to build my project after installing using pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker
My pod file is below:
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'OmnicoinWallet' do
pod 'SwiftEventBus', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
end
As much a I would love to jump onto swift 3, I can't :-(.
My project is macOs, but I have no effect on it. Can I support it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.