How do I type a hyphen in iOS 12?

Turning off Smart Punctuation (in Settings → General → Keyboard) allows me to type multiple hyphens without them being converted to em-dashes.

(Side note: here's a post by the creator of Markdown about this feature.)


As far as I can tell, this setting has two effects:

  1. Change repeated hyphens to dashes
  2. Change quotes and apostrophes to smart, locale-aware quotes (e.g., "" will become «» when the language is set to French).

These can't be toggled independently. The Apple help article for Numbers on iPad explicitly says:

Numbers automatically converts double hyphens (--) to dashes (—) and converts straight quotation marks to curly quotation marks as you type. You can turn this setting off or on at any time.

Note: The setting affects both hyphens and quotation marks—they’re both either off or on.

[...]

Tip: To use different formatting for specific text, change the setting, type the text, then change the setting back.

(Even though it says "Numbers automatically converts [...]," the setting is the same: Settings → General → Keyboard → Smart Punctuation. It's not specific to Numbers.)

This blog post suggests developers can turn this off selectively:

A first step, if using a UITextInputTraits conforming control, would be to set smartQuotesType to UITextSmartQuotesTypeNo, and set smartDashesType to UITextSmartDashesTypeNo.


If it's only about Markdown, you don't need to change any settings. Alternate syntax is available for both headers and horizontal rules:

# Header 1
## Header 2

- - -
***
____

Gives:

Header 1

Header 2




That last uses underscores (_).


If you don't want to turn off Smart Punctuation as suggested in muru's answer, you can type a space between each hyphen then go back and delete the spaces. The hyphens will not be changed into typographic dashes.

The obvious suggestion would be to set up a text replacement in Settings > General > Keyboard > Text Replacement, so that (for example) typing 4dash gave you a sequence of four hyphens, but that doesn't seem to work either, at least on iOS 12.3.1. I tried a couple of different international keyboards and also dictating 'dash'es or 'hyphen's by voice, and none of those got the desired result.

The only other thing I can think of to suggest is to install a third-party keyboard, but I don't use any so I don't know how they interact with Smart Punctuation.


If you have the SE app, you can do it easily there, as it’s one of the shortcuts on the editing row.

Another option (that also works in-browser), possibly faster than deleting spaces, is:

  1. Type a hyphen
  2. Copy it
  3. Paste repeatedly

This will also sidestep the smart punctuation.

(As pointed out in comments...) For further efficiency, you can copy-paste increasingly longer blocks of hyphens until you get the length you need. Then, once you have a full set, you can copy it once and carry it with you in the clipboard, allowing you to reuse it easily throughout the answer.


In addition to what's been mentioned already, you can tap the microphone and say "hyphen hyphen hyphen hyphen hyphen hyphen".