<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBMutableService/init(type:primary:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)CBMutableService(im)initWithType:primary:"
  },
  "title" : "init(type:primary:)"
}
-->

# init(type:primary:)

Creates a newly initialized mutable service specified by UUID and service type.

```
init(type UUID: CBUUID, primary isPrimary: Bool)
```

## Parameters

`UUID`

A 128-bit UUID that identifies the service.

`isPrimary`

A Boolean value that indicates whether the type of service is primary or secondary. If the value is <doc://com.apple.documentation/documentation/Swift/true>, the type of service is primary. If the value is <doc://com.apple.documentation/documentation/Swift/false>, the type of service is secondary.

## Return Value

A newly initialized mutable service.

## Discussion

For more information, see [Core Bluetooth Programming Guide](https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html#//apple_ref/doc/uid/TP40013257).

---

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)