---
title: "init(source:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/ciblendkernel/init(source:)"
---

# init(source:)

Creates a custom blend kernel from a program string.

## Declaration

```swift
convenience init?(source string: String)
```

## Parameters

- `string`: A program in the Core Image Kernel Language that contains a single routine marked using the kernel keyword.

## Return Value

Return Value A new blend kernel object, or nil if the specified source code does not contain a valid blend kernel routine.

## Discussion

Discussion This method is similar to the init(source:) method of the superclass CIKernel, but creates only blend kernels. Use this method when you want to ensure that the type of kernel object returned (if any) is always CIBlendKernel.
