Implementing a localisable string in IOS with hyperlink - ios

I am building an app, and would like to create this feature.
"By using our services, you agree to our terms of service"`
This label/text should also be localisable in Japanese and German,
and when the user clicks on Terms of Service, the app should launch a webview to an external website.
I've tried UILabel and ActiveLabel, but they don't seem to be able to localise/translate.
Anyone have any ideas or suggestions?
Thanks and appreciated.

I've tried UILabel and ActiveLabel, but they don't seem to be able to
localise/translate.
ActiveLabel is merely a subclass of UILabel and I use it the same case with you for a tappable labels that opens up a UIWebView, therefore you can just pass a localised string to your activeLabel object easily.
For more information on how to do localisation, there are tons of resources here on Stackoverflow, Youtube, and Google.
Sample: https://www.youtube.com/watch?v=IV1x9FgQ5v0

Related

How to store and display styled text in iOS with Swift in a UITextView

I'm a beginner to iOS development and I'm learning how to build something along the lines of a note taking app using Swift, and I want to allow the user to bold, underline, and italicize text. Kind of like how it's done in Apple's Notes app. I'm using a UITextView right now, but that only allows for basic text input.
I want to know how these options are displayed to the user and also how to store this text information. Simply storing the user input as a string doesn't work because it has no way to retain the bold, underlined, and italicized portions (or maybe I'm missing something). Does apple have API for something like this? I have looked into NSAttributedString, but I'm not really sure if that works for this case.
Any help is greatly appreciated, thanks in advance!

How to detect link from tweets in ios native app

I am showing tweets in an iOS native app. I am showing the tweets on the UILabel in a UITableView.
I want user able to click on the link that are part of tweet text.
But the links in tweet text are not prefix by http:// or www. Instead, the link contains # and # as prefix.
I used UITextView with datadetector type property but not able to detect link.
I read some article that the UIWebView can be use to detect link; but I don't think I should use UIWebView in UITableView cell.
Is there any way to achieve this in iOS? My app supports iOS 5+.
There's nothing provided by the SDK that will do this out of the box, but the necessary pieces are there to build your own UILabel subclass that will handle this kind of data detection. If that's not something you want to take on, take a look at TTTAttributedLabel.

iPhone: Custom keyboard layout and theme

I am wondering if anyone knows how to or can like me to some documentation or tutorials on how to make custom iOS keyboard sets as well as theming the iOS keyboard. I have read everything I could find, watched many youtube videos and read related posts on here. Most are just making a keyboard from scratch with a bunch of buttons or just tell you how to use the other iOS layouts like email, keypad etc. I need to create a custom keypad set. It must be able to be done, the Wolfram|Alpha Calculus apps have custom keyboard layouts and modified themes. If anyone has any info, please send it my way!
Example from the wolfram app:

Links within UILabels to Native Functions

As the title conveys, I want to have a UILabel that will contain phone number, address, email, etc. and I am looking for a way to link to native functions (i.e. when a user clicks on phone number, the dialer is launched and when the address is clicked, the Maps are launched). I've tried to research this and seems like UILabels may not be formattable. One way I could do this is to create custom UIButtons, but that seems tedious in terms of scalability, and may not be the best solution.
Just to give some context, the same exact thing is possible in Android:
TextView someText = (TextView) findViewById(R.id.about);
someText.setAutoLinkMask(Linkify.ALL);
contact.setText("Toll Free: 888-888-8888");
Will work just fine and link the number to the phone dialer. It works the same with an address by redirecting to the Maps application.
Is this possible in iOS and if not, what are the workarounds?
Cheers.
Try the UITextView instead, and check out the dataDetectorTypes property.
What's wrong with using a UIButton and link it to an IBAction for each of the fields? Or maybe you can look into Segmented Control, though I personally don't have any experience with it.
https://github.com/mattt/TTTAttributedLabel
The above link has custom label to your requirement

Format web links in a UITextView

I know that I can put a link in a UITextView such as "http://stackoverflow.com/" and have it auto detected. I want to know if there is a way to set the UITextView so that the link appears as "Visit StackOverflow" in the UITextView, or if I have to use a UIWebView to do that. I'm fairly sure that I have to use a UIWebView, but I want to make sure.
As far as I'm aware you can't do that, and from reading other posts it appears that there is an undocumented method, but that would get you app rejected (http://stackoverflow.com/questions/2454067/display-html-text-in-uitextview). Why not simply use a web view? As that is what it is designed for! ;)
Jonathan

Resources