TaggerKit icon indicating copy to clipboard operation
TaggerKit copied to clipboard

Unable to add New Tag

Open sunkumar opened this issue 6 years ago • 11 comments

Hi,

I was try to add new tag in tagCollection, but it would not add for me.

var toTagCollection = TKCollectionView()

add(toTagCollection, toView: toEmailContainerView!) toTagCollection.delegate = self toTagCollection.action = .removeTag

func textFieldShouldReturn(_ textField: UITextField) -> Bool {

       toTagCollection.addNewTag(named: textField.text)

    return true
}

Any things, I am missing here!

sunkumar avatar Sep 17 '19 06:09 sunkumar

Hey there, sorry for the late reply. Haven't got the time yet to look into this but I'm in the process of changing exactly this flow internally (ideally the interaction should remain the same).

Also, what version are you using? Thanks

nekonora avatar Oct 03 '19 12:10 nekonora

confirmed master project can not add new tag when press in to (+) tag NOTE: I downloaded master then run "pod 'TaggerKit'"

fukemy avatar Oct 27 '20 09:10 fukemy

ok fixed by adding below function to tkcell

 override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
        var view = button.hitTest(button.convert(point, from: self), with: event)
        if view == nil {
            view = super.hitTest(point, with: event)
        }
        
        return view
    }

fukemy avatar Oct 27 '20 09:10 fukemy

@fukemy can you tell me in which file i need to add this code to make it work?

WorkspacePrateek avatar Nov 02 '20 13:11 WorkspacePrateek

@WorkspacePrateek in class extends cell bro

fukemy avatar Nov 02 '20 13:11 fukemy

Tkcell.class

fukemy avatar Nov 02 '20 13:11 fukemy

Well I am still learning IOS. I added this project using pod. And in Pod >> TaggerKit >> I am not able to find TKcell.class. Is it possible for me to use this workaround.

WorkspacePrateek avatar Nov 02 '20 13:11 WorkspacePrateek

ok, just press command+shift+f, type : "Tktagcell" then find this file

fukemy avatar Nov 03 '20 02:11 fukemy

@fukemy Thanks. But did not work for me. I am still not able to add New tags.

func tagIsBeingRemoved(name: String?) {
     print("removed \(name!)")
     self.allProfessions.addNewTag(named: name!)    // <= This function does not work
     self.userProfessions.removeOldTag(named: name!)
 }

WorkspacePrateek avatar Nov 03 '20 07:11 WorkspacePrateek

hmm, i think u need to know how library work first.....

fukemy avatar Nov 03 '20 08:11 fukemy

Actually I need to add tag again in "allTag" if tag is removed from selectedTags

WorkspacePrateek avatar Nov 03 '20 08:11 WorkspacePrateek