<div dir="ltr">Lou, you can create a "class BaseView: UIView" which will serve as a default view your views will subclass and inside it, add the init required by NSCoding, make its body `fatalError("Not implemented!")` and add the following attribute on the init: `@available(*, unavailable)`. Then you'll not need to declare it in every view that subclasses the BaseView.<div><br></div><div>Tadeas</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 8, 2016 at 8:23 PM Adrian Zubarev via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">This is a wrong place to ask. This topic is part of the iOS SDK from Apple not part of Swift itself or libraries like Foundation.</div><div class="gmail_msg"><br class="gmail_msg"> <br class="gmail_msg"><div class="m_953338218637516873bloop_sign gmail_msg"><div style="font-family:helvetica,arial;font-size:13px" class="gmail_msg">-- <br class="gmail_msg">Adrian Zubarev<br class="gmail_msg">Sent with Airmail</div></div></div><div class="gmail_msg"> <p class="gmail_quote gmail_msg" style="color:#000">Am 8. Oktober 2016 um 18:32:50, Lou Zell via swift-users (<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a>) schrieb:</p> <blockquote type="cite" class="gmail_quote gmail_msg"><span class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">
<div dir="ltr" class="gmail_msg">Oh wow, I stumbled on this immediately after
posting: For anyone else that fills their NSCoding initializers
with assert(false), switch them to fatalError("message")</div>
<div class="gmail_extra gmail_msg"><br class="gmail_msg">
<div class="gmail_quote gmail_msg">On Sat, Oct 8, 2016 at 9:22 AM, Lou Zell
<span dir="ltr" class="gmail_msg"><<a href="mailto:lzell11@gmail.com" class="gmail_msg" target="_blank">lzell11@gmail.com</a>></span> wrote:<br class="gmail_msg">
<blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="gmail_msg">
<div class="gmail_msg">Hi all,</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">For better or worse I still hand code most of my views. I am
getting frustrated by the constant compiler error that I haven't
updated "required init(coder:)", which is something that will never
be executed in my case.</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Is there some hacky mechanism that I could use to create a
subtype that doesn't conform to all protocols of the parent?
Seems like recipe for disaster so I suspect it's not built into
swift directly.</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Is there a creative way to use UIViews, but with the
dependency on NSCoding removed? I am open to total hacks.</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Thanks!</div>
<span class="m_953338218637516873HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"></font></span>
<div class="gmail_msg"><span class="m_953338218637516873HOEnZb gmail_msg"><font color="#888888" class="gmail_msg">Lou</font></span></div>
<div class="gmail_msg"><span class="m_953338218637516873HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"></font></span></div>
</div>
</blockquote>
</div>
<br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">swift-users mailing list<br class="gmail_msg"><a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg"></div></div></span></blockquote></div>_______________________________________________<br class="gmail_msg">
swift-users mailing list<br class="gmail_msg">
<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg">
</blockquote></div>