What is the status for this idea? I can’t find the proposal for this. :(
--
Adrian Zubarev
Sent with Airmail
___
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
+1 I can’t wait for Swift 3 anymore. This ability would be great.
Additionally what do you think about something like this?
protocol DelegatableType {
protocol Delegate: class // enforced you to create a nested protocol
weak var delegate: Delegate? // or Self.Delegate?
}
class A:
Hey Brad
+1 I think this will make delegate controller pattern a lot more clean and
readable.
I was thinking about other areas where this can be useful, and I thought it
will be great for property injection from parent controller to children.
class ParentController{
protocol Injection:
You're right and since you can't nest any kind of type in a generic type
right, that wouldn't work even with this proposal. However, in the generics
manifesto they did say that they intend to remove that restriction. If they
do lift the restriction, they may have to leave an exception in place for
As a ruby programmer, I have to admit that I've tried to do this in Swift
several times before remembering again that it isn't possible.
+1
On Thu, Apr 28, 2016 at 3:44 PM, Howard Lovatt via swift-evolution <
swift-evolution@swift.org> wrote:
> +1 very handy to associate types together
>
>
> On
To get over issues like the inner protocol accessing outer quantities like
properties and generics you could add keyword noaccess (bike-shedding
name) to the declaration to make it clear that it does not have access,
e.g.:
class MyController {
noaccess protocol Delegate {
// No access to T
> On Apr 28, 2016, at 10:15 AM, Brad Hilton via swift-evolution
> wrote:
>
> Type nesting allows some convenient and straightforward semantics that we see
> inside the Swift standard library such as views on String like
> String.CharacterView,
+1 very handy to associate types together
On Friday, 29 April 2016, Michael Peternell via swift-evolution <
swift-evolution@swift.org> wrote:
> I think that would be a good feature.
>
> > Am 28.04.2016 um 19:15 schrieb Brad Hilton via swift-evolution <
> swift-evolution@swift.org
I think that would be a good feature.
> Am 28.04.2016 um 19:15 schrieb Brad Hilton via swift-evolution
> :
>
> Type nesting allows some convenient and straightforward semantics that we see
> inside the Swift standard library such as views on String like
>
Type nesting allows some convenient and straightforward semantics that we see
inside the Swift standard library such as views on String like
String.CharacterView, String.UnicodeScalarView, etc. However a protocol cannot
be nested in a type and gives a non-obvious error that the “Declaration is
10 matches
Mail list logo