Skip to content

Instantly share code, notes, and snippets.

@eonist
Created May 21, 2023 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eonist/993171de9b1a69e15fb931d91ede6868 to your computer and use it in GitHub Desktop.
Save eonist/993171de9b1a69e15fb931d91ede6868 to your computer and use it in GitHub Desktop.
NSRectCorner
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