What type of value [.layerMaxXMinYCorner, .layerMinXMinYCorner]? Is it possible to set this parameter in the view in the interface builder? I know how to set layer.borderWidth, layer.borderUIColorand layer.cornerRadiusin the Identity Inspector, but I can not determine the correct type and value for masked angles.
[.layerMaxXMinYCorner, .layerMinXMinYCorner]
layer.borderWidth
layer.borderUIColor
layer.cornerRadius
Thank!
Jake
Update: here are the integer values for each combination (in terms of which are rounded):
8-15
3, 7, 11, 15
maskedCorners - CACornerMask, OptionSet . : someView.layer.maskedCorners.rawValue someView.layer.maskedCorners.setValue(3, forKey: "maskedCorners").
maskedCorners
someView.layer.maskedCorners.rawValue
someView.layer.maskedCorners.setValue(3, forKey: "maskedCorners")
, layer.maskedCorners 3 ( , ) Interface Builder, , . , , , , .
layer.maskedCorners
, , c:
( 🌚)
@IBDesignable class ViewController: UIViewController { // Preprocessor macro, you won't be able // to use code inside this "if" statement from your... code // Just use cornerMask property directly #if TARGET_INTERFACE_BUILDER @IBInspectable var topLeft: Bool = false { didSet { updateCornerMask() } } @IBInspectable var topRight: Bool = false { didSet { updateCornerMask() } } @IBInspectable var bottomLeft: Bool = false { didSet { updateCornerMask() } } @IBInspectable var bottomRight: Bool = false { didSet { updateCornerMask() } } func updateCornerMask() { cornerMask = CACornerMask( TL: topLeft, TR: topRight, BL: bottomLeft, BR: bottomRight) } #endif var cornerMask: CACornerMask? } extension CACornerMask { init(TL: Bool = false, TR: Bool = false, BL: Bool = false, BR: Bool = false) { var value: UInt = 0 if TL { value += 1 } if TR { value += 2 } if BL { value += 4 } if BR { value += 8 } self.init(rawValue: value) } } // And yeah maybe using UIView makes more sense 🙃
Source: https://habr.com/ru/post/1690396/More articles:Taking the address of a function from within this function - cScala throws an exception when I try to run it on ubuntu - javaПризнать шаблон: какая система порождает параметры строки запроса? - query-stringС++ Использование лямбда для неявного вызова конструктора, ожидающего указателя функции - c++How to populate Pandas dataframe as a function of index and columns - pythonSklearn train_test_split; saving unique values from columns (s) in a training set - pythonCrash webcams for iTunes Connect? - iosУстановите камедь capyabara-webkit на Amazon Linux AMI - ruby-on-railsСохранение адреса пересылки и данных. Какая разница между STD и STA в руководстве по оптимизации Intel? - performanceWhat is the name of this type of program - raspberry-piAll Articles