File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -991,13 +991,17 @@ FlexLayout also adds methods to set common UIView properties.
991991
992992* ** ` backgroundColor(_ color: UIColor) ` **
993993Set the flex item's UIView background color.
994+ * ** ` cornerRadius(_ value: CGFloat) ` **
995+ Set the flex item's UIView rounded corner radius.
994996
995997###### Usage examples:
996998``` swift
997999 // Create a gray column container and add a black horizontal line separator
9981000 flex.addItem ().backgroundColor (.gray ).define { (flex) in
9991001 flex.addItem ().height (1 ).backgroundColor (.black )
1000- }
1002+ }
1003+ // Set rounded corner
1004+ flex.addItem ().cornerRadius (12 )
10011005```
10021006
10031007<br >
Original file line number Diff line number Diff line change @@ -1207,6 +1207,23 @@ public final class Flex {
12071207 }
12081208 }
12091209
1210+
1211+ /**
1212+ Set the view to rounded corner
1213+
1214+ - Parameter value: value specifies the view's layer cornerRadius.
1215+ - Returns: flex interface
1216+ */
1217+ @discardableResult
1218+ public func cornerRadius( _ value: CGFloat ) -> Flex {
1219+ if let host = self . view {
1220+ host. layer. cornerRadius = value
1221+ return self
1222+ } else {
1223+ preconditionFailure ( " Trying to modify deallocated host view " )
1224+ }
1225+ }
1226+
12101227 //
12111228 // MARK: Display
12121229 //
You can’t perform that action at this time.
0 commit comments