Is there a way to set style or look and feel for ipad application as it works for java applications?
In particular, i want to set my custom Font application-wide, so that all buttons/labels/whatever created would use my Font by default. All that i found so far concerning fonts suggests that every single control i create should be set up individually. Is it so or is there way to set up default Font properties for whole project?
This is usually a bad idea from the UI viewpoint, therefore there is no “skinning” support in iOS. (Java has it different, because it wants to support different systems with different UI metaphors.) If you want to use a custom font, you can create custom subclasses of the UI components that will set your font after awaking from NIB or after the instance is created in code.
Related
I followed the Apple guide to add a custom font to my application. It does work only if I also add the font to my system. If I don't I get the following error when opening a storyboard which contains the custom font:
Font “AlmaMono-Bold” does not exist on this system, substituting the system font instead. Saving the document will lose the original font reference.
Is it required to add the custom font to the system or is there other way to do it? There are two main problems with requiring to add the font to the system:
If some other dev wants to work on the project, he gotta remember to add this custom font to his system.
How to handle it in the Continuous Integration server? I use fastlane to build the application and send to the store, but the font was not working.
A storyboard does not magically look in your project for fonts. So opening a storyboard will not display a font unless that font is available on your machine as a whole.
The usual approach is to set the font in code, not in the storyboard.
I have completed making an IOS app. Now its been final and was ready to upload, but suddenly I was given a task to apply a new thing in the app and that is as Under
When user increases text size From the Settings > Accessibility > Larger Text or from Settings > Display And Brightness > TextSize now my app text appearance must change accordingly.
What I want: As I told you above that app is completed, and as I have used too many UILabels, UIButtons and UITextViews, so I am finding a way to how to change their text size accordingly to newly changed text size by the user. Is it possible to add any extension that increase the text size of app in more generic way. so that I do not have to go to every view in storyboard to make the view of dynamic type.
The process of changing and converting every view or coding in every class will be cumbersome. Is there any short way to handle it while everything is already completed.
Please help thanks.
The process of changing and converting every view or coding in every class will be cumbersome. Is there any short way to handle it while everything is already completed.
I'm sorry to tell you that implementing the Dynamic Type feature in an already existing app is never easy and quick to be done.
It's like making the design, it takes time and requires conception for adapting the ergonomic a11y to provide the best user experience.
Even if many things can be done in the Interface Builder, I prefer to handle everything in code because you can mutualize many properties and methods while it's element by element in the IB.
Among other things, you'll have to:
Use the text styles and activate the adjustsFontForContentSizeCategory properties of your elements to have an automatic update of your system font size.
Listen to the traitCollectionDidChange method that belongs to the UITraitEnvironment informal protocol to be aware of the font size settings changes.
Use dynamic values for adapting all your constraints so as to reorder appropriately every single element and make the containers fit their contents according to the different font size settings.
Adapt and customize every Large Content Viewers to enlarge UI elements when the Dynamic Type can't be applied (only since iOS 13).
There's no magic trick to make an app with the Dynamic Type support: you have to know how it works and then build every element as you do in your daily programming.
Hereunder few links that may help to reach your goal:
A detailed summary of the WWDC video 'Building Apps with Dynamic Type' where every steps are explained with a complete example in the end.
Some code snippets (ObjC + Swift) and illustrations to provide explanations for code implementation.
Few outlines to have in mind when testing a Dynamic Type implementation.
All these information could help you make your app with the Dynamic Type support.
I have developed the application in ios. It is working fine. I have converted it as a framework(library) so that My codebase remain same.
I have multiple clients for this app. So I need to change the following things
Colors (As it will change the background colors, text colors etc)
Strings (Like headings and labels in some views)
Some files like Images etc
What I want:
As I am android developer, So in that I can create another color file in my client app with same color name, that replaces the color value in Library. and this it just require only one file to be replace and it automatically overrides in library. Same was the case with the String.xml and image files
Looking for something like that as I have described above.
What I searched and found so far:
After searching alot I have found that I need to make outlets public and then I can give them color by accessing them. But What If I have a 1000 of views and 1000s of outlets to make to use this technique, Isnt it better to use it as same way as in android I described above.
Confusions:
Is there anyway in IOS to declare color in a file and to use them in IB and code as well. Well I read about Color.xcassets but that is for ios 11 I think
How to make strings file and to use them in IB and in code. Like strings.xml file in android?
So I short, I want to updated colors,Strings and file per client wise and I do not know how to do it and what is a best way of doing this??
Please help and thanks in advance. Please share your views.
You should configure your framework to read from predefined files in .plist file. this will require only changing the files content in the client application.
Easy way to handle colors and theme using SkinKit. This is too old code. You just reuse idea or create custom themes configuration file(plist,JSON),Strings and images as .bundle read all color and customization from that bundle. So easy to change Colors, Strings and Images assert for various clients.
You seem to have a misconception about what IB is — in particular, what a nib is, and what it means to edit a nib, which is what Interface Builder does. A nib is a file expressing potential instances, typically views. You edit it on your computer using Xcode (IB). When your app runs, the nib is loaded and the views are actually instantiated. That is the only thing you can do with a nib when the app runs. You cannot modify the nib in some way when the app runs; all you can do is load the nib and get the instances.
So, if you want to change all the titles of buttons or all the colors of views when your app runs in accordance with some configuration file, you can do that, but that has nothing to do with nibs or IB. You would just load the nib as usual to get the views, and then change them all, one by one, in code. You could use tags or some other identification mechanism to help you find each view, but that would be entirely up to you to work out.
I'm looking to use size classes for the first time with my iOS8+ project to port my iPhone app to iPad. I've used autolayout to create my storyboard but I intend on using a UISplitViewController for the iPad to make use of the extra screen real estate.
From my googling on the subject it appears size classes may be limited to changing constraints rather than changing the type of controller used? I've not read this specifically but cannot find any example of changing the type of controller used. Are size classes not usable for this scenario?
Size classes allow you to enable / disable a constraint based on the size of the device. There is no facility to run conditional logic. If you need a fundamentally different UI, you will need separate storyboards. Having 2 completely different UI's in the same storyboard, toggled on / off via size classes will get very complex, very quickly. Size classes are best used for small changes.
That being said the UISplitViewController is more complex than you think. You can hide / show the detail in varying ways using size classes. This can then be used as the starting point for both iPhone / iPad and toggle it on / off as need be using size classes (assuming that the rest of the app will remain largely the same).
I'd suggest doing more research on the topic. Try reading article such as this one. It will then be up to you to decide if your use case needs 2 sets of storyboards or 1 set with size classes.
Simple question. Does anyone know why Interface Builder doesn't allow for applying custom styles on UI elements? Why is it only possible to do this programmatically?
I can see how this might be difficult for custom UIView subclasses but the default controls definitely only have a tiny subset of the style options available through IB, such as background color or changing font colors. Why is this the case? Is there any way to approach a concept like application themes through IB?
My personal feeling is that Apple does this right. They provide the elements and styles that fit the HIG. If they start adding other elements/styles then where do the start, and where do they draw the line?
Also, it isn't like Apple actively prevents using custom elements/styles, they just don't include it in the tool set.
The last thing we need is a tool set full of bloat.
You'd really have to ask Apple as to the why. I'd guess that it's some combination of promoting consistent use of standard interface elements and limited development resources.
You can, of course, build interfaces using your own custom subclasses of the standard interface elements in IB. It's a little more work, since you have to change the type of each object you add from UIButton to MyGreenButton or whatever, but it's not difficult.
It's also not hard to imagine coming up with a controller-type class that could connect to all your controls and whatnot to customize their appearance in some consistent, theme-like manner. Add an instance of that to each nib, connect all the controls, and let it do it's thing. You wouldn't see the effect until you actually run the app, of course, but it sounds like you're talking about customizing colors and fonts rather than size.
Unfortunately you are at the mercy of the Almighty Apple Deity..... Bow at their feet and give thanks that you have what they give you..... lol...
Seriously tho. Apple puts in what apple wants and you can request additions, but the IB is fairly minimal in the way of features.
I think this may be by design. Somehow an Elegant Simplicity ?
The ability to customize the controls is given to the programmer however I think they want the controls standardized. I just dont know why they didnt give a little more variety in the controls that are available. Like a few more button styles for the ios devices...
If you find out otherwise I would definitely be all ears.
I think that apple should let you to customize more the controls, for games it takes too much time to make the custom control ( you can make it faster in android as you can configure it in xml)
Btw PaintCode is another option to make your own style for components, it will generate the code but its more like interface builder
http://www.paintcodeapp.com/