How to create custom keyboard like real keyboard in iOS? - ios

I have to create custom keyboard like the real keyboard in iOS.
I need to do following like keyboard.
like that.
How can i create like that?
Please tell me , because i'm just new beginner.

Here's something that I created that might help. Just fork it on GitHub and change the Punjabi characters to Myanmar. Most of the hard work is done for you :)
https://github.com/kulpreetchilana/Custom-iOS-Keyboards

With a custom view and custom buttons. The keyboard itself is something very easy to do, you just need to place some buttons on a view and then show that view.
Your real problem will be connecting the button actions to the text field.
You would have to check for the first responder and then add to its text the value corresponding to your custom keyboard. It will be an even more difficult problem to actually "type" those weird characters from the keyboard in the text field. I am not familiar with them, are those real ASCII characters?
Anyway, you're in for quite some work. It's not something very difficult to code, requiring some complicate algorithms, but the implementation will be tricky and complex, so be careful

Related

Output specific images when user taps the keyboard

I want to output a image when a user taps on the keyboard. Let's say the user taps A on the keyboard in a UITextView. Instead of outputting the normal A, I want to output the picture of an Ape.
If a user taps "S" I want to output the image of a sun. Is this possible with out having to make a customized keyboard?
Besides creating a custom keyboard yourself, there isn't really a neat method to getting an image output.
One thing you could do is program Swift to automatically recognise the letter input and display an image over or replacing the letter as a result.
To do this, assign a variable to your editable UITextView or UITextField. If you are using XCode you can do this by control-dragging the text field into your code and it will automatically create a weak var, but you can change the strength in the pop up box that appears.
Since you now have a variable, there are two options as to how you display the image. One way is rather boring and will clutter your code, but essentially involves this, which I have simplified for the purposes of demonstration:
if UITextInput == a {
// add image
}
You would have to repeat this for every letter of the alphabet.
Or you could create a dictionary in which each letter corresponds to each image, and find a way to cycle through them, depending on the user's input. Even though this is harder to program for a newbie, it makes the code much neater and quicker.
This is the link to the official Apple documentation on dictionaries:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html#//apple_ref/doc/uid/TP40014097-CH8-ID113
However, since I assume you are programming an app for the younger market, I would recommend creating a custom keyboard as it will be easier in the long run.
Hope this helps,
will

UITextField not responding to touch in iOS8?

So I have multiple UITextFields in my storyboard, but there is one isolated field that will not respond to any touch (neither in the simulator nor on the device) for all iOS versions, besides on the very right side of the field? This may have something to do with the constraints/frame of the field, but I have tried resolving autolayout issues, but nothing seems to work.
This is what my storyboard looks like (with the malfunctioning UITextField selected):
And this is what the simulator looks like:
Any ideas? There is very little functionality code-wise, so I imagine this is an Xcode formatting thing.
Form the picture it looks like the picker is actual over the textfield. It doesn't look like it but those are rather tall. You could try panning on the text field and see if the picker moves. Also you can try hiding it and see if that changes anything.
Good luck and hope that helps.

iOS Add Image to TextField

I am experimenting a little bit witch apps programming.
How I can add a UIImage to a UITextField"?
Like Whats App or the most other Chat Apps.
I have search some time but doesn't find a solution, also i have tried to search in side of XCode with the auto complete but I have not found a function. So I hope you can help me.
The easiest way to add an image to a text field is to have a UIView that contains both UITextField and a UIImageView as subviews.
Next up, you can have a UIButton with both an image and text, and just set userInteractionEnabled to "NO" and it'll behave like a text view with an image next to it.
Now to get more complicated, if you want a chat-like text field that allows text (that you can type into) and images next to each other, you need to start thinking about custom subclasses. Other people have asked and have gotten answers for this same approach.

How can I get the size of the keyboard on iPhone?

I want to get the keyboard size without using NSNotification. When I press the plus button, it can replace the keyboard with a custom UIView like this:
Then the plus button is pressed and the view loaded:
How can I achieve this?
I already made same rookie mistake like you want to do here. The problem is you will write a lot only to realize you do not want to avoid standard flow provided you by iOS team. For example you will definitely have a bad time dealing with issue like this one (there is additional bar which is part of standard keyboard for Chinese locale):
I solved this by using other people's work from DAKeyboardControl project. You do not need to attach observer (or if you use DAKeyboardControl - block) directly to your bar with buttons, but to your controller and check what user is trying to do and animate this bar accordingly. In the sources you can see how to get keyboard's animation duration and timing function. It may sound more complicated than it indeed is, just give it a try.

Corona SDK - native textfield within scrollview?

In Corona SDK, I'm looking for an example/tutorial of something that seems like it should be incredibly basic: including a text input field within a scrollview.
I have been using widget.newScrollView() for the scrollview, and native.newTextField() for the text input field. The problem, of course, is that the "native" objects exist outside the Corona display object hierarchy, so the textfield can't be placed inside the scrollview and scrolled that way.
A comment on this Corona Labs blog post suggests the technique of using a placeholder image that looks like a textfield, with a touch listener that overlays the real textfield when the user touches it. Is that the best approach to take?
"Faking it" is a proven method of getting stuff done when programming, whether you're using Corona SDK or anything else. While it's nice not to have to jump through hoops to get something done, sometimes it's just the best way to handle it.
In this case, I think using a placeholder is probably the best way to go. You could create a function that uses display.newRect to create the frame of the fake textfield and then display.newText to put in the default and/or user-supplied text.
Something like:
local dObj = showFauxTextfield(x, y, width, height, str)
Create the rect and text according to the parameters passed in, put them into a display group, and pass that back to the calling code. You can then put that into your regular display group along with everything else.
Inside showFauxTextfield() you'll create an event handler that pops up a native.newTextField when it's touched.
It's a little extra work, but Corona typically saves you a lot of dev time anyway, so you'll probably still come out ahead. ;)
If you aren't keen on implementing the placeholder technique mentioned in this post you could always use the WidgetCandy library (http://www.x-pressive.com/WidgetCandy_Corona/). It includes a text field class that will provide similar functionality.

Resources