• Home
  • Über mich
  • Impressum

Marc Schlüpmann

My personal View of the World

Month: Mai 2012

Block Emoji-Keyboard for Text Input

25. Mai 2012 by Marc Schlüpmann Leave a Comment

I recently stepped over an issue during iOS app development for one of my customers. If the user switches to the Emoji-Keyboard on her iPhone during text input in a UITextField or UITextView and uses some of the icons the backend system for that app could not handle this. Implementing Emoji-Support on the server side would be a high effort.

The far more easier solution is to block the Emoji-Keyboard on the iOS side to prevent the user from using these characters. The UITextInputTraits protocol defines the property keyboardType of type UIKeyboardType. By setting this property you can define the keyboard layout shown to the user, he starts typing into a UITextView or UITextField.

The enumeration UIKeyboardType lists several keyboard layouts for email input, phone number input, or URL input for example. The property keyboardType has the value UIKeyboardTypeDefault as its default value. With this set the user may use Emojis from the Emoji-Keyboard if he has activated this in the settings on his iPhone. Deactivating the Emoji-Keyboard but still enabling the user to switch between different keyboard languages is rather simple: Just set the property keyboardTypeto UIKeyboardTypeASCIICapable. This sounds a little bit confusing as you might think, from now on only characters from the ASCII character set may be shown, but this is not true. The user has the full character set at hand, can switch to other language-related keyboards but the Emoji-Keyboard.

Every time you handle text input you should think about using the appropriate keyboard layout and switching to UIKeyboardTypeASCIICapable.

Posted in: iOS Programming Tagged: iOS

What’s hot

Ammersee Denkerhaus Atmen Breitband Bürgerbeteiligung Chart Cordova Coworking currant Diagramm Dießen El Capitan Finanzen Gemeinderat Geschmack Gesundheit Grüne Huber Häuser Internetzugang iOS iOS 6 Jugend Jugendtreff Kommunalwahl MTV Dießen Mühlstraße Nasendusche Netzdiagramm Neues Jahr Obermühlhausen Oenologie OS X Parken Parkplätze Phonegap Politik Programmierung Programming Radar Diagramm Transparenz Untermüllerplatz Videotraining Weihnachten Wein Weinbau Xcode

Kategorien

  • Allgemein
  • Ammersee Denkerhaus
  • Datenschutz
  • Dießen am Ammersee
  • Gemeinderat
  • iOS Programming
  • OS X Programming
  • Podcasts
  • Politik
  • Privat
  • Work

Neueste Kommentare

  • Michael Hofmann bei Bürgerbegehren gestartet
  • Frank Fastl bei Bürgerbegehren gestartet
  • Michael Hofmann bei Bürgerbegehren gestartet
  • Leopold Ploner bei Parken auf dem schönsten Platz von Dießen
  • Leopold Ploner bei Über den Dächern von Dießen

Lesezeichen

  • #Schondorf
  • Ammersee Denkerhaus
  • Ammersee Kurier
  • Annes Art
  • Annes Topfgeflüster
  • Chaos Computer Club
  • Logbuch:Netzpolitik
  • Margarete Bause
  • Obacht! – Reloaded –
  • Petra Sander
  • Renate Standfest
  • Sitzungstermine Dießen

Archive

  • April 2020
  • Februar 2020
  • Januar 2020
  • September 2017
  • Juli 2017
  • Juni 2017
  • Mai 2017
  • März 2017
  • Oktober 2015
  • September 2015
  • Juli 2015
  • April 2015
  • März 2015
  • Januar 2015
  • Oktober 2014
  • Februar 2014
  • Januar 2014
  • Dezember 2013
  • Juni 2013
  • Januar 2013
  • Dezember 2012
  • Mai 2012
  • April 2012
  • März 2012
  • Februar 2012
  • Dezember 2011

Copyright © 2025 Marc Schlüpmann.

Omega WordPress Theme by ThemeHall