There is a class A which is used in two the targets. but Class A's header and implementation is different for both targets. Can I have Class A twice? one for each target? or I have to rename one of the class and then import?
Asked
Active
Viewed 1,219 times
1
-
2Possible duplicate of [XCode - Same classe name, two targets](https://stackoverflow.com/questions/12347646/xcode-same-classe-name-two-targets) – Malik Aug 17 '17 at 07:24
-
If I add class with same name it gives error "duplicate interface defination for Class A". – Suraj Aug 17 '17 at 07:43
-
1why don't you name it with a different name ? – radkrish Aug 17 '17 at 09:30
-
for sanity it's probably best to rename to two classes, especially if they have different implementations. – Johnny Rockex Aug 17 '17 at 12:43
-
Okay. I will rename classes and use them. – Suraj Aug 18 '17 at 08:04
1 Answers
0
You can have "ClassA" for each target with the same name if they have different implementation. You only have to check the correct target for every "ClassA" file.

oskarko
- 3,382
- 1
- 26
- 26