i\'m working on a project(Swift4,Xcode 9.2)
which has a feature to get text input and the blinking bar/line should be of big size (it should be S
You can change the size by overriding
the frame
method for cursor
as follows,
class CustomTextField: UITextField {
override func caretRect(for position: UITextPosition) -> CGRect {
var rect = super.caretRect(for: position)
let size = CGSize(width: 10, height: 50)
// Calculating center y
let y = rect.origin.y - (size.height - rect.size.height)/2
rect = CGRect(origin: CGPoint(x: rect.origin.x, y: y), size: size)
return rect
}
}
Set CustomTextField
class in xib/storyboard
identity inspector for that textField
.