Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使UITextField中的文本全部小写?_Ios_Swift_Firebase_Firebase Realtime Database_Uitextfield - Fatal编程技术网

Ios 如何使UITextField中的文本全部小写?

Ios 如何使UITextField中的文本全部小写?,ios,swift,firebase,firebase-realtime-database,uitextfield,Ios,Swift,Firebase,Firebase Realtime Database,Uitextfield,我对firebase有以下查询,firebase搜索用户名 let ref = Database.database().reference().child("UsernameIndex") ref.queryOrdered(byChild: "username").queryStarting(atValue: username).queryEnding(atValue: username+"\u{f8ff}").observeSingleEvent(of: .value)

我对firebase有以下查询,firebase搜索用户名

        let ref = Database.database().reference().child("UsernameIndex")
    ref.queryOrdered(byChild: "username").queryStarting(atValue: username).queryEnding(atValue: username+"\u{f8ff}").observeSingleEvent(of: .value) { snap in
问题是,如果我在任何时候键入upercase,它都不会进行搜索,那么如何使所有leters变为小写,或者使文本变为小写,或者使查询不区分大小写

我所能做的使文本小写的最好方法是:

        searchField.autocapitalizationType = .none
    searchField.autocorrectionType = .no
    searchField.spellCheckingType = .no

但这仍然允许用户输入大写字母

我只想将文本转换为小写的searchField.text.lowercased,并允许用户键入大写字母。这将避免用户在尝试键入大写字母时感到沮丧