Created
May 21, 2023 13:28
-
-
Save eonist/993171de9b1a69e15fb931d91ede6868 to your computer and use it in GitHub Desktop.
NSRectCorner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/** | |
* - Fixme: ⚠️️ deprecate? yes! | |
*/ | |
public struct NSRectCorner: OptionSet { | |
public let rawValue: Int | |
/** | |
* - Parameter rawValue: 0 to 3 | |
*/ | |
public init(rawValue: Int) { | |
self.rawValue = rawValue | |
} | |
} | |
/** | |
* Constants | |
* ## Examples: | |
* let corners = [.topLeft, .topRight] | |
*/ | |
extension NSRectCorner { | |
public static let topLeft = NSRectCorner(rawValue: 1 << 0) | |
public static let bottomLeft = NSRectCorner(rawValue: 1 << 1) | |
public static let topRight = NSRectCorner(rawValue: 1 << 2) | |
public static let bottomRight = NSRectCorner(rawValue: 1 << 3) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment