File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
Example Apps/SparrowKit.xcodeproj
project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad
Sources/SparrowKit/UIKit/Extensions Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 334334 Base,
335335 );
336336 mainGroup = F43F827226578D83001D9B3D;
337+ packageReferences = (
338+ );
337339 productRefGroup = F43F827C26578D83001D9B3D /* Products */;
338340 projectDirPath = "";
339341 projectRoot = "";
Original file line number Diff line number Diff line change @@ -317,8 +317,13 @@ extension UIView {
317317
318318 - important:
319319 Need call after changed frame. Better leave it in `layoutSubviews` method.
320+
321+ - parameter curve: Style of round curve.
320322 */
321- open func roundCorners( ) {
323+ open func roundCorners( _ curve: CornerCurve = . continuous) {
324+ if #available( iOS 13 . 0 , * ) {
325+ layer. cornerCurve = curve. layerCornerCurve
326+ }
322327 layer. cornerRadius = min ( frame. width, frame. height) / 2
323328 }
324329
@@ -420,6 +425,21 @@ extension UIView {
420425 self . alpha = 0
421426 } , completion: completion)
422427 }
428+
429+
430+ public enum CornerCurve {
431+
432+ case circle
433+ case continuous
434+
435+ @available ( iOS 13 . 0 , * )
436+ var layerCornerCurve : CALayerCornerCurve {
437+ switch self {
438+ case . circle: return . circular
439+ case . continuous: return . continuous
440+ }
441+ }
442+ }
423443}
424444#endif
425445
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22
33 s . name = 'SparrowKit'
4- s . version = '3.3.6 '
4+ s . version = '3.3.8 '
55 s . summary = 'Collection of native Swift extensions to boost your development. Support tvOS and watchOS.'
66 s . homepage = 'https://github.com/ivanvorobei/SparrowKit'
77 s . source = { :git => 'https://github.com/ivanvorobei/SparrowKit.git' , :tag => s . version }
You can’t perform that action at this time.
0 commit comments