<div dir="ltr">You're welcome! Glad to be helpful :)<div><br></div><div>Tadeas</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 10, 2016 at 9:12 PM Lou Zell <<a href="mailto:lzell11@gmail.com">lzell11@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Tadeas - Just what I was looking for. Thank you!<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">
<p class="m_-6232672192098229554gmail-p1 gmail_msg">class BaseView: UIView {<br class="gmail_msg">
<span class="m_-6232672192098229554gmail-s1 gmail_msg"> </span>@available(*, unavailable)<br class="gmail_msg">
required init?(coder aDecoder: NSCoder) {<br class="gmail_msg">
<span class="m_-6232672192098229554gmail-s1 gmail_msg"> </span>fatalError("Not implemented!")<br class="gmail_msg">
<span class="m_-6232672192098229554gmail-s1 gmail_msg"> </span>}<br class="gmail_msg">
}<br class="gmail_msg">
</p><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Mon, Oct 10, 2016 at 11:45 AM, Tadeas Kriz <span dir="ltr" class="gmail_msg"><<a href="mailto:tadeas@brightify.org" class="gmail_msg" target="_blank">tadeas@brightify.org</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">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.<span class="m_-6232672192098229554HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Tadeas</div></font></span></div><div class="m_-6232672192098229554HOEnZb gmail_msg"><div class="m_-6232672192098229554h5 gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Sat, Oct 8, 2016 at 8:23 PM Adrian Zubarev via swift-users <<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-6232672192098229554m_-6466335746415305027gmail_msg 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="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"> <br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><div class="m_-6232672192098229554m_-6466335746415305027m_953338218637516873bloop_sign m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><div style="font-family:helvetica,arial;font-size:13px" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">-- <br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">Adrian Zubarev<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">Sent with Airmail</div></div></div><div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"> <p class="gmail_quote m_-6232672192098229554m_-6466335746415305027gmail_msg 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="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">swift-users@swift.org</a>) schrieb:</p> <blockquote type="cite" class="gmail_quote m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><span class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div><div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<div dir="ltr" class="m_-6232672192098229554m_-6466335746415305027gmail_msg 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 m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<div class="gmail_quote m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">On Sat, Oct 8, 2016 at 9:22 AM, Lou Zell
<span dir="ltr" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><<a href="mailto:lzell11@gmail.com" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">lzell11@gmail.com</a>></span> wrote:<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<blockquote class="gmail_quote m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">Hi all,</div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg 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="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg 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="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg 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="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">Thanks!</div>
<span class="m_-6232672192098229554m_-6466335746415305027m_953338218637516873HOEnZb m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><font color="#888888" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></font></span>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><span class="m_-6232672192098229554m_-6466335746415305027m_953338218637516873HOEnZb m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><font color="#888888" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">Lou</font></span></div>
<div class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><span class="m_-6232672192098229554m_-6466335746415305027m_953338218637516873HOEnZb m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><font color="#888888" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></font></span></div>
</div>
</blockquote>
</div>
<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div>
_______________________________________________<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">swift-users mailing list<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><a href="mailto:swift-users@swift.org" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">swift-users@swift.org</a><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg"></div></div></span></blockquote></div>_______________________________________________<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
swift-users mailing list<br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<a href="mailto:swift-users@swift.org" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">swift-users@swift.org</a><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="m_-6232672192098229554m_-6466335746415305027gmail_msg gmail_msg">
</blockquote></div>
</div></div></blockquote></div><br class="gmail_msg"></div>
</blockquote></div>