Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

add top corner radius swift

extension UIView {
   func roundCorners(corners: UIRectCorner, radius: CGFloat) {
        let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
        let mask = CAShapeLayer()
        mask.path = path.cgPath
        layer.mask = mask
    }
}
Comment

swiftui rounded specific corner

extension View {
    func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View {
        clipShape( RoundedCorner(radius: radius, corners: corners) )
    }
}
Comment

how to add corner in swiftui

extension UIView {
   func roundCorners(corners: UIRectCorner, radius: CGFloat) {
        let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
        let mask = CAShapeLayer()
        mask.path = path.cgPath
        layer.mask = mask
    }
}
Comment

swiftui rounded specific corner

struct RoundedCorner: Shape {

    var radius: CGFloat = .infinity
    var corners: UIRectCorner = .allCorners

    func path(in rect: CGRect) -> Path {
        let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
        return Path(path.cgPath)
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: make text autoresize swiftui 
Swift :: convert secondsfrom1970 to date swift 
Swift :: uilabel center text programmatically swift 
Swift :: Swift guard-let Statement 
Swift :: adding label to navigation bar 
Swift :: fetch request core data 
Swift :: swift initialize array with size 
Swift :: variable sum in swift 
Swift :: Swift Access Array Elements 
Swift :: tap to delete xcode 
Swift :: repeat...while Loop Swift 
Swift :: abs swift 
Swift :: how to create button action programmatically in ios 
Swift :: editbutton swiftui color text 
Swift :: how to darken view swiftui 
Swift :: enums With Raw Values Swift 
Swift :: swift memberwise initializer 
Swift :: how to have diffrent size images in a stack view swift 
Swift :: Swift if...else 
Swift :: swift uibutton text resets to default 
Swift :: How to Hide Password in Text field Swift 
Swift :: swift get all cases starting with 
Swift :: get device height spritekit 
Swift :: how to add two right bar button item xcode 
Ruby :: If the version you need is missing, try upgrading ruby-build. linux 
Ruby :: remove ruby 
Ruby :: ruby replace first character in string 
Ruby :: List and delete migration from rails console 
Ruby :: function is uninitialized constant ruby 
Ruby :: concatenate arrays in ruby 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =