Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in SkyFloatingLabelTextField textHeight #186

Closed
drjasonharrison opened this issue Dec 13, 2017 · 8 comments
Closed

Crash in SkyFloatingLabelTextField textHeight #186

drjasonharrison opened this issue Dec 13, 2017 · 8 comments

Comments

@drjasonharrison
Copy link

Report

What did you do?

used SkyFloatingLabelTextField in an iOS project using Carthage

What did you expect to happen?

App launch without problem, this mostly happens

What happened instead?

We have one crash reporting using Crashlytics. Crash report attached.

SkyFloatingLabelTextField textHeight crashed when force unwrapping self.font

We were using SkyFloatingLabelText 2.0.1 have upgraded to 3.4.0

Environment

Xcode Version: 8.3.3
SkyFloatingLabelTextField Version: 3.4.0
Deployment Target: 10.0, with crash on 10.3.2 (14F89)
Base SDK: iOS 10.3
Method of Integration: Carthage

Project that demonstrates the issue

We have only one report of this crash.
SkyFloatingLabelTextField crash during autolayout.txt

@drjasonharrison
Copy link
Author

It is likely that the crash will be very hard to reproduce, however removing the force unwrap is an improvement that will reduce the cause of the crash.

@k0nserv
Copy link
Contributor

k0nserv commented Dec 28, 2017

Hmm are you setting the font yourself our relying on the system font being set by the OS? I agree that the force unwrap is not ideal, however what you would do in its absence is a big question. Just using a line height of 0 is likely not what you'd want

@drjasonharrison
Copy link
Author

We're setting the font ourselves, it's not a zero point font size. And it's only been seen once. Possibly a race condition in the UIKit autolayout vs storyboard resource loading.

@k0nserv
Copy link
Contributor

k0nserv commented May 28, 2018

Has this cropped up again or are you any closer to reproducing it?

@drjasonharrison
Copy link
Author

Haven't seen it again. Going to close this as unreproducible though the use of forced unwrapping in production code continues to bother me.

@k0nserv
Copy link
Contributor

k0nserv commented May 29, 2018

Yeah I'll have a think about it and see if I can figure out something better

@k0nserv
Copy link
Contributor

k0nserv commented May 29, 2018

I've added 9c50bbe just to make sure we can avoid this happening. I'll release it in a while as 3.5.1

@k0nserv
Copy link
Contributor

k0nserv commented May 29, 2018

Published as 3.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants