XCODE: 如何在用户完成搜索后从我的搜索栏中隐藏光标?

XCODE: How do I hide the cursor from my searchBar after the user is done searching?

我已经不知疲倦地查看了SO,但还没有找到如何做到这一点。用户完成搜索后,如何从我的搜索栏中隐藏光标?它只是在用户不需要时一直闪烁。

对于正常的UITextFields,如果将tintColor 属性设置为.clear,光标会隐藏。 同样,对于 UISearchBar,我会尝试

let sb = UISearchBar()
sb.searchTextField.tintColor = .clear

let sb = UISearchBar()
sb.tintColor = .clear

如果有效请告诉我。