You can accept a UITextFieldDelegate object in your static methods and assign it ti the delegate and for your second problem you are declaring weak self but not using it in the closure so just remove that and your code should work fine.