<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">It seems like having a protocol restricted to instances of ‘<font face="Helvetica Neue" class="">AccountAuthorizationController’ (as Brent suggested) would solve your problem, wouldn’t it?</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">You could just add all method declarations that are supposed to be abstract to that protocol instead, and then make sure your subclasses implement the protocol - which means the compiler forces them to implement the abstract methods.</font></div><div class=""><br class=""></div>
&gt; Currently I have in a private framework a class named `AccountAuthorizationController` with subclasses like `OAuthAccountAuthorizationController`, `OAuth2AccountAuthorizationController` and `WebFormAccountAuthorizationController` and so on.<br class="">&gt; <br class="">&gt; 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.<br class="">&gt; <br class="">&gt; Look that this is only one example. I have other cases as well when I'd like to have abstract classes and abstract methods.<br class="">&gt; <br class="">&gt; 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 argumentsin 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.<br class="">&gt; <br class="">&gt; +1 for abstract classes and abstract methods.<br class="">&gt; <br class="">&gt; -Van<br class="">&gt; <br class="">&gt; On Fri, Feb 26, 2016 at 12:46 PM, Evan Maloney via swift-evolution&lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>(<a href="mailto:swift-evolution@swift.org" class="">mailto:swift-evolution@swift.org</a>)&gt;wrote:<br class="">&gt; &gt; &gt;Well not exactly, if you want the same behaviors in subclasses of UIViewController and UITableViewController :<br class="">&gt; &gt; &gt;- with protocols + extensions, you write in once and apply it to each of your subclasses<br class="">&gt; &gt; &gt;- with abstract classes you have to write 2 abstract classes, one for direct UIViewController subclasses, one for UITableViewController subclasses<br class="">&gt; &gt; <br class="">&gt; &gt; That's a problem with class hierarchies in general, not with abstract classes.<br class="">&gt; &gt; <br class="">&gt; &gt; 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 class="">&gt; &gt; _______________________________________________<br class="">&gt; &gt; swift-evolution mailing list<br class="">&gt; &gt; <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>(<a href="mailto:swift-evolution@swift.org" class="">mailto:swift-evolution@swift.org</a>)<br class="">&gt; &gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">&gt; <br class="">&gt; <br class="">&gt;<span class="Apple-converted-space">&nbsp;</span>

</body></html>