select/highlight text ios - ios

In iOS 5 you can hold your finger on text and you can select/highlight text and it will bring up a popup menu. I'd like to implement that same functionality for an application I am developing. It doesn't seem like there is any easy way to do that. Can anyone refer me to a tutorial & example code?

It is pretty much a default behavior. Make sure that you have this in your code:
myTextView.userInteractionEnabled = YES

Related

How to use Swift Playgrounds-style code input keyboard/text field in normal text view?

I'm making an iPad app that lets me write swift code into a text box and save it to a document. It doesn't do any compilation or any complicated stuff like that, so I'm just looking for a way to format the code correctly in the text box (ex: code autocomplete, autoindent if possible, and maybe syntax highlighting). In short, I'd like my app's text field and keyboard to look similar to those of Swift Playgrounds.
If Apple's provided the code (or a built-in keyboard option that can do even some of this), I'd appreciate a link to it. Otherwise, how would I go about building a custom keyboard and text field (or at least disable the features like autocomplete that would get in the way)?
Thanks.
As far as I know the only way to do what you describe is to build a Swift Playgrounds app that presents a code editor window. Apple does provide documentation on creating third party iPad Swift playgrounds. I suggest looking it up on Apple's site.

How to highlight text in a textView in Swift?

I would like to highlight a part of text in a UITextView like Pages for iOS or Safari for iOS do. I search the documentation but I can't find a way to do it, maybe because I'm a beginner in iOS development and I miss some crucial info. Somebody can help me?
Screenshot of Pages for iOS:
Screenshot of Safari for iOS:
If you only need to highlight a single, contiguous block of text you can set the selection programmatically. Your examples show multiple discontinuous parts however. For that you are going to need to use an attributed string. There is no other system-provided highlighting function. (There might be a third party library that offers this though - you'll have to search.)

Spinner in iOS, like in Android

I am very first time developing the Spinner in iOS.
I searched a lot for default Spinner view in iOS, but failed.
What I get is, two ways to design spinner like view in iOS.
UIPickerview
Custom TableView which will be displayed on Click of DownArrow Button
I found the tutorial for UIPickerview.
But There are some OS orientation for this,
Means I want the UIPickerview in different Look & feel with selection style, also Scrolling of picker is not as I want.
So I was thinking to go for second options.
But Is there any other superior way to achieve this task,
As I think the second option is GOOD, but NOT BEST.
What I want is like the image below, its from Android,
I want to go for the same in iOS.
Thanks for help..
I think what you are looking is here
But I use RMPickerViewController which is more powerfull.

iOS 8 - UIKeyboard hide auto-correct ribbon

I'm looking to programmatically minimize the auto-correct ribbon found in iOS 8. Minimize meaning achieving the same effect as tapping and sliding the auto-correct ribbon down to hide/minimize it. I know how to remove it completely with _myTextView.autocorrectionType = UITextAutocorrectionTypeNo; - but this does not give the option to pull it back up if the user still wants it.
I haven't been able to find much about it. When I search for ...
hide autocorrect ribbon ios 8 sdk
Not much is returned of value. I've tried variations of that search but to no avail. Does anyone know if it's possible to do this?
Thanks in advance.
Currently i said no. Apple likes to give those kind of setting to the user only; not for developers. If you really need it off, you would have to design/create a Custom Keyboard.

Use stock keyboard as template for custom iOS 8 keyboard

I was wondering if it is possible to get the stock Apple keyboard design as a file to make a own custom keyboard with only slight changes to the original one.
I would like to only change one Key and was hoping that I don't have to build the whole design myself and try to imitate the original design.
Thanks in advance
I built a custom keyboard with the same look as the system keyboard (except it has only one "letter" key!): https://github.com/acoomans/ACKeyboard
I'm sure you can start from there and adapt it to your need. Good luck!
There is another custom keyboard with all the keys here. Looks like the might be a bit hacked together but could be another good place to start. https://github.com/archagon/tasty-imitation-keyboard

Resources