Last time (xcode 9.4) revealed a few incomprehensible bugs to me. 1-the text in the back Bar Button button is not deleted, 2- the shadow for the button created by the program is not added, when launched on the simulator and device there is no shadow. Has anyone encountered this or not?

text removal

override func viewDidLoad() { super.viewDidLoad() navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) } 

enter image description here

shadow for the button in viewDidLoad

 var button = UIButton() override func viewDidLoad() { super.viewDidLoad() button.frame = CGRect(x: 150, y: 200, width: 80, height: 80) button.setTitle("+", for: .normal) button.setTitleColor(UIColor.white, for: .normal) button.backgroundColor = UIColor(red: 245/255, green: 105/255, blue: 144/255, alpha: 1.0) button.titleLabel!.font = UIFont(name:"Gill Sans", size: 23) button.layer.shadowColor = UIColor.black.cgColor button.layer.shadowOffset = CGSize(width: 5, height: 5) button.layer.shadowRadius = 5 button.layer.shadowOpacity = 1.0 button.layer.cornerRadius = 0.5 * button.bounds.size.height button.clipsToBounds = true button.addTarget(self, action: #selector(addList), for:.touchUpInside) self.view.addSubview(button) } 

    1 answer 1

    In order to remove / change the text of the "back" button, write the one you need in the Storyboard , in the highlighted input field:

    enter image description here

    for the previous controller. Or also in the code.

    With a shadow - is it only at 9.4?

    • The fact is that I have this field on all controllers empty, so you only need a button with an arrow, no text ... And it appeared with a shadow, as updated xcode, it was not there before. Although it may not be related to this - Artur Skachkov
    • @ArturSkachkov is the problem, which is empty. Put a space, for example. By the shadow you need more info - VAndrJ
    • And I put a space, and I enter another word, it still does not react, it is not empty, and the word does not display it. In the question added a screen with a storyboard and the full code on the shadow. - Artur Skachkov
    • @ArturSkachkov can you attach a sample project with this problem? With a shadow because of button.clipsToBounds = true, it should be false (by default it is already false) - VAndrJ
    • With the shadow it is, I needed false, oh ... Thank you. And on the button here is the assembly yadi.sk/d/-aOmUOkK3YVB2W - Artur Skachkov