Skip to content

Commit

Permalink
Fix cornerCurve property availability compilation fail (#548)
Browse files Browse the repository at this point in the history
With Xcode 14 Beta 1 library fails to compile with following error.

> Stored properties cannot be marked potentially unavailable with `@available`

Because CALayerCornerCurve is not marked with any @available annotation it is possible to declare private optional storage of it.
  • Loading branch information
asiliuk authored Jun 13, 2022
1 parent 0bc9812 commit bacc871
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/SurfaceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public class SurfaceAppearance: NSObject {
///
/// Defaults to `.circular`.
@available(iOS 13.0, *)
public lazy var cornerCurve: CALayerCornerCurve = .circular
public var cornerCurve: CALayerCornerCurve {
get { _cornerCurve ?? .circular }
set { _cornerCurve = newValue }
}

private var _cornerCurve: CALayerCornerCurve?

/// An array of shadows used to create drop shadows underneath a surface view.
public var shadows: [Shadow] = [Shadow()]
Expand Down

0 comments on commit bacc871

Please sign in to comment.