Replacing resources and colors app ios - ios

I have an App (in Android and iOS) that I want to duplicate, changing only the layout (colors, images and some strings). In Android I can do this easily, by using Ant build scripts
In iOS I would need to change multiple elements from Xibs and some images on resources.
I just can't find anything similar for iOS, being it native on XCode or not.
Any link to a framework would be appreciated.
Thanks in advance

I ended up creating a different target, and so I could assing different .strings and images to each target.
I also used NUI to restyle some Xibs.

Related

Different versions of app for different devices - iPhone to iPad

I'd like to take my existing iPhone app and modify its layout/number of screens for an iPad.
I began by duplicating the Target with "Duplicate and Transition to iPad".
But I'm unsure where to go after that. I'll need a new Storyboard and some of the functions/viewControllers/views will need to be modified. Where/how do I do that?
All I can find are very old solutions that are no longer valid or leave too much out:
How to convert iPhone app to iPad app
This is the best one I've found, but again not current and still leaves a lot out:
http://innovationm.co/convert-iphone-application-to-universal-application/
I no longer see a "Universal" option. I am guessing that selecting all of these accomplish the same thing?
First, edit your target to make sure it is set for both iPhone and iPad:
Second, using two different storyboards is unusual nowadays, but you can easily do it. In your Info.plist configure two entries (using Raw Keys and Values): UIMainStoryboardFile and UIMainStoryboardFile~ipad. The result is that your app will load one storyboard for an iPhone and a different storyboard for an iPad.
Note that with a newer created project that uses window scenes under iOS 13 and later, you would configure UIApplicationSceneManifest and UIApplicationSceneManifest~ipad to specify different UISceneStoryboardFile values.
Here's a downloadable project that demonstrates the newer structure:
https://github.com/mattneub/Programming-iOS-Book-Examples/tree/master/bk1ch09p358universal

Xamarin Image Assets for Size Classes

I am building an universal Xamarin application for iOS. I am working on the launch screen, and trying to use size classes to modify the layout for iPhone and iPad devices. The positioning works correctly, but when I try to set the image assets things go wrong.
I am trying to use the size class feature on the XCAssets file within Xcode to set the correct image I want for the different screen sizes. I have an image set for [any, any] ([,]) for the iPhone, and then I have one set for the [regular, regular] ([+, +]) for the iPad.
In Xcode's interface builder I can see the correct image in my launch xib file when switching between the [any, any] and [regular, regular] size classes. However, when I run this in my iPad simulator I do not see any images at all. Note that when I run the app in my iPhone simulator the [any, any] images are picked up correctly. It's only when running on my iPad simulator things go wrong.
I have resorted to using Xcode's tools as I cannot find a way within Xamarin to get images within a single image set for different size classes. I believe the issue I'm running into must be an issue within Xamarin not respecting the properties set in Xcode.
My question is has anyone been able to get this to work on Xamarin, and if so how?
Thanks!
Ok, so I found the solution. It appears to in fact be a bug within Xamarin and has todo with Xamarin not always updating the XIB files correctly.
Firstly, do not use the size class options inside of the XCAsset file within Xcode. Simply use the Xamarin version of the tool, and set the iPhone and iPad variations of the image set. I used the naming scheme [image_name][#2x|3x].[ext] for iPhone graphics and the scheme [image_name]~ipad[#2x|3x].[ext] for the iPad variants. However, keep in mind that according to the Apple documentation when you use size classes the ~ipad suffix is ignored. I simply use this suffix to make the file names unique between iPhone and iPad.
Second, go ahead and use size classes as you wish, but do not worry about changing the graphic name, and do not worry about the fact that you will not see an image preview when in the [regular, regular] class.
Third, before running the app use the Xamarin clean command at least once, but sometimes it takes a couple of attempts to fully clean the solution.
After theses steps the image assets worked for me for the iPad via [regular, regular] size class. I know it seems hacky, and may not be the "Xamarin" or "Apple" way of doing things, but it works.
Hope this helps someone else not spend two hours of their life dealing with Xamarin's short comings :)

How to permanently add font to Xcode

I have some nice fonts that I like to use in my iOS applications. However, it is slightly annoying to add the font to Xcode every time. Is there a way I can keep add a font permanently to a project so it will stay in there forever? Please let me know if I am not being specific enough. Thanks!
Unfortunately only standard iOS fonts are "permanently" in Xcode. Other fonts have to be added in manually when you want to use it in a specific project.
This is because when you add the font it is included in your bundle when uploaded to the app store vs. the system fonts already being on the iOS system.

When I built my game in xcode all the gui textures/texts look different(unity3d)

I put all these GUI textures and texts and they look the way I want in the editor but when I ran it on my iphone from xcode it looks so different. All the GUI Textures and Texts are in different sizes and places. Why did that happen? Second question, if I have to fix it, do I have make the xcode project again and summit it to itunes connect again? Thanks.
You didn't design your GUI with multiple screen sizes in mind.
This is a basic concept in creating a UI that most tutorials will go over, including the documentation for the default GUI system.
Using absolute positions and sizes results in UI that cannot scale to other screen sizes and resolutions.
It is also common practice to provide two versions of your UI's textures, one for standard DPIs, such as those found on older Apple devices, and most computer screens, and one for ultra-high DPIs, such as those found on Retina displays.
In the editor you can get an idea of what your UI will look like with the Game View, which this tutorial goes over.
Once you have fixed your UI, you will need to make a new xcode project, and you will need to resubmit it.

iOS app Icon - how to?

Can someone explain me or link - I have 512x512 icon but I have no idea what icons sizes I need to create and how to add them in to my iOS app. What sizes I need and how to add them, and for what?
The Apple documentation has all you need to know.
In a nutshell: 57x57 for non-retina iPhone or iPod Touch, 114x114 for retina display, and 72x72 for iPad.
Ive put all the images named correctly at the correct size into a github repo, so there can be no confusion.
https://github.com/FattusMannus/iOS-Development-Image-Placeholders
Just download them as a zip, edit them and copy them into your project
AH
In the current 5.x xCode version you can use app icon set (AppIcon.appiconset). In the picture you can see where you can found it. Here is online tool, Icons Master, which will take care how icons should be big naming convection as well.
Specific name doesn't matter's any more for ios icon. All you need is perfect size.
I have created this application which will provide you all the icons based on information provided here. Get the application from here, and follow the instructions in readme file to create all the required icons for iOS application.
Download Asset Catalog Creator Free from iTunes. All you have to do is select a base image, and the program will create all required iOS icon sizes for you and place them neatly in an .xcassets file, which you can simply drag into Xcode without worrying about the sizes/resolutions of individual icons.
Question was asked a while back but the answer changes from time to time. Here are a few web tools that are updated with the latest requirements and get the job done:
http://www.theappicon.com/ or
https://resizeappicon.com/
Drag and drop the .xcassets folder that they return into your xcode assets catalog and it should populate your app icons as you need them.

Resources