This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it possible to detect the current keyboard input method on the iPhone?
Get writing language of “uitextview” iphone?
How to get the current editing language of a UITextView object? I mean the CURRENT language of a UITextView keyboard
I don't have other words to say but the question editor requires some more text here lol
Do you mean the language used by the device that's accessing the textview? Couldn't you just get the language of the system? You could use:
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
(Not my code, found it here: Getting current device language in iOS? )
Edit: actually this is what you're after UITextInputMode you can read the docs here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInputMode_Class/Reference/Reference.html
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have
NSString *str=#"some unknown value coming from server";
NSString *localizedVersion1 = NSLocalizedString(str, nil);
NSLog(#"localizedVersion1 %#",localizedVersion1);
Getting:
localizedVersion1 some unknown value coming from server .
It's not changing even when I am changing the device language.
You have misunderstood the purpose of NSLocalizedString, it is not a translation service but a lookup one. With this mechanism an app can contain multiple sets of (UI) strings which are selected based on the current language setting. All the strings must exist in advance.
You mention using Google Translate on the web. If you need a translation service then you can use the Google Translate API in your app to provide this. There are other translation services available - just google for them.
HTH
This question already has answers here:
Swift: print() vs println() vs NSLog()
(6 answers)
Closed 7 years ago.
What is the difference between NSLog(), println, and print?
From my experience and understanding, they all write in the Console/Debugging area but why is there the change in Swift v1.2 and v2.0?
If you use 2.0 then print will offer more functionality, but they are still the same thing. Please refer to the documentation to see the added functionality.
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/
Also don't use NSLog if you are using Swift
This question already has an answer here:
Is there any way to get the tamper-proof date and time on iPhone?
(1 answer)
Closed 8 years ago.
So, I'm developing an app that is based on the time, but with NSDate an user can easily hack the application by changing system time of the device. So I might want to use a better method for retrieving time.
How can I do this? Is there an easy way to retrieve time from internet?
Checkout this Google Library: https://github.com/jbenet/ios-ntp
After the library is set up you can use it with the following line:
[NSDate networkDate];
A similar question has also been answered here: Get Date and Time from Apple Server
This question already has answers here:
Detecting current iPhone input language
(6 answers)
Closed 7 years ago.
I was able to retrieve the list of installed keyboards through NSUserDefaults and AppleKeyboards, but I wasn't able to find out which one is the current user selected. Anyway to do so programmatically?
Try using this:
[UITextInputMode currentInputMode].primaryLanguage
If you use NSLog, you will see something like fr-FR, pt-BR etc...
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How can one open a power point document in an iPad application?
I have to present a power point presentation from a web in an ipad application.Is there any free libraries in ios to convert .ppt format in to any other format ??How can I implement animations for that presentation .Please give some idea for implementing the above.
Thanks in advance
I have not tried this but Apple's documentation says that a UIWebView is able to display .ppt documents. Search for their tech. note QA1630 for a complete list of supported types.