paulrolfe / partagpicker Goto Github PK
View Code? Open in Web Editor NEWThis pod provides a view controller for choosing and creating tags in the style of wordpress or tumblr.
License: MIT License
This pod provides a view controller for choosing and creating tags in the style of wordpress or tumblr.
License: MIT License
This bug is caused when the the textfieldEnabled is set to false and occurs a touch into de textField, the method - (void)removeChosenTagFromIndexPath:(NSIndexPath *)indexPath is throwing the error: index 0 beyond bounds for empty array.
Thats because the array chosenTags is not set.
i made a pull request with an hotfix, but i don't know if is the better approach.
Good Day!
I working with your library and wanna show tagPicker in each cell in my TableView ('cause it scrollable and easy to use), BUT there a some problem: every time to ends of tags adding textField (I see that it's for creating new tags, but when I show tags in tableView i don't want create some new tags there, so could you help me and explain where i can change some pice of code to create TagPicker without textField in the end.
With respect,
โฆ
P.S. I tried to do it by my self, but in collectionView_cellForItemAtIndexPath throw exception when I tried to delete, or edit place when you add textField.
Hello,
I need to use this in a custom UITableViewCell. I've tried putting the adding the picker.view as a subview to the cell and setting the delegate to the UITableViewController, but the picker is just blank with the background color showing. Any advice?
let tagPicker = PARTagPickerViewController()
tagPicker.view.backgroundColor = UIColor.whiteColor()
tagPicker.view.frame = CGRect(x: 0, y: 0, width: CGRectGetWidth(cell.bounds), height: COLLECTION_VIEW_HEIGHT)
tagPicker.view.autoresizingMask = UIViewAutoresizing.FlexibleWidth
tagPicker.delegate = self
tagPicker.allTags = ["hurfi", "durfi"]
tagPicker.allowsNewTags = true
tagPicker.chosenTags = NSMutableArray(array: queries)
tagPicker.visibilityState = .TopAndBottom
self.addChildViewController(tagPicker)
cell.paddingView.addSubview(tagPicker.view)
Nice library but i think it should have image capabilities like user can load image from a URL or can add static content.
Hi,
Thanks for the nice lib, Does this lib has ability to add a custom icon of "x" or "+" on right or left side of the tag?
or any way to achieve the same in this ?
I've integrated PARTagPicker in a project that works with Swift 2.0 following the sample available through 'pod try'.
Everything works well if NSMutableArray is not empty, but as I have emptied this array it gives the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[**NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
* First throw call stack:
(
0 CoreFoundation 0x00619a84 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x022b2e02 objc_exception_throw + 50
2 CoreFoundation 0x005084f2 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 386
3 CoreFoundation 0x0051c77b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 75
4 PARTagPicker 0x000feeae -[PARTagPickerViewController addPlaceholderTextToCellTextField] + 446
5 PARTagPicker 0x000ffdc4 -[PARTagPickerViewController collectionView:cellForItemAtIndexPath:] + 1316
6 UIKit 0x01752f4a -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:] + 450
7 UIKit 0x01752ca2 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 65
8 UIKit 0x0175575c -[UICollectionView _updateVisibleCellsNow:] + 5180
9 UIKit 0x0175a980 -[UICollectionView layoutSubviews] + 241
10 UIKit 0x00ec4eb7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 813
11 libobjc.A.dylib 0x022c7059 -[NSObject performSelector:withObject:] + 70
12 QuartzCore 0x0501380a -[CALayer layoutSublayers] + 144
13 QuartzCore 0x050074ee _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388
14 QuartzCore 0x05007352 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
15 QuartzCore 0x04ff9e8b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317
16 QuartzCore 0x0502de03 _ZN2CA11Transaction6commitEv + 561
17 QuartzCore 0x0502f674 _ZN2CA11Transaction17flush_transactionEv + 50
18 UIKit 0x00df4f0a _UIApplicationHandleEventQueue + 8398
19 CoreFoundation 0x00533d1f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
20 CoreFoundation 0x005299ab __CFRunLoopDoSources0 + 523
21 CoreFoundation 0x00528dc8 __CFRunLoopRun + 1032
22 CoreFoundation 0x00528706 CFRunLoopRunSpecific + 470
23 CoreFoundation 0x0052851b CFRunLoopRunInMode + 123
24 GraphicsServices 0x051e5664 GSEventRunModal + 192
25 GraphicsServices 0x051e54a1 GSEventRun + 104
26 UIKit 0x00dfb1eb UIApplicationMain + 160
Tracking this error, I've managed to solve it by editing addPlaceholderTextToCellTextField method from PARTagPickerViewController.m itself, becoming to:
(void)addPlaceholderTextToCellTextField {
UIColor *placeHolderColor = [[UIColor alloc] initWithCGColor:[UIColor whiteColor].CGColor];
if (self.textfieldPlaceholderTextColor) {
placeHolderColor = self.textfieldPlaceholderTextColor;
}
self.cellTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"Add your tag here" attributes:@{NSForegroundColorAttributeName: placeHolderColor}];
}
I don't know if it can be added as a bugfix or I'm not doing something properly. I just wanted to let it know in case some other have going through this problem. If I'm not doing something correct, please let me know what.
implemented it in swift 2.3, it crashes wenn you insert two tags with the same text and try to delete one.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (2) must be equal to the number of items contained in that section before the update (4), plus or minus the number of items inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).
hey i want to use this pod for searching a tableview. Is it possible to fire a search method after a new tag has been selected from the suggested ones or a new one has been typed in?
the shown allTags are changed whenever the search string is changed. Now i want to use the search string to load proposed tags from my backend, ever time it is manipulated.
is the search string accessible? is there a way to fire a function whenever it is manipulated?
why can't i install 1.2.3 via cocoa pods? do you have to update something somewhere?
is there a way to find out if my input has blanks and forbid that / trim the input?
Hi,
You did great job!
Here what I need, My design look like this and search suggestion from API so it's dynamic based on textfield text. So I edit source code like this
-(void)addDynamicTextFromSearch:(NSString *)newString
{
[self.chosenTags addObject:newString];
NSIndexPath *addedPath = [NSIndexPath indexPathForItem:self.chosenTags.count inSection:0];
[self.chosenTagCollectionView insertItemsAtIndexPaths:@[addedPath]];
[self.chosenTagCollectionView scrollToItemAtIndexPath:addedPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
}
And I got output like this two placeholder when I tap text from my API output.
When I scroll that get correct text(horizontally) which I selected, with extra placeholder textView like this
At init method I didn't give any allTag
to search when user type. I want insert dynamic text based on my API search text.
self.tagPicker = [[PARTagPickerViewController alloc] init];
self.tagPicker.view.frame = CGRectMake(0, 0, self.tagPickerView.frame.size.width, self.tagPickerView.frame.size.height); // self.tagPickerView.frame; //78 is the fully expanded height.
[self.tagPicker.view.layer setCornerRadius:CGRectGetHeight(self.tagPicker.view.frame) / 2];
self.tagPicker.view.layer.borderColor = [UIColor KSCloudyBlueColor].CGColor;
self.tagPicker.view.layer.borderWidth = 1.0;
self.tagPicker.view.backgroundColor = [UIColor clearColor];
self.tagPicker.view.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.tagPicker.delegate = self;
self.tagPicker.allTags = @[];
//optionally allow new tags to be made
self.tagPicker.allowsNewTags = YES;
[self addChildViewController:self.tagPicker];
[self.tagPickerView addSubview:self.tagPicker.view];
My init code
Is this possible?
Thanks in advance :)
Hi,
I want to change the variable "chosenTags" (ex: remove all or add all tags available).
But, when I setting a new NSMuttableArray, and in sequence, if I try select a new Tag the app's broke.
The code is like this:
- (IBAction)addAll:(id)sender {
[self clearAll:nil];
[_tagPicker setChosenTags:[self.allTags mutableCopy]];
}
- (IBAction)clearAll:(id)sender {
self.preChosenTags = @[];
[_tagPicker setChosenTags:[self.preChosenTags mutableCopy]];
}
I have to do something else?
Thanks.
You still have to search for the nibs and include them in the project, must be done programatically or included in pod bundle.
Thanks for your great work :)
Whatever the order the tags are in, it seems that they will always be in reverse alphabetical order when they show up.
Is there a workaround that?
Thanks,
Dalia
If you try to add the same Tag from your proposed alltags to your chosenTags twice right after the first one was added, you get a crash. This can happen if you fill your proposed tags from your backend.
In my case if I type "su" my backend will give me "sun" and "sunny" back. if i add the tag "sun" and keep typing "sun" i get again "sun" and "sunny", where i can add Sun again to my chosenTags.
*** Assertion failure in -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.5.2/UICollectionView.m:5585
2016-11-30 00:09:09.964160 Inline App[2760:770432] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in
section 0. The number of items contained in an existing section after the update (2) must be equal to
the number of items contained in that section before the update (2), plus or minus the number of items
inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items
moved into or out of that section (0 moved in, 0 moved out).'
Hello, I noticed the code from the sample project is version '1.2.0', however the latest version available from cocoa pods is '1.1.0'.
First of all, thanks for this amazing tool!
There are thing that I can't find. Firstly, i can't call textField in my controller for edit placeholder or another properties. Secondly, i can't find some property to stop removing tags by double tapping. And can I change only first tag border,background and text color?
I found textfield in the library, and change placeholder, but I thing there should be properly way to do it.
Pleas, help with it.
Hi,
It's will be great to add Carthage support
Take a look at these articles:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.