<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "visionOS: 1.0.0 - 1.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelCollection/endAccessing(identifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLModelCollection(cm)endAccessingModelCollectionWithIdentifier:completionHandler:"
  },
  "title" : "endAccessing(identifier:)"
}
-->

# endAccessing(identifier:)

Terminates access to a model collection.

```
class func endAccessing(identifier: String) async throws -> Bool
```

## Parameters

`identifier`

The name of the model collection.

## Discussion

Use this method when your app no longer needs access to a model collection.

```objc
[MLModelCollection endAccessingModelCollectionWithIdentifier:modelCollectionName
                                           completionHandler:^(BOOL success,
                                                               NSError * _Nullable error) {
    if (success) {
        NSLog(@"Successfully ended access to `%@`.", modelCollectionName);
    }
    else {
        NSLog(@"Error ending access to `%@`: %@", modelCollectionName, error);
    }
}];
```

---

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)