<!--
{
  "availability" : [
    "macOS: 10.7.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreWLAN",
  "identifier" : "/documentation/CoreWLAN/CWInterface/startIBSSMode(withSSID:security:channel:password:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core WLAN"
    ],
    "preciseIdentifier" : "c:objc(cs)CWInterface(im)startIBSSModeWithSSID:security:channel:password:error:"
  },
  "title" : "startIBSSMode(withSSID:security:channel:password:)"
}
-->

# startIBSSMode(withSSID:security:channel:password:)

Creates a computer-to-computer (ad-hoc) network with the given network name, security type, and password on the specified channel.

```
func startIBSSMode(withSSID ssidData: Data, security: CWIBSSModeSecurity, channel: Int, password: String?) throws
```

## Parameters

`security`

The security type to be used.

`channel`

The channel on which the network will be created.

`password`

The password to be used. This paramter is not applicable to open system authentication.

## Discussion

If *name* is *nil*, the machine name will be used as the network name. This operation may require an administrator password.

> Handling Errors in Swift:
> In Swift, this method returns `Void` and is marked with the `throws` keyword to indicate that it throws an error in cases of failure.
> 
> You call this method in a `try` expression and handle any errors in the `catch` clauses of a `do` statement, as described in [Error Handling](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html) in [The Swift Programming Language](https://docs.swift.org/swift-book/) and `About Imported Cocoa Error Parameters`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)