Modify number keyboard in iOS - ios

Need to create the iOS keyboard similar to attached image, it is possible any how with the native solution?
I have tried to assign a return key which is Done but i am getting following

You can create a custom input view with needed appearance.
To achieve this, you can use property inputView if UITextField:
The custom input view to display when the text field becomes the first
responder.
Here you can find a guide about custom input views.
Also I've created small example with custom input view without buttons: https://github.com/K-Be/KeyboardNotifications/tree/master_CustomInput .

Related

Custom Keyboard on iOS

I need to create a custom keyboard for my app, but no sure the best way to do it without the user needing to add a keyboard in the settings. If I create a keyboard extension is it possible to set a UITextField's Keyboard Type to that custom keyboard? Or will I have to use a UIView to accomplish this?
For a custom keyboard that is specific to a single app, create a view and assign the view to UITextField.inputView:
textField.inputView = YourCustomKeyboard()
In my search I didn't find a way to tack on additional keys but there are examples of custom keyboards using inputView that are easy to adapt.
A custom decimal keyboard example
My hexadecimal keyboard version
You can add accessoryView to text view for you want to give a few extra buttons.
If you still looking for some more then please go through the below link.
https://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=keyboard

Misuse of UITextField.inputView to get similar popup behavior of keyboard

I often want to put my own things in the same place the keyboard pops up, but for my own controls... such as putting a UIDatePicker there, or a custom UIPickerView, or whatever.
I came up with a clumsy way of getting this behavior by having a dummy UITextField and putting my custom view in its inputView property. Then when the user clicks on my item, I just trigger off the UITextField to display the view I've assigned to the inputView.
Then I got to wondering if there was a better less kludgey way to do this. I found this article Show UIPickerView like a keyboard, without UITextField where several people recommend the same thing I do.
My question is this. Is it common to (mis)use the UITextField in this manner?
Many times you will face a UITextfield that you would want to populate through a custom control other than the standrd keyboard. Thus the inputView method was declared and can be used.
What is recommended:
1- if the UItextfield is normal, use the keybard (don't change the input view)
2- if the value is numeric, show the numberpad in keyboard directly (textField.keyboardType = .numberPad)
3- if your textField is a date then you set the input view as a date picker.
4- sometimes you need a UITextField where you need to choose between stuff. Thus you develop your own custom UIPicker and set it as an input View.
5- If what you are tring to achieve don't fall in all the above then you can do your own inputView and assign it.
So in short don't be afraid, it is the normal thing to do!
Hope this helps!

Create custom keyboard within app not external

How am I able to create a keyboard that is already enabled in the app, or is it just buttons put next to each other to make it seem like a keyboard. Like the image below
http://i.imgur.com/qIoxR0a.png
you can use to the UIButton element or UIView with TouchBegan. But don't keyboard extension because different controller.
You can use ETCustomKeyboard which is mostly like same as you need.
And the output of that is show into below image:
You can modify this as per your need.
And HERE is one more same like that.
Hope this will help.
Create the keyboard as an ordinary UIView, and make it the inputView for your text field. There is more information in Apple's Custom Views for Data Input page.

How can I create keyboard like buttons with UIInputView?

With iOS 7 Apple introduced UIInputView, which allows you to add a custom view above the keyboard that looks like this (you can adjust the height):
The docs state that:
The UIInputView class is designed to match the appearance of the standard system keyboard when used as an input view with a responder. When defining your own custom input views or input accessory views, you can use a UIInputView object as the root view and add any subviews you want to create your input view. The input view and its subviews receive tinting and blur effects based on the options you specify at initialization time.
What I do not understand, however, is how I can add additional row of buttons that look like standard keys above the keyboard (such as here in Fantastical):
Is it possible to a) correctly style system UIButtons so that they appear like keys or b) is there a library that simplifies the rendering of custom keys?
Here is a project of an iOS keyboard that mimics the system keyboard: https://github.com/acoomans/ACKeyboard
You could reuse the ACKey as keys for your keyboard!
I think this an inputAccessoryView used with the iOS keyboard. Just try by creating a UIView and adding some custom buttons to it and assigning it as the inputAccessoryView.

UITextView variable, allow to set text using special method only?

I have a UITextField property inside a UIViewController class. I want to allow to set its text using a special method in view controller only. The goal is to move other view controller's elements according to a size of a text inside the text field.
Text field has editing option disabled so it can be setted in code only.
Way 1:
Subclass a UITextField. Looks too extra because I need to set the elements which doesn't belong to this text field. So I need to use a delegate (and as I understand it will be my own delegate only) etc.
Way 2:
Make text field property private. It is my current solution but I don't like that it is fully private.
Can anybody advice a better solution?

Resources