Feel free to move the further discussion into my thread with an enhanced
mechanism called group. Thread link.
--
Adrian Zubarev
Sent with Airmail
Am 19. Juni 2016 um 20:24:31, Raphaël Wach via swift-evolution
(swift-evolution@swift.org) schrieb:
Also, even if the sample code with the 3
Also, even if the sample code with the 3 extensions might looks ok, think that
if you’re working on a 300 classes project, declaring 900 extensions seems a
crazy thing to do. I would not have to do this on a big project.
@Charlie: Agree with you, on second thought, the implication of extending
Your approach has a major flaw: methods from extensions can't be overridden (at
least for now). As long as you want to your controller to be subclassed and
allow overriding your public/internal methods, you need to move them from
extensions to the main class scope. Which simply sucks and may be
Your style may vary, but in my experience the access level of two functions
has very little effect on how they should be grouped.
Let's take an example: a class with two init functions. (If you want a
concrete example: a subclass of UIView has init(frame) and init(coder)).
While the inits take
And if you want to be able to declare properties in extensions, which I'm not a
fan of, I think it would still be more a appropriate proposal than one that
adds another way to group access modifiers.
> On 14 Jun 2016, at 13:18, David Hart via swift-evolution
>
I dont agree. I think extensions serve this purpose very well. Here is what I
do:
I start with the type declaration only containing properties (public or
private). I then create one extension per access level required and one per
protocol conformance and per superclass overrides. We get:
Yes, extensions serve a different purposes. It doesn’t seem right for me to
just split every class content into 3 different extensions only to group
together items with a similar access level.
It would just make the codebase of a framework more messy. Access modifier
block allows to not break
Extensions can't have stored properties.
> On Jun 13, 2016, at 9:59 AM, Robert Widmann via swift-evolution
> wrote:
>
> What does this do that breaking a structure down into local extensions with
> the appropriate level of access control doesn't?
>
> ~Robert
What does this do that breaking a structure down into local extensions with the
appropriate level of access control doesn't?
~Robert Widmann
2016/06/13 0:55、Raphaël Wach via swift-evolution
のメッセージ:
> Hello Swifters,
>
> While working on some framework programming,
Hello Swifters,
While working on some framework programming, I had this idea that I would like
to share with you.
If some other people like it, I would be more than happy to write a proposal.
Here is a little draft I wrote as a starting point to discuss.
Sorry if there is mistakes, I am not an
10 matches
Mail list logo