Is @IBAction just a syntax in Swift or does @Something mean a particular thing in Swift?

Solutions Collect From Internet About “Is @IBAction just a syntax in Swift or does @Something mean a particular thing in Swift?”

These are attributes in swift.They have some special meaning for compiler.For eg: @UIApplicationMain synthesize main.swift file by compiler as entry point for application.From swift guide

Attributes provide more information about a declaration or type.
There are two kinds of attributes in Swift, those that apply to
declarations and those that apply to types.

Apply this attribute to a class to indicate that it is the application delegate. Using this attribute is equivalent to calling
the NSApplicationMain function and passing this class’s name as the
name of the delegate class.

If you do not use this attribute, supply a main.swift file with a main
function that calls the NSApplicationMain function. For example, if
your app uses a custom subclass of NSApplication as its principle
class, call the NSApplicationMain function instead of using this

Here is whole list of attributes in swift

From apple swift blog

In Xcode, Mac templates default to including a “main.swift” file, but
for iOS apps the default for new iOS project templates is to add
@UIApplicationMain to a regular Swift file. This causes the compiler
to synthesize a main entry point for your iOS app, and eliminates the
need for a “main.swift” file.

Alternatively, you can link in an implementation of main written in
Objective-C, common when incrementally migrating projects from
Objective-C to Swift.

write code in main.swift.It will work as enty point for application

import Foundation
import UIKit

UIApplicationMain(C_ARGC, C_ARGV,nil, NSStringFromClass(AppDelegate))