<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ChooseRandomly",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents14ChooseRandomlyV"
  },
  "title" : "ChooseRandomly"
}
-->

# ChooseRandomly

Apply single transformation randomly chosen from a list of transformers.

```
struct ChooseRandomly<Element>
```

## Topics

### Creating an augmentation

[`init<RandomTransformer>(() -> RandomTransformer)`](/documentation/CreateMLComponents/ChooseRandomly/init(_:))

Creates a choose randomly augmentation.

### Applying transformers

[`func applied(to: Element, generator: inout some RandomNumberGenerator, eventHandler: EventHandler?) async throws -> Element`](/documentation/CreateMLComponents/ChooseRandomly/applied(to:generator:eventHandler:))

Chooses a random transformer from a list of transformers and applies the chosen transformer.

## Relationships

### Conforms To

[`RandomTransformer`](/documentation/CreateMLComponents/RandomTransformer)

---

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)