I'm struggling with a stupid thing, I think ... Here is my problem. I want to get rid of my rounded gray border, making it hidden or transparent so that we can only see the shadows.
Here is my situation:

using the following code:
private func styleTextField(textField: UITextField)
{
textField.borderStyle = UITextBorderStyle.RoundedRect
textField.layer.borderWidth = 0.0
textField.layer.masksToBounds = false
textField.layer.shadowRadius = 4.0
textField.layer.borderColor = UIColor.whiteColor().CGColor
textField.layer.shadowColor = UIColor.grayColor().CGColor
textField.layer.shadowOffset = CGSizeMake(0.0, 0.0)
textField.layer.shadowOpacity = 0.4
}
But I want to get the following result:

Of course, I think I can achieve this, but I’ll integrate it into the presentation, but it’s not clean at all for such things.
Any idea on how to achieve this? Or fix it?
EDIT 1: Actual code after sentences. If it can help.
`class SignUpViewController: UIViewController {
@IBOutlet weak var facebookButton: UIButton!
@IBOutlet weak var connectButton: UIButton!
@IBOutlet weak var passField: UITextField!
@IBOutlet weak var emailField: UITextField!
@IBOutlet weak var nomField: UITextField!
@IBOutlet weak var prenomField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
emailField = self.styleTextField(emailField)
passField = self.styleTextField(passField)
nomField = self.styleTextField(nomField)
prenomField = self.styleTextField(prenomField)
self.styleButton(self.connectButton)
self.styleButton(self.facebookButton)
}
private func styleTextField(textField: UITextField) -> UITextField
{
textField.borderStyle = UITextBorderStyle.RoundedRect
textField.layer.borderWidth = 2.0
textField.layer.borderColor = UIColor.clearColor().CGColor
textField.layer.masksToBounds = false
textField.layer.shadowColor = UIColor.lightGrayColor().CGColor
textField.layer.shadowOpacity = 0.5
textField.layer.shadowRadius = 4.0
textField.layer.shadowOffset = CGSizeMake(0.0, 1.0)
return textField
}
} `
EDIT 2: The type of border when I create it in my storyboard.
Yours faithfully,
Hari