GithubHelp home page GithubHelp logo

multicastdelegate's People

Contributors

bubski avatar jonasman avatar joshua-greene avatar jrg-developer avatar landonr avatar letko-dmitry avatar rodolfoantonicizup avatar rudedogg avatar rwagstaff84seek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

multicastdelegate's Issues

Carthage support

Could you please consider adding Carthage support?

*** Skipped building MulticastDelegate due to the error:
Dependency "MulticastDelegate" has no shared framework schemes for any of the platforms: iOS

isEmpty is counting nil references

As we can se in the issue #20, the delegates.count property will count nil references, which would cause the following implementation to fail:

public var isEmpty: Bool {
        return delegates.count == 0
}

To solve that:

public var isEmpty: Bool {
        return delegates.allObjects.count == 0
}

This will only count existing objects, nil references won't be indexed in the allObjects.

CocoaPods issue: The platform of the target PROJECTNAME (iOS 11.2) is not compatible with MulticastDelegateSwift (2.1.0), which does not support ios

Hi João,

When updating my pods I received the following error:

" The platform of the target PROJECTNAME (iOS 11.2) is not compatible with MulticastDelegateSwift (2.1.0), which does not support ios"

I have attached my Podfile below:

platform :ios, '11.2'

target 'PROJECTNAME' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for PROJECTNAME
  pod 'MulticastDelegateSwift'

end

I guess this is due to one of the latest commits (f601f7d):

-  s.platform = :ios, '8.0'
 -  s.platform = :osx, '10.10'
 +  s.ios.deployment_target = '8.0'
 +  s.osx.deployment_target = '10.10'

Do I have to change anything in my Podfile ?
Thanks a lot for maintaining the MulticastDelegate project!

Best,

Andreas

remove delegate on deinit

class ViewController: UIViewController, DemoServiceDelegate {

	@IBOutlet weak var topLabel: UILabel!
	@IBOutlet weak var bottomLabel: UILabel!
	
	let dataService = DemoService.defaultService
	
	
	override func viewDidLoad() {
		super.viewDidLoad()
	
		dataService.delegate += self
	}

	@IBAction func getDataTapped(_ sender: AnyObject) {
		dataService.getData("TestingMulticast")
	}

	
	//MARK: DemoServiceDelegate
	func gotYourData(_ value:String) {
		topLabel.text = value
	}
	
    deinit {
        dataService.delegate -= self
    }
}

We need to remove delegate manually, In this example.

Add macOS Support

I've been using this library for a year or two on macOS by manually adding the source file. I'd like to use it with CocoaPods instead though (for automatic updates, etc).

If you're interested I can do a PR. I think the only requirement is adding an osx target to the .podspec. Would you also want a macOS specific demo?

Thanks for sharing this, it's worked perfectly for me!

Cannot remove non-class delegates

Example:

protocol ServiceDelegate { }

class Service {
    var delegate = MulticastDelegate<ServiceDelegate>(strongReferences: true)
}

struct Struct: ServiceDelegate { }

let service = Service()
let x = Struct()

service.delegate.addDelegate(x)
service.delegate.removeDelegate(x)
// Not empty and you can't get the thing out ever again

Basically I'm wondering, why the generic type T is not restricted to classes.

Swift Package Manager support broken?

Hello,

I tried to migrate from CocoaPods to SPM in one of my projects using MulticastDelegate. I'm doing this through Xcode 11.1 using the integrated interface for a project targetting macOS.

At the final step I get this:
Capture d’écran 2019-10-26 à 13 24 32

Swift 3 branch

hi :)

It would be nice to maintain a Swift 3 compatible branch (i.e. compatible with the latest Xcode 8 beta).

I've got a fork here compatible with Xcode beta 4.

I can make a PR to a Swift 3 branch if you make one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.