evermeer / AttributedTextView

Easiest way to create an attributed UITextView (with support for multiple links and from html)
Other
440 stars 55 forks source link

Error when compiling in xcode 10 swift 4.2 #27

Closed ljbdelacruz closed 5 years ago

ljbdelacruz commented 5 years ago

i received this error when using this dependency on branch XCode10 does anyone have a idea how to solve this? would really appreciate it thanks "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions""

screen shot 2018-12-06 at 9 22 09 am
evermeer commented 5 years ago

An error like this usually comes up fast when using the + to append various texts. The compiler then needs to examine every possible type where the + can apply to. In this case you are using .append which should have been fine. Is this the complete line of code? Or is there more?

One thing what you could do is splitting the statement up in separate variables and then append those to the contactInfoLabel.attributer. You would then get something like

var header = empty.append(...
var email = "Email: ".localized.append(info....
var address = "Address: ".localized.append(info....
contactInfoLabel = header.append(email).append(address)
evermeer commented 5 years ago

I assume you were able to solve your issue? If not, then just let me know.