Xcode does not detect custom font - ios

I added custom font in xcode, target membership is checked but it does not seen in custom fonts menu.
target membership
location
info.plist
copy bundle resources

You should add your custom font to info.plist too. did you do that ?
you should add a row with Fonts provided by application and enter your font names in that array

Project Name > Build Phases > Copy Bundle Resources.
You should see all font_name.ttf files listed. if you can't see that add your fonts files here. that should solve the problem.

I tried all the suggestions but it didn't work. Hardware reset resolved my issue

Related

Custom font importation

I'm having trouble adding a custom front on my IOS project on Xcode 9...
I tried everything proposed on this toppic: Xcode 9 custom fonts not working
but nothing worked out.
On my project, I got my FugazOne-Regular.ttf file, his target membership is set to my app. My Info.plist has Front provided by application and Item 0 is set to FugazOne-Regular.ttf. FugazOne-Regular.ttf is also in Copy bundle resources, in Build phases.
If I try to print every font name with something like this:
for family in UIFont.familyNames.sorted() {
let names = UIFont.fontNames(forFamilyName: family)
print("Family: \(family) Font names: \(names)")
}
I can see all the defaults fonts but no FugazOne-Regular or anything similar,
I tried deleting the font, cleaning the project but nothing changed...
(it is my first time posting here so tell me if I am doing anything wrong)
UPDATE: I thing this might be an Xcode bug, I'm using Xcode 9.4.1 but un macOS Mojave.
Repeat the following steps:
Import the font to the project by dragging it to Xcode and check Copy items if needed and your desired targets
Add into your .plist file (careful with spelling)
Drag the imported font from the project inside Xcode, NOT from Finder into Build Phases > Copy Bundle Resources

Add images in project in new Xcode 9

In new Xcode 9 I want to add images in project. But If I add images and try to use it in code or in storyboard my images not showing in simulator. But in Xcode 8 all works fine. How to fix it?
Note : This Problem does not Exist Anymore in newer XCode
If you have dragged image in your project, you must select Copy If Needed While adding any file into your project.
After Adding Image take a look at your image if it is available to target, I have face similar issue with other file types too.
In xcode9 it was not selected by default even after selecting copy if needed.
Yes - this is super annoying. With XCode 9, now in addition to dragging a new image into the XCode Project Navigator (the left-hand list of files), you now have to go into Targets for your project, go to "Build Phases" and manually add the image file to "Copy Bundle Resources" using the "+" button at the bottom of the list of files.
This is required for any object you used to have to just drag into the project, including third-party frameworks and bundles.
PS: in dragging the image into your project you don't have to have "Copy Item if needed" selected if the image file is already somewhere in your project folder or a subfolder thereof.
If you have to handle multiple images, it is probably more convenient to copy the resources to your target app in the General Settings > Build Phases > Copy Bundle Resources
Copy Bundle Resources
This does the same as checking Target Membership for the resource – but you can add multiple images to your target app at once.
Check release notes of XCode 9.1:
Adding files to a project now adds them to the selected targets. (34551617)
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html

Can't add custom font to Xcode

I'm trying to add a downloaded font to Xcode and I've folowed every single step based on this link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
I added the font to my Xcode Project,
included it in Copy Bundle Resources (Build Phases),
and typed it in Fonts Provided by Application (in Info.plist).
Then I typed this in GameScene.swift inside didMoveToView
It has worked with other fonts but not with this one. This is really frustrating me and I've got no idea what the problem is, thanks.
The name of the font is not always the name of the file. Try looking for the file and then opening in. It should automatically pull it up in font book, and the name of the font is located on the top bar. Simply enter that instead of the file name and it should work.

How to add a localization to a settings.bundle?

My app supports two languages. When I add a settings-bundle, it´s only in english. In Xcode 6.1 I found no way to add a localization to Settings.bundle. Did I miss something?
Nevertheless I found a working solution.
1) open Settings.bundle package
2) create new folder de.lproj (dont´t duplicate en.lproj - Finder don´t likes this)
3) copy Root.strings from en.lproj-folder to de.lproj-folder
4) now you can edit the new language in Xcode
It seems not working in Simulator. I am using Xcode 8.2.1.
OK. I find out the issue. In my Xcode project, the file Root.plist in Settings.bundle, there is one item missing: Strings Filename. I added this entry and set its value to Root, which is for language localization. With this missing item added, my app settings are working as expected in Simulator!
See my blog on this for more information.

Localizable.strings appear red in Xcode 4.6.3 Copy Bundle Resources Tab?

Hello I have different Localizable.strings in my app. I have also two targets.
I noticed that in the Build phases Copy Bundle Resources Tab two from the three Localizable.strings files appear to be red. even if I delete and add them again? what does this mean?
If I deploy the app the languages work but I have a problem with getting the default language to work. So I suspect the "red" to mean something bad?
One of the reasons for the red Localizable.strings or other Localization-files which can't be copied in the 'Copy Bundle Resources' can be the setting for the 'Localization native development region' in your Target settings.
This region should be added to the 'Localizations' of your project.
I.e. if the 'Localization native development region' is 'en', then 'English' should be added as Localization in your project settings.
Check your language codes against this list : http://www.loc.gov/standards/iso639-2/php/English_list.php
Dont worry about the red color. check changing your iphone language and see if your app shows the correct language if localized for that language. in my projects, i can see that the localization files are red in copy bundle resource, but it works. there might be something wrong with xcode. i see that since xcode 4.x with different projects.

Resources