<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Which swift version are you using? Your code works correctly for me on Swift 2.2 in the Playgrounds, apart from the wrong letter casing of the argument label (should be `URL`, not `url`).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">On the separate note, your usecase seems like a great place for writing an extension of NSMutableURLRequest&nbsp;instead of inheriting from it.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Best,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Krzysztof</div> <br> <div id="bloop_sign_1464672174845982976" class="bloop_sign"></div> <br><p class="airmail_on">On 30 May 2016 at 21:00:12, Michal Kalinowski via swift-users (<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div>Hello,</div>
<div><br data-mce-bogus="1"></div>
<div>I'm subclassing NSMutableURLRequest to patch lack of httpBody
property. My subclass doesn't implement any initialisers so it
inherits all the designated initialisers. From what I understand,
since all designated initialisers are implemented(inherited) then I
should also inherit convenience initialisers.</div>
<div><br data-mce-bogus="1"></div>
<div>My code:</div>
<div>
<p class="p1"><span style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span class="s1">class</span>
<span class="s2">safe_NSMutableURLRequest:</span> <span class="s3">NSMutableURLRequest</span> <span class="s2">{</span></span></p>
<p class="p2"><span style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span class="s4"><span class="Apple-converted-space">
&nbsp;</span></span> <span class="s2">#if</span> <span class="s2">os</span><span class="s4">(</span><span class="s2">Linux</span><span class="s4">)</span></span></p>
<p class="p1"><span style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span class="s2"><span class="Apple-converted-space">
&nbsp;</span></span> <span class="s1">var</span> <span class="s2">httpBody:</span> <span class="s3">NSData</span><span class="s2">?</span></span></p>
<p class="p2"><span style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span class="s4"><span class="Apple-converted-space">
&nbsp;</span></span> <span class="s2">#endif</span></span></p>
<p class="p1"><span class="s2" style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;">}</span></p>
<p class="p1"><span class="s2"><br data-mce-bogus="1"></span></p>
<p class="p1"><span class="s2" style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;">let someURL =
NSURL(string: "https://google.com")!</span></p>
<p class="p1"><span class="s2" style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;">let request
=&nbsp;</span></p>
<span class="s2" style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span style="color: rgb(0, 0, 0); font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: rgb(255, 255, 255);" data-mce-style="color: #000000; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;">safe_NSMutableURLRequest(url:
someURL)</span></span>
<p class="p1"><span class="s2"><span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">
<br data-mce-bogus="1"></span></span></p>
<p class="p1"><span class="s2"><span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">
the last line produces an error:</span></span></p>
<p class="p1"><span class="s2" style="font-family: 'courier new', monospace; color: rgb(255, 41, 104);" data-mce-style="font-family: 'courier new', monospace; color: #ff2968;"><span style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: rgb(255, 255, 255);" data-mce-style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;">
error: incorrect argument label in call (have 'url:', expected
'coder:')</span></span></p>
<p class="p1"><span class="s2" style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;"><span style="color: rgb(0, 0, 0); font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: rgb(255, 255, 255);" data-mce-style="color: #000000; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;">
<br data-mce-bogus="1"></span></span></p>
<p class="p1"></p>
<span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">Could
you please explain me why I'm not inheriting convenience
initialiser?&nbsp;</span>
<p class="p1"><span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">
<br data-mce-bogus="1"></span></p>
<p class="p1"><span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">
Regards,</span></p>
<p class="p1"><span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">
Michal Kalinowski</span></p>
</div>


_______________________________________________<br>swift-users mailing list<br>swift-users@swift.org<br>https://lists.swift.org/mailman/listinfo/swift-users<br></div></div></span></blockquote></body></html>