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:


Change repeated hyphens to dashes
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 (_).