UITextField auto-capitalization type - iPhone App

后端 未结 7 1579
故里飘歌
故里飘歌 2021-01-30 15:29

Is there a way to set the autocapitalizationType for a UITextField so that the first letter of each word is capitalized by default?

This Is A

7条回答
  •  悲哀的现实
    2021-01-30 15:53

    There is an answer for Obj-C, im here for Swift;

    textField.autocapitalizationType = UITextAutocapitalizationType.words
    

    or shorter way

    textField.autocapitalizationType = .words
    

提交回复
热议问题