vhesener / Closures

Swifty closures for UIKit and Foundation
MIT License
1.74k stars 146 forks source link

NotificationCenter? #36

Open Droppix opened 6 years ago

Droppix commented 6 years ago

Hi,

NotificationCenter integration?

vhesener commented 6 years ago

Hi @Droppix, are you aware that NotificationCenter has a built-in API based on closures? If so, can you help me understand how Closures can help? Thanks!

Droppix commented 6 years ago

Sorry for not having been clear... It would have been interesting to make a simplification to the API "Apple", for example :

NotificationCenter.default.add(observer: self, name: "") { _ in} NotificationCenter.default.removeObserver(self) same for Timer : Timer.scheduledTimer(timeInterval: 1.0) {}

And above all it will allow me to avoid using more:) [https://github.com/ManueGE/Actions]

Thanks