Using RestKit in Swift

I successfully added the "RestKit" module to my project, and also followed the steps described in this article: Cocoapods in swift . I imported RestKit into my ViewController class source file:

 import RestKit 

But I donโ€™t know why I canโ€™t access it. It does not show any of the classes in RestKit. He shows:

'RestKit' There is no such module.


I tried again to create a new project and added "RestKit". and created the bridge header and imported "RestKit" into the claas ViewController source file. Now I run the project, it shows errors such as

  // in this file Pods-SOCKit-prefix.pch #ifdef __OBJC__ #import <UIKit/UIKit.h> #endif #import "Pods-environment.h" // Pods-environment.h file not found // and also in this file Pods-TransitionKit-prefix.pch #ifdef __OBJC__ #import <UIKit/UIKit.h> #endif #import "Pods-environment.h" // Pods-environment.h file not found 

If someone knows what the problem is, explain it to me and suggest a way to work with RestKit in Swift.

+5
source share
1 answer

I am not sure if you have Cocoapods issue. I added RestKit to my bridge header and there was no need to add import RestKit to my Swift file.

My bridge title is as follows:

 # if you are using Core Data: #import <CoreData/CoreData.h> #import <RestKit/RestKit.h> # if you are using Core Data: #import <RestKit/CoreData.h> 
+9
source

Source: https://habr.com/ru/post/1201638/


All Articles