<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIHoverEffectLayer/init(containerView:style:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIHoverEffectLayer(im)initWithContainerView:style:"
  },
  "title" : "init(containerView:style:)"
}
-->

# init(containerView:style:)

Creates a [`UIHoverEffectLayer`](/documentation/UIKit/UIHoverEffectLayer) with the provided `containerView`
and `style`. If a `nil` `style` is provided, the automatic style will
be used instead.

```
init(containerView: UIView, style: UIHoverStyle?)
```

---

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)