Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Sources/SurfaceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public class SurfaceAppearance: NSObject {
}
}()

@available(iOS 26.0, *)
public var cornerConfiguration: UICornerConfiguration? {
get { _cornerConfiguration as? UICornerConfiguration }
set { _cornerConfiguration = newValue }
}

private var _cornerConfiguration: Any?

/// The radius to use when drawing the top rounded corners.
///
/// `self.contentView` is masked with the top rounded corners automatically on iOS 11 and later.
Expand Down Expand Up @@ -376,6 +384,11 @@ public class SurfaceView: UIView {
}

private func updateCornerRadius() {
if #available(iOS 26.0, *), let cornerConfiguration = appearance.cornerConfiguration {
containerView.cornerConfiguration = cornerConfiguration
containerView.layer.masksToBounds = true
return
}
containerView.layer.cornerRadius = appearance.cornerRadius
guard containerView.layer.cornerRadius != 0.0 else {
containerView.layer.masksToBounds = false
Expand Down
Loading