<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>That's a cool hack! For a lighter way to distinguish overridable methods that one shouldn't ordinarily call, did anyone consider approximating "protected" (or as called in Objective-C speak, "private extension") methods with public class methods?</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">&nbsp; &nbsp; public class UIView {</div><div id="AppleMailSignature">&nbsp; &nbsp; &nbsp; &nbsp; public class func _layoutSubviews(_ view: UIView)</div><div id="AppleMailSignature">&nbsp; &nbsp; }</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">This way, they become overridable, won't show up in the editor auto completion list for a given instance, and can be called… but definitely make you think twice before you do!</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">— Pyry</div><div><br>Callionica (Swift) via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; kirjoitti 30.5.2016 kello 7.49:<br><br></div><blockquote type="cite"><div dir="ltr">I've written up how to provide protected access control for Swift code today here:<div><br></div><div><a href="http://www.callionica.com/developer/#swift-protected">http://www.callionica.com/developer/#swift-protected</a></div><div><br><div>No compiler changes necessary for this technique and it distinguishes between methods that can only be overridden and methods that can be both called and overridden.</div></div></div></blockquote></body></html>