That should be lot easier; just set yourself as the text field’s delegate and override textFieldShouldBeginEditing. Saagar Jha
> On Mar 21, 2017, at 12:24, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote: > > Alternately, is there a way to configure the alert to defer the launch of the > keyboard until/unless the user wants to edit the textfield (by touching it)? > Generally it won't need to be edited, maybe just the first time or so, thus > having the keyboard always coming up would be distracting. > > - Carl > >> On Mar 21, 2017, at 12:12 PM, Carl Hoefs <newsli...@autonomy.caltech.edu >> <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> Thanks for the hint. In the debugger I discovered that what looks to be a >> UITextField displayed across the bottom of the alert is actually implemented >> as a private object of class UIAlertControllerTextField. >> >> So I can restrict the text to a portion of the textfield, but I can't find a >> way to shorten the textfield's displayed width. Setting UIBorderStyleNone >> also has no effect. I can change the font characteristics, but no >> layout/display characteristics of the "textfield" itself appear to be >> directly changeable. >> >> -Carl >> >> >>> On Mar 20, 2017, at 10:05 PM, Saagar Jha <saa...@saagarjha.com> wrote: >>> >>> I haven’t tested this, but have you tried calling [self layoutIfNeeded] in >>> the completion block of [self presentViewController:animated:completion]? >>> >>> Saagar Jha >>> >>>> On Mar 20, 2017, at 16:09, Carl Hoefs <newsli...@autonomy.caltech.edu >>>> <mailto:newsli...@autonomy.caltech.edu> >>>> <mailto:newsli...@autonomy.caltech.edu >>>> <mailto:newsli...@autonomy.caltech.edu>>> wrote: >>>> >>>> iOS 10.2.1 >>>> >>>> I'm using UIAlertController -addTextFieldWithConfigurationHandler: to >>>> display an alert with a textfield. >>>> >>>> Is there any way to shorten the width of the displayed textfield? I've >>>> tried setting its frame/bounds, but it has no effect. >>>> >>>> -Carl >>>> >>>> _______________________________________________ >>>> >>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com >>>> <mailto:Cocoa-dev@lists.apple.com> <mailto:Cocoa-dev@lists.apple.com >>>> <mailto:Cocoa-dev@lists.apple.com>>) >>>> >>>> Please do not post admin requests or moderator comments to the list. >>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >>>> <http://lists.apple.com/> <http://lists.apple.com/ >>>> <http://lists.apple.com/>> >>>> >>>> Help/Unsubscribe/Update your Subscription: >>>> https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com >>>> <https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com> >>>> <https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com >>>> <https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com>> >>>> >>>> This email sent to saa...@saagarjha.com <mailto:saa...@saagarjha.com> >>> >> >> _______________________________________________ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com >> <mailto:Cocoa-dev@lists.apple.com>) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> <http://lists.apple.com/> >> >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu >> >> <https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu> >> >> This email sent to newsli...@autonomy.caltech.edu >> <mailto:newsli...@autonomy.caltech.edu> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com