I was trying to do the same thing (my own text before the newline) and arrived here. To add to @Willeke's suggestion above, I removed the \n I was adding in my string and added my own text one character after the edited range and that did the trick. So if you change your code to:
textStorage.mutableString.insertString("$$$$", atIndex: editedRange.location + 1)
I think that should give you what you're after.