Drawing in iOS - Part 2: Styling with Layers | Ray Wenderlich Videos

Redesign your view with rounded corners, borders and shadows

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4659-drawing-in-ios/lessons/2

Hy Caroline,

Thanks for doing this course!

I tested the code on an iPhone 8 Plus simulator and a iphone 6 device but the rounding of the corners does not work the way it does in this video.

   let layer = sampleImageView.layer
    layer.cornerRadius = 30
    layer.shadowOffset = CGSize(width: 4, height: 4)
    layer.shadowOpacity = 0.3
    layer.shadowRadius = 5.0
    imageLayer.frame = layer.bounds
    imageLayer.contents = sampleImage?.cgImage
    imageLayer.masksToBounds = true
    imageLayer.cornerRadius = layer.cornerRadius

@dhakimi - can you give me some more information please? This is the result I get on the iPhone 8 plus simulator: