<div dir="ltr">Currently I have in a private framework a class named `AccountAuthorizationController` with subclasses like `OAuthAccountAuthorizationController`, `OAuth2AccountAuthorizationController` and `WebFormAccountAuthorizationController` and so on.<div><br></div><div>In the root "abstract" class I have methods without implementation where I have to use `fatalError()` to ensure that they will never been called. I cannot prevent the framework user to instantiate the `AccountAuthorizationController`, however.<div><br></div><div>Look that this is only one example. I have other cases as well when I'd like to have abstract classes and abstract methods.</div><div><br></div><div>I know that structs and protocols are "elegant, simple and powerful" (as they seem to be all new frameworks and languages that pop up every day on the Internet) and the argumentsĀ in favor of composition rather than inheritance. But I still would like to take advantage of the decades of available knowledge in object orientation in my projects.</div><div><br></div><div>+1 for abstract classes and abstract methods.</div><div><br></div><div>-Van</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 12:46 PM, Evan Maloney via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Well not exactly, if you want the same behaviors in subclasses of UIViewController and UITableViewController :<br>
> - with protocols + extensions, you write in once and apply it to each of your subclasses<br>
> - with abstract classes you have to write 2 abstract classes, one for direct UIViewController subclasses, one for UITableViewController subclasses<br>
<br>
</span>That's a problem with class hierarchies in general, not with abstract classes.<br>
<br>
You can use the same argument to call for the removal of classes from Swift, which is why I think the fundamental question is, are classes intended to be first-class citizens in Swift?<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>