Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Error: Duplicate interface definition for class 'TTGTextTagCollectionView' #109

Closed
darkengine opened this issue Jun 2, 2021 · 7 comments

Comments

@darkengine
Copy link

Compile with XCode 12.5, get error message:

/Pods/TTGTagCollectionView/Sources/TextTag/TTGTextTagCollectionView.h:46:1:
Duplicate interface definition for class 'TTGTextTagCollectionView'

The duplicate interface definition is happened in "TTGTextTagCollectionView.h:46", so have no idea how to modify this.

@zekunyan
Copy link
Owner

zekunyan commented Jun 7, 2021

@darkengine Which version ?

@darkengine
Copy link
Author

@darkengine Which version ?

Version TTGTagCollectionView (2.0.1)

@zekunyan
Copy link
Owner

zekunyan commented Jun 7, 2021

@darkengine I try myself on my Mac mini M1 on a pure new project and it works fine. (2.0.1 version) Maybe you should clean your cocoapods cache and run pod update completely from the begin.

@KinmoCode
Copy link

@darkengine Is this problem solved?

@darkengine
Copy link
Author

@darkengine Is this problem solved?

Hi @zekunyan and @kinmoLun ,

Thanks for the advice. I start a new Objective-C project (With XCode 12.5) and add "TTGTagCollectionView" using cocoapods. Unfortunately, it shows the same error message. The codes in my ViewControll.m is:

//
//  ViewController.m
//  StoneTestTags
//
//  Created by Stone on 2021/6/11.
//

#import "ViewController.h"
#import <TTGTextTagCollectionView.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // test text tags
    // Create TTGTextTagCollectionView view
    TTGTextTagCollectionView *tagCollectionView = [[TTGTextTagCollectionView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
    [self.view addSubview:tagCollectionView];
    // Create TTGTextTag object
    TTGTextTag *textTag = [TTGTextTag tagWithContent:[TTGTextTagStringContent contentWithText:@"Some text"] style:[TTGTextTagStyle new]];
    // Add tag
    [tagCollectionView addTag:textTag];
}


@end

@darkengine
Copy link
Author

Update! I get it works by changing the import file to:

#import <TTGTagCollectionView/TTGTextTagCollectionView.h>

The old import statement works in the previous version.

@zekunyan
Copy link
Owner

@darkengine Great work ! Maybe the new version of Cocoapods you used needs strict import rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants