---
title: "CFPlugInSetLoadOnDemand(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpluginsetloadondemand(_:_:)"
---

# CFPlugInSetLoadOnDemand(_:_:)

Enables or disables load on demand for plug-ins that do dynamic registration (only when a client requests an instance of a supported type).

## Declaration

```swift
func CFPlugInSetLoadOnDemand(_ plugIn: CFPlugIn!, _ flag: Bool)
```

## Parameters

- `plugIn`: The plug-in to be loaded on demand.
- `flag`: true to enable load on demand, false otherwise.

## Discussion

Discussion Plug-ins that do static registration are load on demand by default. Plug-ins that do dynamic registration are not load on demand by default.

## See Also

### CFPlugIn Miscellaneous Functions

- [CFPlugInAddInstanceForFactory(_:)](corefoundation/cfpluginaddinstanceforfactory(_:).md)
- [CFPlugInFindFactoriesForPlugInType(_:)](corefoundation/cfpluginfindfactoriesforplugintype(_:).md)
- [CFPlugInFindFactoriesForPlugInTypeInPlugIn(_:_:)](corefoundation/cfpluginfindfactoriesforplugintypeinplugin(_:_:).md)
- [CFPlugInGetBundle(_:)](corefoundation/cfplugingetbundle(_:).md)
- [CFPlugInGetTypeID()](corefoundation/cfplugingettypeid().md)
- [CFPlugInIsLoadOnDemand(_:)](corefoundation/cfpluginisloadondemand(_:).md)
- [CFPlugInRemoveInstanceForFactory(_:)](corefoundation/cfpluginremoveinstanceforfactory(_:).md)
