Re: Custom font for UIAlertAction
Re: Custom font for UIAlertAction
- Subject: Re: Custom font for UIAlertAction
- From: Doug Hill <email@hidden>
- Date: Tue, 15 Dec 2015 12:32:59 -0800
What I do is use the Appearance proxies to customize the button, not the UIAlertController. For example, use the Appearance proxy to set font of a button when contained in a UIAlertController.
Doug Hill
> On Dec 15, 2015, at 12:09 PM, Eric E. Dolecki <email@hidden> wrote:
>
> It would appear that the UIAlertController (UIAlertAction) does not conform to appearance proxies. Here is a list of controls that do (up to iOS 8.0)
>
> On Tue, Dec 15, 2015 at 2:09 PM Doug Hill <email@hidden <mailto:email@hidden>> wrote:
> I will echo the sentiments NOT to poke around into view hierarchies which aren’t public parts of the interface. It might work now but you will lose in the long run when Apple changes something, which they will.
>
> I suggest looking into using Appearance proxies. You can change just about any style/appearance of UI controls, either app-wide or when controls are contained in a specific view controller. I’ve done this for many UIKit views/controllers with great results, particularly when there isn’t a public interface to modify their style.
>
> Doug Hill
>
>
> > On Dec 15, 2015, at 10:43 AM, David Duncan <email@hidden <mailto:email@hidden>> wrote:
> >
> >>
> >> On Dec 15, 2015, at 10:23 AM, Wojciech Czekalski <email@hidden <mailto:email@hidden><mailto:email@hidden <mailto:email@hidden>>> wrote:
> >>
> >> I dont recommend it either but it is possible to do it this way. It requires extensive testing etc. If done properly however won't crash your app if anything but will silently fail.
> >
> > What I’m saying is that UIKit won’t guarantee that this won’t someday crash your application. Doing things like this is wholly undefined, do not do them.
> >
> >>
> >> Wysłane z iPhone'a
> >>
> >> Dnia 15.12.2015 o godz. 18:04 David Duncan <email@hidden <mailto:email@hidden>> napisał(a):
> >>
> >>>
> >>>> On Dec 15, 2015, at 8:53 AM, Wojciech Czekalski <email@hidden <mailto:email@hidden>> wrote:
> >>>>
> >>>> Yes, you can recursively iterate through the alert view's subviews and check for a UILabel and set the font on it. It's hacky but I don't think there's another way
> >>>
> >>> Do NOT do things like this. The view hierarchy is considered private and the results of any changes you make are not guaranteed to continue working into the future.
> >>>
> >>>>
> >>>> Wysłane z iPhone'a
> >>>>
> >>>> Dnia 15.12.2015 o godz. 15:44 Eric E. Dolecki <email@hidden <mailto:email@hidden>> napisał(a):
> >>>>
> >>>>> I am hoping to change the font for the buttons in a UIAlertController (not
> >>>>> the color, just the face as the styles give me what I want). It doesn’t
> >>>>> appear I can use an attributedString (takes String) - is there any action I
> >>>>> can take to achieve this besides subclassing?
> >>>>>
> >>>>> Eric
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden