swift segue リテラル入力しない

ストーリーボード遷移の時に、リテラルを入力すると間違えるので嫌だ!

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let msEntryByMapPhone = segue.destination as? MsEntryByMapPhone{

//ここの右辺の文字列
            msEntryByMapPhone.previousSegue = "msEntryByMapPhone"
        }

クラス名をコードから取得すると安全

extension NSObject{
    static var claasName:String { String(describing:self)}
}

これで間違いが減る

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let msEntryByMapPhone = segue.destination as? MsEntryByMapPhone{

//ここの右辺の文字列
            msEntryByMapPhone.previousSegue = MsEntryByMapPhone.className
        }