UITextView Font reversing back to System Default - ios

I have set up a custom font for the UITableView overall in my app. I wrote this in my AppDelegate
UITextView.appearance().font = UIFont(name: "Avenir", size: 14.0)
So that the font of all of the UITextView's changes to that custom font.
So when I load my app, the font appears as system font in the home page, but everything else has the custom font, if I go to a different view in the app and I go back to the home page for a brief moment I see the custom font
but then after the background app refresh it goes back to this:
I'm not exactly sure what's going on in here. The other textViews have the custom font, and there's nothing messing around with the front in the background refresh either.
Note: The only font that changes back to system default is the black one, the other ones are labels and are working fine.
Any help would be appreciate it.

It turned out that I had to click on selectable in the UITextView in the Storyboard. It works good now!

Related

UIBarButtonItem tintColor issue while setting bold text on in accessibility

UIBarButtonItem tintColor is not getting change after setting Bold Text On in Settings -> Display & Brightness -> Bold Text.
i am facing this issue in iOS 11 & 12 both. haven't checked in previous versions.
The same question is already asked in apple developer forum but i didn't find any answer there.
https://forums.developer.apple.com/thread/89337
if some one have any work around to this please suggest me.
You can try to do it programmatically using NSAttributedString, I have never done it trough the storyboard, but programmatically using array of [NSAttributedString.Key.font: .systemFontOfSize(size: 25), NSAttributedString.Key.foregroundColor: .blue], etc., works like a charm.
One method that works for me is changing the Global Tint option on the storyboard, of course this is not the perfect solution.

TextView's font i not changing in storyboard

as you can see in the above i'm trying to change my textView's font , but it didn't changing i searched some related terms on changing for like this one
and this , but nothing worked for me
i'm also not sure if this is the correct name of my desired font or not
titleTextView.font = UIFont(name: "Myriad-Condensed", size: 25)
even in this site they dont have anything related to my desired font which is Myriad pro Condensed according to storyboard's attribute inspector
anyone faced anything similar to this before ?? or any clue what i should do ? then please let me know
First you need a font to use. Download any of them in you cass its right here : http://ufonts.com/fonts/myriadpro-cond.html
After downloading drag & drop the font file (otf or ttf) into your project
Make sure you check the box next to your target or the font won’t actually get included in your app (even though it’ll probably show in Interface Builder).
Open up the Info.plist . Add a new array of strings to it: “Fonts provided by application”. Add the filenames for each font you want to use as String entries in the array. (That one ttf file you just added to your project )
Now you're good to go , select that font once again like you did in the attached image.
For more detail see this article https://grokswift.com/custom-fonts/

System font thin shown in Interfacebuilder but not on iPad

I want some labels to have the thin style font. For this I use the system font thin or ultraligth. In Interfacebuilder it looks exactly how I want it to look. But starting the App on Simulator or iPad the labels font doesn't change, it is still the systems basic font.
Anyone an idea?
Solved this problem. The labels had all a custom class. So if you make changes on Interface Builder it seems first that your App would take the uifont you have choosen on Interface Builder because the label appears immediately with the correct font , but in fact it takes its customClass.

Can't change font in XCode 6.1.1

Within XCode 6.1.1 I'm unable to change the font on my label within my storyboard. I can set 'Text' to either 'Plain' or 'Attributed', but then [T] next to Helevetica Neue 17.0 appears grayed out, and it does not do anything when I click it. This happens in all of my projects.
Screenshot here: https://i.imgur.com/3VOSsVn.png
Thank you!
Edit: Unfortunately none of the answers below have answered my question yet. The [T] is unclickable.. it is grayed out so I can't change the Font to custom under there. And while I could go in and enter code to change the font, I would prefer to do it through the GUI.
This problem was driving me crazy - your workaround works for the normal storyboard, but not for the Watch storyboard which has a custom fonts popup.
I finally found this page:
https://github.com/synergy/synergy/issues/4109
It's a bug with using Synergy - I connected a USB mouse to my Mac and when I click the font "T" icon with the USB mouse, it works!!!!
Actually, you have to first select a syntax category in the detail area. You can press CMD+A to select all categories. Then you can click the "T" and select a new font.
See here: https://developer.apple.com/library/ios/recipes/xcode_help-fonts_and_colors_preferences_help/Recipe.html
In the "font", change "system" to "custom”
You can set font for labels in two ways- programmatically and in storyboard.
In your storyboard, you need to click the little T and then select the wanted font.
In your code, assuming you already set the appropriate IBOutlets, you can use something like
[self.theTextLabel setFont:[UIFont boldSystemFontOfSize:17.0]];
Tap on the "T" sign next to the already assigned font, then change "system" to "custom”. Once the settings are on custom the font can be changed as well as it's weight (ie. light, bold...)
I did find a workaround... I can bring up the font menu by crtl-shift-opt-T and change the font there and changes I make are reflected on the page... but the [T] is still still grayed out for some reason.

ios label with attributed text fonts not displaying correctly

labels in xcode aren't correctly displaying some fonts even though attributed text is selected...
In storyboards I have some labels that I changed the text from "plain" to "attributed" but the fonts I wont to use wont display correctly - instead xcode, or whatever is controlling it, displays what seems to be a fall-back font.
Any workaround?
Reasons why?
I'm trying to use schoolhouse cursive b (and yes it does show up in the list of fonts)...
The iOS Devices don't have the font schoolhouse cursive b preinstalled:
Font list iOS7
Font list iOS6
If you want to add a custom font, have a look at this answer.

Resources