Home Using a cocoaPod written in Swift in an Object-C project
Reply: 0

Using a cocoaPod written in Swift in an Object-C project

user1189
1#
user1189 Published in April 19, 2018, 9:57 am

I have a problem with the import of an external framework within a Swift class. My project uses cocoaPod to manage dependencies and is configured as follows:

  • Main project in OBject-C which uses a pod written in Swift (MyPod).

  • The Pod Swift (MyPod) must use an external framework (ExternalFramework) written in OBject-C.

There is no way to show ExternlFramewrok inside MyPod. I receive "Use of undeclared type" when I try to use any class of ExternlFramework in MyPod.

I attach the part of the MyPod .podspec:

 s.source_files = 'MyPod/Sources/**/*', 'MyPod/LibrariesHeaders/**/*.h'
 s.ios.vendored_library = 'MyPod/Libraries/*.a'
 s.private_header_files = 'MyPod/MyPod/headers/*.h'

 s.ios.vendored_frameworks = 'ExternalFramework.framework'

 s.frameworks ='ExternlFramework'

 s.prefix_header_contents = <<EOC

    #ifdef __OBJC__
        #import <Foundation/Foundation.h>
        #import <UIKit/UIKit.h>               
    #endif

EOC

Logically I can not modify ExternlFramework in any way but I can change MyPod as desired.

Any suggestions? Thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.541201 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO