[swift-users] Exclamation mark's in swift parameter listings?

Daniel Dunbar daniel_dunbar at apple.com
Mon Jan 9 18:24:51 CST 2017


It is an "implicitly unwrapped optional", or IOU.

See:
  https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html

 - Daniel

> On Jan 9, 2017, at 4:23 PM, Ethin Probst via swift-users <swift-users at swift.org> wrote:
> 
> Hello all,
> I was wondering what an exclamation mark in a swift parameter listing
> means. For instance, I used Elements Oxidizer Live to translate some
> C# code into Swift. Reviewing it, I found the following (among
> others):
> @DllImport("ScriptHookV.dll")
> private static __extern func scriptRegister(_ module: System.IntPtr!,
> _ LP_SCRIPT_MAIN: LP_SCRIPT_MAINDelegate!)
> What I'm wondering is what does the '!' in that list of parameters
> mean? I also saw it when writing another program:
>    func MainForm_Load(_ sender: System.Object!, _ e: System.EventArgs!) {
> // ...
> }
> I don't recall the swift book teaching you what that means, so could
> someone tell me what those mean?
> -- 
> Signed,
> Ethin D. Probst
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list