[swift-users] TWISt-shout Newsletter 2017-03-13

2017-03-13 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-03-06 to 2017-03-12 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-03-13.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org https://lists.sw

Re: [swift-users] Memory Leak of Dictionary used in singleton

2017-03-13 Thread Quinn "The Eskimo!" via swift-users
On 12 Mar 2017, at 00:04, Ekaterina Belinskaya via swift-users wrote: > Could someone, please, explain why this happens? In general a leak that you can reproduce with simple code snippets like this is Just a Bug™, and you should file it as such. It would help if you included a runnable test

[swift-users] Why does casting to Any make my forced downcast not crash?

2017-03-13 Thread Kim Burgestrand via swift-users
Here are two implementations that I'd expect to be equivalent, but something's different because the first example crashes, whereas the second example does not crash. What's the difference between these two? Why does casting to Any before the forced downcast to T have any effect? Example 1: (`une

Re: [swift-users] OptionSet as Sequence

2017-03-13 Thread J.E. Schotsman via swift-users
On 12 Mar 2017, at 23:23, Zhao Xin wrote: > I don't see the needs to call `for domain in domains` with > `domains:OptionSet`. If a parameter want an OptionSet, why not just > use`domains` directly instead of `domain`? You are right, I was writing bad code. When working with option sets you al

[swift-users] Self - requirement

2017-03-13 Thread Седых Александр via swift-users
Hello everyone! Please, tell, where I can read about "Self" requirement in protocols? Because in Book no words about it. Thanks -- Седых Александр ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] How to pass a protocol as parameter, without using @objc?

2017-03-13 Thread Bruno Macabeus via swift-users
I found the solution. I need use a closure. I updated the gist: https://gist.github.com/brunomacabeusbr/eea343bb9119b96eed3393e41dcda0c9 2017-03-13 1:38 GMT-03:00 Bruno Macabeus : > Hello, > > I wrote a gist to list all classes that subscribers a protocol: > https://gist.github.com/brunomacabeusb