Created
June 5, 2018 09:03
-
-
Save anthonyvitocuaderno/82dc1077b21738f39bc2bc4671a9abbd to your computer and use it in GitHub Desktop.
iOS Swift 3.3 UISearchBar extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UISearchBar.swift | |
// R2S | |
// | |
// Created by Vito Cuaderno on 5/7/18. | |
// Copyright © 2018 Total Integrated Resources. All rights reserved. | |
// | |
import UIKit | |
extension UISearchBar { | |
func textField() -> UITextField? { | |
for subView in self.subviews { | |
for subViewOne in subView.subviews { | |
if let textField = subViewOne as? UITextField { | |
return textField | |
} | |
} | |
} | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment