Giter VIP home page Giter VIP logo

partagpicker's People

Contributors

ostanik avatar paulrolfe avatar viktorwillmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

partagpicker's Issues

Index 0 beyond bounds for empty array

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.

Feature Request (From Ildar)

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.

Use in UITableViewCell

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)

Adding icon/fontimage with tag

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 ?

Problem when prechosen Tags array is nil

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.

crash after deleting tags with the same name

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).

fire methods if new tag is selected

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?

Need dynamic search input text hashtag

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.
screen shot 2016-04-12 at 8 43 55 pm

When I scroll that get correct text(horizontally) which I selected, with extra placeholder textView like this
screen shot 2016-04-12 at 8 44 27 pm

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 :)

Change "chosen tags" via code

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.

Can't order tags

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

adding the same value twice from alltags causes a crash

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).'

Version 1.2.0?

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'.

Cell width not working properly

I'm trying to run the example and seeing this although it should be showing all the letters in full width according to documentation.
IMG_B4260D2631C4-1

Can't find some properties ..

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.