Disable UI flipping - ios

I'm building an app with only Arabic as the UI language
views built in storyboard are being flipped on runtime if device langauge is Arabic
I know that I can set semantic in Attributes Inspector to Force Left-to-Right or Right-to-Left but that doesn't always work and its time consuming process to set that up for each view.
What I'm trying to achieve is that I get the same UI without flipping regardless of the device language. Is there a way to set this up by code on global level?

Related

iOS UI hang when change language from app setting

Dallini UI Reflection Issue -
We are developing a multilingual app, where we need to support English and Arabic Languages, Application also provides an option in setting to change their language preference independent to what they have chosen in Settings of their iPhone. Considering Arabic is right to left language different to English, we are using the following code to change the navigation and UI flow.
UIView.appearance().semanticContentAttribute = .forceLeftToRight or UIView.appearance().semanticContentAttribute = .forceRightToLeft
However Our Application is lagging and behaving very slow in transition and Table Scrolls just after using this above code. We also tried commenting the above line just to make sure that this is the very same line which is creating this issue. We have also used the analysing tools and saw that after using this code It Increases the over all memory Utilisation.
Please suggest with the correct method/option to be used here as we already achieving the localised String file to manage the content in the application but we also need to reflect the UI and navigation according to the language preference he/she has set on the application independent of what is there in the settings.

How to change labelCount on tablet? (when more space is available)

We are developing an iOS app using Swift.
We have a tableView where each TableCell is expandable.
It currently looks like this. (Ignore the abbreviation of the time label, this is not intended)
When executed on a tablet the labels from the expanded sub cell should be moved to the parent cell, depending on how much space is available.
It would not be a problem if we have to make a separate scene for tablets and phones.
It would be beautiful, if we could change the display of those scenes directly in the interface builder, depending on which device is selected on the bottom bar.
What is the best (cleanest) way to achieve that?
Thanks in advance.
What you need sounds like the "vary for traits" option in Xcode 8, it allows you to have different configurations of the same view depending on the device(actually based on Width and Height settings) but it narrow down to device as you use it, if you click the vary for traits button in Xcode you will see the various options for W and H and you can see in real time how the devices changes depending on your selection. Just be a little bit careful about one thing, when you introduce a new setting you use the vary for traits button but after that you access it from the right hand side picker as normal.
You will see in Xcode 8 that some attributes have a small + sign next to them, that is where you will find your different traits after you have introduced them, it takes some getting used to but is very powerful once you get your head around it. It is also the recommended way to make adaptive applications in iOS

Mirror programming for uicontrols in xcode

I am new to multi-language app.
What I am doing is,
an app with two languages.
English & Arabic
The language of the app depends upon the device language.
(I want to change this too, that app language should be controlled from inside the app. not device dependant but thats next question)
I am having some controls like UIButton,UITextField,UILabel, etc....
When my app is in English I gave these controls frame starting from left corner of device, and when my app is in Arabic I gave them frames starting from Right corner of device. (As arabic is written from Right - to - left)
My Question is,
For this purpose I need to do extra work,
i.e. check device language and then set the frames of control.
on each view I may have "n" number of controls, and giving the frame sizes to all controls for both language doesn't seems good from my view.
Is there anything available in Xcode itself by using which I can do this.
means I need to give frames for default language (i.e. English) and if my device language is change to Arabic then frames of Controls will be automatically Mirrored from Right to left.
Following screens may give some idea.
(I used different frames for all those controls checking device language)
Any help is accepted.
Thanks in advance.
sorry If question is asked already. But I didn't find anything.
If anyone found then link to that is Welcome :)
From Supporting Right-to-Left Languages:
Your user interface should be mirrored when displaying right-to-left languages. If you use base internationalization and Auto Layout, most of the user interface will appear mirrored automatically for you. The text direction changes to right-to-left with the exception of phone numbers and country codes which are always left-to-right. Some views and controls in your user interface may not change direction automatically which you can fix programmatically.
They functionality you're looking for is called Auto Layout which was introduced a few years ago by Apple. It will handle lots of things you need, but there's also a lot to do for you. The guide above will guide you through the necessary steps.
Update from iOS 9.0:
iOS 9 brings comprehensive support for right-to-left languages, which makes it easier for you to provide a flipped user interface. For example:
Standard UIKit controls automatically flip in a right-to-left context.
UIView defines semantic content attributes that let you specify how particular views should appear in a right-to-left context.
UIImage adds the imageFlippedForRightToLeftLayoutDirection method, which makes it easy to flip an image programmatically when appropriate.
To learn more about providing a flipped user interface, see Supporting Right-to-Left Languages.

Autolayout with localization without restarting the app

My app supports both Arabic and English version and Autolayout handles alignment of text and UI elements. But a feature I need to add is a language switch button that immediately changes the language. I even need autolayout to adjust as per the language but doesn't seems to take effect unless the app is restarted. Any suggestions how to achieve this functionality.

How to make constant UI in English and Arabic in Blackberry?

I am making one application which can support English and Arabic language. My almost all code is done but now i am facing one problem that ,when i run application setting English language it looks great,but for arabic my UI get distrubed because English language has left allignment and Arabic has right allignment by default....what to do now ??please any one have idea then please help me.....waiting for reply
If it's about right align UI elements - use the Field.RIGHT style to have your components right align. It is left aligned by default. If you are using a HorizontalFieldManager you will also want to set the style for the scroll direction to be LEFTWARD.
To set the style pass in these in the components constructor OR'ed, so:
new myField(Field.RIGHT | Manager.LEFTWARD);
Use the Locale object to determine which language is currently set and set the alignment based on it.
APPROACH: Using third party library
Have a look at Arabic and English.
LWUIT UI library is pretty easy to create a common UI for both left-to-right and right-to-left languages. It might sound an uphill task now but going forward you will need to
support multiple ODM's
multipe screen device resolution
multiple flavors of VM, etc
LWUIT library resolves all these problems and to top it the library source code is licensed under GPLv2 with the classpath exception. This essentially means you can use this library in your commercial projects. It is supports most mordern Blackberry OS's.

Resources