Cannot Import SocketIOClientSwift - ios

I have manually dragged the source folder to the Xcode project and then tried importing the module. Despite that I get an error when I try to add it to my app.
https://github.com/socketio/socket.io-client-swift

Related

Install SwiftKeychainWrapper manually

I would like to install SwiftKeychainWrapper manually because I get error when I try to install it using CocoaPods.
In description it says that I need to download and drop KeychainWrapper.swift and KeychainItemAcessibility.swift into my project.
I clicked on Clone or download -> Download ZIP. In downloaded SwiftKeychainWrapper folder there are KeychainWrapper.swift and KeychainItemAcessibility.swift files. I drag and dropped them to my project under the same root where there are Main.storyboard, AppDelegate.swift,...
Then is says to use the keychain wrapper in your app, import SwiftKeychainWrapper into the file(s) where you want to use it.
I added import SwiftKeychainWrapper to a file where I want to use it and I get error No such module 'SwiftKeychainWrapper'.
What am I doing wrong, why can't I use it?
Just as #dan said you don't need to import any other modules if you add source files directly to your project. When a library is added via cocoapods, all of it's sources are in a separate module and you need to do import ModuleName to make them accessible.
If your read carefully github instructions, you'll find that for manual approach you should only copy the files and nothing more:
Manually
Download and drop KeychainWrapper.swift and
KeychainItemAcessibility.swift into your project.
P.S. Also make sure that you copy those files into you project folder before dragging them into Xcode because that will just add links to files in your Downloads folder or wherever they are placed.

Import my custom module/framework Xcode Swift

I want to import my custom module/framework in my Swift project on Xcode 7. I understand how to normally do it. But I don't want to keep dragging and dropping my framework and linking it every time I make a new project. I was thinking I could move the framework to folders in the iPhoneOS.sdk/../Frameworks folder and/or the iPhoneSimulator.sdk/../Frameworks folder. Without dragging or dropping my custom framework into the project, I can import module (with autocomplete). However I get an error "Could not build Objective-C module 'Tumblr'". Is there a Setting in Build Settings I am missing.
**The Tumblr module is a module I created.
I have also created a .tbd and module.map files for the framework existing in the iPhoneOS.sdk
Drag your module's x-code project into the left pane with all the files.
Then click on your main project file and go to general, scroll down to Embedded Binaries and add it through the menu there.

ResearchKit headers not able to import in Xcode

I am making an app using the ResearchKit framework of Apple.
I have followed the installation guide of ResearchKit on GitHub and added the files to my project. Now when I am trying to import the header files of this framework, I get an error:
File not found
What I did:
I created a new project named CreatingTasks.xcodeproj.
Then I added ResearchKit files by dragging the researchKit.xcodeproj in my navigation controller, and embedding the ResearchKit framework in embedded binaries.
Now I want to create a simple task in my existing view controller but I am unable to import the header files.
You need to build the ResearchKit target once first. Then you should be able to import ResearchKit. If that doesn't help, please post a project on GitHub and give us a link.

Library only accessible from AppDelegate

I'm trying to get a library to work on my Swift project via Cocoapod.
I've created a Bridging header file, and I'm importing the headers of my library in there. When I try to instantiate an object from a class of this library in my AppDelegate, I get no issues.
Trouble comes when I try to do the same thing from any other file. I have Use of unresolved identifier 'FooBar'.
I've tried to import the library manually instead of using Cocoapod,
but no luck.
I've also tried to use a different library but I'm met with the exact
same problem.
XCode doesn't seem to have any problems with the Bridging file, I've
created my own and I get no complaints at compile.

Unable to correctly import framework into xcode project

I'm trying to add KKGridView to my project. I've followed thier description from github as best I can:
Create a new workspace in Xcode in the same directory as your existing *.xcodeproj.
Drag in your existing Xcode project
Locate your copy of KKGridView, drag KKGridView.xcodeproj into the
workspace so that it stays at the top of the hierarchy, just like
your original project.
In the Build Phases section of your original project, link your
project with libKKGridView.a.
Now, simply import KKGridView just like an Apple framework:
But libKKGridView appears in red in my project, and I am unable to import any of the code with
#import <KKGridView/KKGridView.h>
Any ideas?
Copy this file physically to your folder,and then add file to xcode from there.Drag and drop create this problem sometimes.
Hope this helps you.
You need to import the .h files as well

Resources