loganwright / SimpleChat

An Easy To Use Bubble Chat Interface
Mozilla Public License 2.0
262 stars 53 forks source link

Crashing when trying to load #49

Open cesarmtz93 opened 5 years ago

cesarmtz93 commented 5 years ago

Getting this error @loganwright, @little2s haven't figure out the why on this!

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <SimpleChat.LGChatInput: 0x7fd0e67008f0; frame = (0 0; 0 0); layer = <CALayer: 0x6000004d2a40>>: Constraint items must each be a view or layout guide.

update triggered on this line

self.bottomChatInputConstraint = NSLayoutConstraint(item: chatInput, attribute: .bottom, relatedBy: .equal, toItem: self.view.safeAreaLayoutGuide.bottomAnchor, attribute: .top, multiplier: 1.0, constant: 0)
cesarmtz93 commented 5 years ago

I changed the

self.view.safeAreaLayoutGuide.bottomAnchor

to only

self.view.safeAreaLayoutGuide

self.bottomChatInputConstraint = NSLayoutConstraint(item: chatInput, attribute: .bottom, relatedBy: .equal, toItem: self.view.safeAreaLayoutGuide, attribute: .top, multiplier: 1.0, constant: 0)

and it no longer crashed the next problem that I encountered is that it's not rendering the messages or toolbar