ios 13 UIContextMenu shows shortened UIAction titles

715 Views Asked by At

I decided to addUIContextMenuInteraction to my UITableViewCell, it works fine, but the title that has 9+ letters (without image) or 6+ letters(with image) is getting shortened like this:

enter image description here

Implementation of delegate method:

extension MyCustomCell: UIContextMenuInteractionDelegate {

    @available(iOS 13.0, *)
    func contextMenuInteraction(_ interaction: UIContextMenuInteraction,
                                configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
        return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ -> UIMenu in
            let first = UIAction(title: "8Letters") { _ in
                print("8 letters")
            }
            let second = UIAction(title: "9Letters+") { _ in
                print("9 letters")
            }
            let third = UIAction(title: "Hello", image: UIImage(systemName: "square.and.arrow.up")) { _ in
                print("5 letters + image")
            }
            let fourth = UIAction(title: "Hello+", image: UIImage(systemName: "square.and.arrow.up")) { _ in
                print("6 letters + image")
            }
            return UIMenu(title: "", children: [first, second, third, fourth])
        }
    }

}
1

There are 1 best solutions below

0
Hrishikesh Devhare On

Check if any third party framework added to your project for customising the UITableViewCell is breaking the UI. In my case, the issue is caused by third party framework ( "SkeletonView") which I had added to give shimmer effect to UITableViewCell