Xcode 11.2 的 Could not instantiate class named _UITextLayoutView because no class named _UITextLayoutView was found

從 Xcode 11.2 製作 iOS App 時,若是從 storyboard 或 xib 建立 text view,然後跑在 iOS 13.2 之前的 iPhone & iPad 上,將產生可怕的問題,程式會毫不留情地馬上閃退 !

放心,這不是我們的問題,這是 Xcode 11.2 不小心製造的小小 bug。若是我們的 App 只要支援 iOS 13.2 以後的版本,其實也不會有問題。但若想支援舊版,請採用以下幾種解法。

方法1: 升級 Xcode 11.2.1。

沒錯,就是這麼簡單,只要升級就可解決。Apple 已經在 11.2.1 修正問題了 ~

方法2: 改從程式產生 text view。

方法3: 使用 Xcode 11.1。

詳細的相關資訊也可參考以下 stackoverflow 的說明。

彼得潘的 iOS App Neverland

Written by

彼得潘的 Swift 程式設計入門,App程式設計入門作者,彼得潘的iOS App程式設計入門,文組生的iOS App程式設計入門講師,http://apppeterpan.strikingly.com

彼得潘的 Swift iOS App 開發問題解答集

彼得潘和學生們在開發 iOS App 路上曾經解決的問題集

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade