<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/CustomHoverEffect/hoverEffect(_:in:isEnabled:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17CustomHoverEffectPAAE05hoverE0_2in9isEnabledQrqd___AA0dE5GroupVSgSbtAaBRd__lF"
  },
  "title" : "hoverEffect(_:in:isEnabled:)"
}
-->

# hoverEffect(_:in:isEnabled:)

Applies this effect in parallel with the given `effect`.

```
func hoverEffect(_ effect: some CustomHoverEffect, in group: HoverEffectGroup? = nil, isEnabled: Bool = true) -> some CustomHoverEffect
```

## Parameters

`effect`

A [`CustomHoverEffect`](/documentation/SwiftUI/CustomHoverEffect) to combine with this effect.

`group`

An optional [`HoverEffectGroup`](/documentation/SwiftUI/HoverEffectGroup) to add this effect to.

`isEnabled`

Whether `effect` is enabled or not.

## Discussion

Use `hoverEffect(_:)` to combine two effects into a single effect that
applies both effects in parallel. Modifiers like
[`hoverEffectDisabled(_:)`](/documentation/SwiftUI/CustomHoverEffect/hoverEffectDisabled(_:)) applied to `effect` will
not apply to this effect.

For example, in the following effect only the `ScaleUpEffect` is
disabled, since modifiers applied to that effect are applied
independently.

```
struct FadeAndScaleEffect: CustomHoverEffect {
    @Environment(\.accessibilityReduceMotion) var accessibilityReduceMotion
    func body(content: Content) -> some CustomHoverEffect {
        content
            .hoverEffect { effect, isActive, _ in
                effect.opacity(isActive ? 1 : 0.9)
            }
            .hoverEffect(
                ScaleUpEffect().hoverEffectDisabled(accessibilityReduceMotion)
            )
    }
}

struct ScaleUpEffect: CustomHoverEffect {
    func body(content: Content) -> some CustomHoverEffect {
        content.hoverEffect { effect, isActive, _ in
            effect.scaleEffect(isActive ? 1.05 : 1.0)
        }
    }
}
```

- Returns a new effect that applies both effects in parallel.

---

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)