ElaWorkshop / TagListView

Simple and highly customizable iOS tag list view, in Swift.
MIT License
2.63k stars 492 forks source link

Multi line tag support #262

Open pritam-bs opened 4 years ago

pritam-bs commented 4 years ago

[Description]:

jsyrtsov commented 3 years ago

@pritam-bs Hello :) Can you help me please? I'm trying to use your solution for multiline tags, but unfortunately I'm catching fatal error. Fatal error: Negative Array index is out of range

pritam-bs commented 3 years ago

@jsyrtsov Hi! Please provide some details.

jsyrtsov commented 3 years ago

@pritam-bs Thank you for your reply ! :) Do you have any chat or messenger ?

khanskt786 commented 3 years ago

@pritam-bs I also tried your solution and it throws fatal error, here are the logs

Fatal error: Array index is out of range: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.2.25.13/swift/stdlib/public/core/Array.swift, line 382 2020-11-03 15:04:23.466606+0500 LLAXA[30589:293613] Fatal error: Array index is out of range: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.2.25.13/swift/stdlib/public/core/Array.swift, line 382

Crash occures in this function

@discardableResult open func addTagViews(_ tagViewList: [TagView]) -> [TagView] { defer { rearrangeViews() } tagViewList.forEach { tagViews.append($0) // on this line to be precise tagBackgroundViews.append(UIView(frame: $0.bounds)) } return tagViews }

-------------Solution---------- Clean build folder delete derived data and run, project is now working crash free but no multiline text added its still the same