YLTextView icon indicating copy to clipboard operation
YLTextView copied to clipboard

直接运行swift demo报错,因为没有设置textView的字体样式,崩溃日志如下,还有,键盘输入时,最大行数限制有效,选择键盘上的候选文本,行数限制无效

Open jkwf opened this issue 5 years ago • 12 comments

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kangfang/Downloads/YLTextView-master/YLTextViewDemo/YLTextView_SwitDemo/YLTextView_Swit/YLTextView/YLTextView-Extension.swift, line 217 Simulator Screen Shot - iPhone 8 Plus - 2019-11-22 at 11 16 33

jkwf avatar Nov 22 '19 03:11 jkwf

好的,我抽空修复下。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年11月22日 11:20,jkwf 写道:

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kangfang/Downloads/YLTextView-master/YLTextViewDemo/YLTextView_SwitDemo/YLTextView_Swit/YLTextView/YLTextView-Extension.swift, line 217

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Nov 22 '19 04:11 Rain-dew

我没有发现你说的swift运行崩溃的问题。你是什么版本的?

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年11月22日 12:01,zhangyuluios 写道: 好的,我抽空修复下。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年11月22日 11:20,jkwf 写道:

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kangfang/Downloads/YLTextView-master/YLTextViewDemo/YLTextView_SwitDemo/YLTextView_Swit/YLTextView/YLTextView-Extension.swift, line 217

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 18 '19 02:12 Rain-dew

你说的候选文本问题已经修复了

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月18日 10:52,zhangyuluios 写道: 我没有发现你说的swift运行崩溃的问题。你是什么版本的?

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年11月22日 12:01,zhangyuluios 写道: 好的,我抽空修复下。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年11月22日 11:20,jkwf 写道:

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kangfang/Downloads/YLTextView-master/YLTextViewDemo/YLTextView_SwitDemo/YLTextView_Swit/YLTextView/YLTextView-Extension.swift, line 217

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 18 '19 03:12 Rain-dew

Xcode版本: 11.3 编译swift demo,修改如图代码,运行闪退 截屏2019-12-1916 32 48

崩溃位置 截屏2019-12-1916 36 39

建议该方法做以下调整: 截屏2019-12-1916 40 03

jkwf avatar Dec 19 '19 08:12 jkwf

好的,我把字体加个容错。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月19日 16:40,jkwf 写道:

Xcode版本: 11.3 编译swift demo,修改如图代码,运行闪退

崩溃位置

建议该方法做以下调整:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 19 '19 08:12 Rain-dew

朋友,你在11.3运行这个font是空的?textview应该会有默认的字体的,如果这里崩溃,那所有的self.font都是有问题的。我升级11.3看下

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月19日 16:40,jkwf 写道:

Xcode版本: 11.3 编译swift demo,修改如图代码,运行闪退

崩溃位置

建议该方法做以下调整:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 19 '19 09:12 Rain-dew

对,获取的font是nil, 模拟器版本是13.3

jkwf avatar Dec 19 '19 09:12 jkwf

很奇怪。等我升级看下。你这个代码不是新的,你先更新代码。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月19日 17:05,jkwf 写道:

对,获取的font是nil, 模拟器版本是13.3

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 19 '19 09:12 Rain-dew

更新最新的也是有问题,建议增加默认font,还有发现一个问题 override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .lightGray let textview = UITextView(frame: CGRect(x: 100, y: 100, width: 200, height: 20)) textview.placeholder = "喜欢请Star" textview.limitLines = 4; textview.autoHeight = true textview.center = self.view.center view.addSubview(textview) } 这样写,选择输入中文,第一次输入中文确定后,就输不了中文,不加这一句代码《textview.placeholder = "喜欢请Star"》会闪退

jkwf avatar Dec 19 '19 09:12 jkwf

应该是11.3的问题。以前没有发现过。新的xcode我还没下载。

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月19日 17:24,jkwf 写道:

更新最新的也是有问题,建议增加默认font,还有发现一个问题 override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .lightGray let textview = UITextView(frame: CGRect(x: 100, y: 100, width: 200, height: 20)) textview.placeholder = "喜欢请Star" textview.limitLines = 4; textview.autoHeight = true textview.center = self.view.center view.addSubview(textview) } 这样写,选择输入中文,第一次输入中文确定后,就输不了中文,不加这一句代码《textview.placeholder = "喜欢请Star"》会闪退

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 19 '19 09:12 Rain-dew

嗯,你更新一下最新版的看一下

jkwf avatar Dec 19 '19 09:12 jkwf

对系统有要求。我系统也不够

| | zhangyuluios | | 邮箱:[email protected] |

Signature is customized by Netease Mail Master

在2019年12月19日 17:27,jkwf 写道:

嗯,你更新一下最新版的看一下

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Rain-dew avatar Dec 19 '19 09:12 Rain-dew