I'm new to iOS development. I face some difficulty finding the right resources for having custom keyboard shortcut for my app. I know that in ios 5 it has been developed. but i think i would like to have a custom keyboard shortcut for the frequently phrase that only work in my app.
So please please help me..
I also wonder how can I control the size of the font for the whole app? It is easy to do it with one label. I mean when the user change the font size with a UISlider for one label, how can I apply the change for every text box, label , table view controller ... etc.
In addition, in this Add shortcut in keyboard settings through app?
if I have to work with UITextChecker
, is there any way I can make my own dictionary to retrieve the data from core data?
Any help will be appreciated!
Three questions in one, wow. So let's start:
Custom Keyboard Shortcuts: To recap your feature... Do you want to have own text-replacement blocks in your App? Such as the text replacement for brb into be right back? If so, I would recommend using a dictionary, such as:
NSDictionary replacement = [NSDictionary dictionaryWithObjectsAndKeys:@"be right back",@"brb",@"see you",@"cu",nil];
Aftewards you may iterate over each entry, replacing the text in your text box:
NSString text = @"Hello. brb... cu";
for(NSString* key in [replacement allKeys])
text = [text stringByReplacingOccurrencesOfString:key withString:[replacement valueForKey:key]];
Font Size Control: Two ideas here. The first one, would be to create a public property in any of your classes (e.g. your AppDelegate class) called fontScale (type CGFloat). Starting with iOS 6 you have the possibility to set the minimumFontScale
property to all text fields/boxes like this:
textField.minimumFontScale = [[UIApplication sharedApplication] delegate].fontScale;
My second idea, would be to subclass UITextField/View and set the font size in the init-methods using your globally stored font-size.
Dictionary in Core Data: Please see here.