XCode: Use decimal pad that ALWAYS displays dot '.' and not comma ',' - ios

I am new to Swift and this is my first application. I essentially want a user to enter two numbers, that I can use for some calculations. For the text fields I used the option "Decimal Pad" as keyboard type. With the simulator it works well - on my phone, however, the dot is shown as a comma, which causes the app to crash. Is there an easy fix for this problem? I don't want any global changes for the location or the keyboards used, but just a fixed decimal pad with dot instead of comma.
Thank you!

Related

iOS Keyboard Fixed Local setting ill-respect to Phone County/Language setting

In Code I am Using Decimal type keyboard on a text field to enter decimal number. But when I change the phone country/language in phone settings from to Spain then my Decimal keyboard gets changed. The decimal (.) button converting to (,) and hence user unable to enter decimal point.
I Want that my keyboard should not change with phone country language getting change. Keyboard local should always be English(US) "en_US". Please help.

Why change the keyboard type "decimal pad " from application to another?

When you choose Keyboard Type, sometimes appear as in Figure 1 and another as in Figure 2 ,,,
  What is the reason?
Figure 1 :-
Figure 2 :-
I want as in the first form all my applications.
in addition to tomsterritt answer, decimal pad can differ between the device languagem for example in a english keyboard the decimal will be a point "." , while in a brazilian portuguese keyboard the decimal will be ",".
try changing languages and see for yourself.
The examples you've added are from different versions of iOS - the system style of the decimalPad keyboard type has changed over time.
If you want a non-system keyboard style you can implement your own. Your desired style should not be too difficult as it has a fairly basic layout & functionality.

iOS simulator cannot get custom location when debugging

After updating to Xcode 5.0.2, it seems that iOS simulator custom location option is not working propertly. When I prompt this
And reopen again the custom location dialog
I end getting the lat/lon values without decimals. Also, if I prompt a . instead of a comma, some times the dialog replaces the point with a comma, and sometimes deletes the decimal values. I've tried closing the simulator, changing hardware and restarting Xcode with no results.
There is a bug in the modal "Custom Location" window of iOS Simulator that affects users who have the comma set as the decimal number separator.
If you type the coordinates with the format XX,XX and you press OK, the numbers after the comma are truncated.
Try inputing both coordinates with the format XX.XXX ( 2 digits + a point (.) + 3 digits) then press OK, then quit the iOS Simulator. When you launch it again, it'll have the desired location.
If you go to the same "Custom location" windows you are going to visualize the coordinates in format XX,XX, but DO NOT PRESS OK in that windows, just press Cancel, because if you press OK they will be truncated again.
You can use this Macro #if (TARGET_IPHONE_SIMULATOR) and manually set a custom location in your code.
Hope it helps
It seems that the iOS Simulator is accepting only decimals with dot instead of comma.
For your language (spanish, I think), the Mac OS put comma in decimal numbers. I had the same problem because my Mac OS is in portuguese, that uses the comma as default for decimal numbers.
To change this setting, go to System Preferences > Language & Region > Advanced... and change the Decimal value in the number separators from comma (,) to dot (.) (you can change the currency separators if you want).
Than, every time you open the custom location prompt, decimal numbers of lat/lon values will appear with dot instead of comma.
I hope it has helped you, I couldn't post images because of my poor reputation.
In Xcode,Product -> Scheme -> Edit Scheme... (command + <).
Select Run/Debug from Side Menu, options tab Select "Allow Location Simulation" and select a default location to none. The default location is the reason for custom location changing.
Set your custom Lat/Long to Simulator...

kasra not displayed on iOS

When I write arabic text containing the letter kasra (unicode character 0x650, phonetic equivalent i) to a button, the kasra is not displayed. Thus, the word mumkin appears as mumkn. If I inspect the NSString in Xcode, the kasra is present, but the kasra is not displayed in the iPhone simulator or on a real iPad. The other two short vowels (fatha and damma) are displayed correctly.
The arabic letter kasra (unicode character 0x650) is missing from all of the built-in IOS7 fonts that i have tried.
The solution was to build a different font into my app- I used AGA-Rasheeq-Bold.
This may be a bug. I just tried it in the storyboard editor and it does not seem to work. I created a string in the MAC Notes application, copied and pasted. It displays correctly in the left hand properties panel, but not in the button itself. Could you provide the exact Unicode string? You may need to open a bug report with Apple.
I can confirm that it works correctly in a Label field, but not a Button (IOS 6.1 and Xcode 4.6.3)
Try attributed text. This seems to work around the issue.

Can the iOS keyboard be programmed not to automatically insert a period for two spaces?

On the iOS platform, I have a UITextField where I am using the ASCII keyboard layout. I notice (like the keyboard works in other apps) that when I type space + space, a period '.' is inserted into the text field. This is all normal iOS stuff...
But can I configure the text field or the keyboard somehow so that this "two spaces == period" behavior is turned off?
One possible solution (albeit not a perfect one) has been posted here ... http://www.mailinglistarchive.com/phoenix-iphone-developer-group#googlegroups.com/msg00037.html

Resources