<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/barsSwipeTransition()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)barsSwipeTransitionFilter"
  },
  "title" : "barsSwipeTransition()"
}
-->

# barsSwipeTransition()

Transitions between two images by removing rectangular portions of an image.

```
class func barsSwipeTransition() -> any CIFilter & CIBarsSwipeTransition
```

## Return Value

The transition image.

## Discussion

This method applies the bar swipe transition filter to an image. The effect transitions from one image to another by a series of moving bars passing over the target image.

The bar swipe transition filter uses the following properties:

- `inputImage`: The starting image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `targetImage`: The ending image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `time`: A `float` representing the parametric time of the transition from start (at time 0) to end (at time 1) as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `angle`: A `float` representing the angle of the motion as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `width`: A `float` representing the width of the bars in pixels as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `barOffset`: A `float` representing the offset of one bar in relation to others as a <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that produces falling bars from the input image to transition to the target image:

```swift
func barSwipe(inputImage: CIImage, targetImage: CIImage) -> CIImage {
    let barSwipeTranstion = CIFilter.barsSwipeTransition()
    barSwipeTranstion.inputImage = inputImage
    barSwipeTranstion.targetImage = targetImage
    barSwipeTranstion.time = 0.5
    barSwipeTranstion.angle = 0.09
    barSwipeTranstion.width = 30
    barSwipeTranstion.barOffset = 10   
    return barSwipeTranstion.outputImage!
}
```

![Three photographs. In the photo on the left, multiple sets of small purple flowers are photographed close up with good lighting, and the background has a slight blur. In the photograph on the right is a tall city building with two trees directly in front of the building. The center photograph is a snapshot of the moment that the bar swipe transition creates, where the left photo slowly fades away by sized bars moving out of frame, revealing the city building.](images/com.apple.coreimage/media-3616431@2x.png)

---

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)