<html><body><div>Great writeup! My sincere thanks for pushing this!<br></div><div><br data-mce-bogus="1"></div><div>+1 for the proposal<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>-Thorsten<br data-mce-bogus="1"></div><div><br>Am 24. Februar 2016 um 23:37 schrieb Evan Maloney <emaloney@gilt.com>:<br><br><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;">After Thorsten reminded me yesterday that I wanted this feature too, I spent some time writing up proposal to allow declaration of abstract functions and properties on Swift classes:<div class=""><br class=""></div><div class=""><a href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c" class="" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c">https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c</a><br data-mce-bogus="1"></div><div class=""><br class=""></div><div class="">This is the first draft; all comments welcome!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">E.</div><div class=""><br class=""></div><div class="">---</div><div class=""><br class=""></div><div class=""><h1 style="box-sizing: border-box; font-size: 2.25em; line-height: 1.2; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff; margin: 0px 0px 16px 0px;" class="" data-mce-style="box-sizing: border-box; font-size: 2.25em; line-height: 1.2; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff; margin: 0px 0px 16px 0px;">Allow declaration of abstract functions and properties on classes</h1><ul style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Proposal: SE-NNNN</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Author: <a href="https://github.com/emaloney" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;" class="" data-mce-href="https://github.com/emaloney" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;">Evan Maloney</a><br data-mce-bogus="1"></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Status: <strong style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Draft</strong></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Review manager: TBD</li></ul><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-introduction" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#introduction" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#introduction" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>Introduction</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Swift <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">protocol</code>s are useful for the declaring interfaces that must be provided by conforming entities (in other words: <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">struct</code>s, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code>es and <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">enum</code>s). Adopters of a given protocol are free to provide any implementation they wish, so long as it supplies the necessary interfaces.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Separating <em style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">interface</em> from <em style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">implementation</em> is widely considered to be a best practice in software design, and the Swift <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">protocol</code> is designed for this use-case.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-the-problem" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#the-problem" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#the-problem" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>The Problem</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Unfortunately, the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">protocol</code> does not cover all of the cases where a developer might want to specify an interface to be implemented by another entity.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">For example, consider the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code>, which allows the creation of an inheritance hierarchy. Often, a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code> in a hierarchy exists merely to provide a common implementation to subclasses. Such classes aren't ever intended to be instantiated directly; only subclasses will be instantiated.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">To illustrate the point, imagine a view controller class that:</p><ol style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Places an animating <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">UIActivityIndicatorView</code> onscreen</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Performs some operation to retrieve some text</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Puts the text in a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">UITextView</code> and places it onscreen</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">Hides the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">UIActivityIndicatorView</code></li></ol><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Now imagine you had many cases in your application where you could benefit from such a view controller, and each case differed only in the operation required to retrieve the text (represented by Step 2 above).</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Ideally, you would be able to achieve this by declaring the interface for a function without needing to specify an implementation, the same way you would with a protocol:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">func</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;" data-mce-style="box-sizing: border-box; color: #795da3;">retrieveText</span>() <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">-></span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span></pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">In other languages, such as C++, this concept exists in the form of an <em style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">abstract class</em>. However, Swift does not support this, so developers are forced to provide useless implementations such as:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">func</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;" data-mce-style="box-sizing: border-box; color: #795da3;">retrieveText</span>() <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">-></span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span>
{
fatalError(<span class="pl-s" style="box-sizing: border-box; color: #183691;" data-mce-style="box-sizing: border-box; color: #183691;"><span class="pl-pds" style="box-sizing: border-box;" data-mce-style="box-sizing: border-box;">"</span>Subclasses must implement retrieveText()<span class="pl-pds" style="box-sizing: border-box;" data-mce-style="box-sizing: border-box;">"</span></span>)
}</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">The idea here is that subclasses should always provide a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">retrieveText()</code> implementation, and therefore the call to <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">fatalError()</code> should never be hit.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">This has a few significant downsides:</p><ol style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">It forces the developer to write code that should never be executed under normal conditions. This seems like a waste.</p></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">Because a default implementation is provided--the one that calls <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">fatalError()</code>--the compiler has no way of knowing that the subclasses are supposed to provide an implementation, too.</p></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">If a subclass implementor forgets to provide a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">retrieveText()</code> function, the error will not be caught until runtime, and not until a user navigates to the affected portion of the application. This may not occur until the application has shipped.</p></li></ol><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-proposed-solution" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#proposed-solution" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#proposed-solution" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>Proposed Solution</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">The proposed solution involves adding support for abstract classes to Swift.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">This would entail:</p><ul style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">Allowing functions and properties to be declared <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code>. An abstract function or property declares the interface without specifying the implementation.</p></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">Allowing abstract classes to be defined by partially unimplemented protocol conformances. If a class declares conformance to a protocol without providing an implementation for each of that protocol's properties and functions, it is an abstract class.</p></li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="" data-mce-style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;">Requiring classes to be explicitly declared as <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> if it has one or more unimplemented functions or properties.</p></li></ul><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-detailed-design" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#detailed-design" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#detailed-design" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>Detailed Design</h2><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-abstract-functions" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-functions" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-functions" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"></a>Abstract functions</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Functions can be declared abstract using the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword, which must appear before the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">func</code> keyword in the declaration. Otherwise, the notation is identical to how the function would be declared if it were to appear in a protocol:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">public</span> abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">func</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;" data-mce-style="box-sizing: border-box; color: #795da3;">retrieveText</span>() <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">-></span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span></pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">As long as the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword appears before the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">func</code>, the order of appearance of the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword relative to any <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">public</code>, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">private</code> or <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">internal</code> access modifiers is not meaningful.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">The following declaration is equivalent to the one above:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;">abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">public</span> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">func</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;" data-mce-style="box-sizing: border-box; color: #795da3;">retrieveText</span>() <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">-></span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span></pre></div><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-abstract-properties" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-properties" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-properties" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"></a>Abstract properties</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Abstract property declarations are identical to what would be found in a protocol, but are prefixed with the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code>keyword, which must appear first:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;">abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> fileName: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span> { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> }
abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> favoriteColor: UIColor { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">set</span> }</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">As is typical with protocol declarations, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">var</code> is always used and not <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">let</code>.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-abstract-protocol-conformance" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-protocol-conformance" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#abstract-protocol-conformance" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"></a>Abstract protocol conformance</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">A class can be made abstract by declaring conformance to a protocol that it does not implement fully.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">For example, say you had a protocol <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Vehicle</code>:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">protocol</span> Vehicle
{
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> name: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span> { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> }
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> color: UIColor { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> }
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> numberOfWheels: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Int</span> { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> }
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> isParked: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Bool</span> { <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">get</span> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">set</span> }
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">func</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;" data-mce-style="box-sizing: border-box; color: #795da3;">driveTo</span>(destination: Location) throws
}</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">In your code, you're able to factor out everything except the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">driveTo()</code> function, the implementation of which is vehicle-specific. The common code goes into a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">BaseVehicle</code> class:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;">abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">class</span> BaseVehicle: Vehicle
{
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">let</span> name: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span>
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">let</span> color: UIColor
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">let</span> numberOfWheels: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Int</span>
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">var</span> isParked: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Bool</span>
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">init</span>(name: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">String</span>, color: UIColor, numberOfWheels: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Int</span>, isParked: <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">Bool</span> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">=</span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;" data-mce-style="box-sizing: border-box; color: #0086b3;">true</span>)
{
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">self</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">.</span>name <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">=</span> name
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">self</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">.</span>color <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">=</span> color
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">self</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">.</span>numberOfWheels <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">=</span> numberOfWheels
<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">self</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">.</span>isParked <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">=</span> isParked
}
}</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">The <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">BaseVehicle</code> class partially conforms to the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Vehicle</code> protocol: the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">name</code>, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">color</code>, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">numberOfWheels</code> and <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">isParked</code> properties are provided, but the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">driveTo()</code> function remains unimplemented.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">As a result, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">BaseVehicle</code> is an abstract class and must be declared as such.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-the-abstract-class-declaration" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#the-abstract-class-declaration" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#the-abstract-class-declaration" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"></a>The <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract class</code> declaration</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">A <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code> must be declared as <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> if any of the following are true:</p><ol style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">If the class declares one or more <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> functions or properties</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">If the class declares conformance to a <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">protocol</code> but does not supply implementations for every one of the functions and properties declared in that protocol.</li><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;">If the class inherits from an <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract class</code> and does not supply an implementation for every one of the unimplemented functions or properties.</li></ol><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Classes are marked as abstract by placing the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword before the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code> keyword at the top of the class declaration, eg.:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">public</span> abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">class</span> MyAbstractClass
{
<span class="pl-c" style="box-sizing: border-box; color: #969896;" data-mce-style="box-sizing: border-box; color: #969896;">// ...code...</span>
}</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">As long as the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword appears before the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">class</code>, the order of appearance of the <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">abstract</code> keyword relative to any <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">public</code>, <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">private</code> or <code style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="" data-mce-style="box-sizing: border-box; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0 , 0 , 0 , 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">internal</code> access modifiers is not meaningful.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">The following declaration is equivalent to the one above:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" data-mce-style="box-sizing: border-box; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class="" data-mce-style="box-sizing: border-box; overflow: auto; font-family: 'consolas' , 'liberation mono' , 'menlo' , 'courier' , monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: #f7f7f7; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;">abstract <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">public</span> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;" data-mce-style="box-sizing: border-box; color: #a71d5d;">class</span> MyAbstractClass
{
<span class="pl-c" style="box-sizing: border-box; color: #969896;" data-mce-style="box-sizing: border-box; color: #969896;">// ...code...</span>
}</pre></div><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-instantiation" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#instantiation" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#instantiation" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"></a>Instantiation</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Because an abstract class is not a complete implementation, the compiler will not allow instantiation of abstract classes.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">Attempting to instantiate an abstract class will result in a compiler error.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-impact-on-existing-code" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#impact-on-existing-code" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#impact-on-existing-code" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>Impact on Existing Code</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">None, since this does not affect any existing constructs. Implementation of this proposal will not result in any code breakage.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; background-color: #ffffff;"><a id="user-content-citations" class="anchor" href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#citations" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;" data-mce-href="https://gist.github.com/emaloney/d0b5bf7dd831d4f7415c#citations" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"></a>Citations</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;" class="" data-mce-style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff;">This idea has been discussed in the following <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;" class="" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;">swift-evolution</a> mailing list threads:</p><ul style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff; margin-bottom: 0px;" class="" data-mce-style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; color: #333333; font-family: 'helvetica neue' , 'helvetica' , 'segoe ui' , 'arial' , 'freesans' , sans-serif , 'apple color emoji' , 'segoe ui emoji' , 'segoe ui symbol'; font-size: 16px; background-color: #ffffff; margin-bottom: 0px;"><li style="box-sizing: border-box;" class="" data-mce-style="box-sizing: border-box;"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160222/010876.html" style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;" class="" data-mce-href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160222/010876.html" data-mce-style="box-sizing: border-box; background-color: transparent; color: #4078c0; text-decoration: none;">[Review] SE-0030 Property Behaviors</a><br data-mce-bogus="1"></li></ul><div class=""><br class=""></div></div></div></blockquote></div></div></body></html>