OC版本
[textField setValue:[NSNumber numberWithInt:10] forKey:@"paddingTop"];
[textField setValue:[NSNumber numberWithInt:10] forKey:@"paddingLeft"];
[textField setValue:[NSNumber numberWithInt:10] forKey:@"paddingBottom"];
[textField setValue:[NSNumber numberWithInt:10] forKey:@"paddingRight"];
swift版本
textField?.setValue(NSNumber(value: 10), forKey: "paddingLeft")
设置textField左边距10
至于placeholder的边距,可以在placeholder字符串前加几个空格
比如:" 输入数字"