how to import MBCalendarKit in your swift project - swift

when I try to import MBCalendarKit in my project, it shows no such module error and linker command error. I tried all the solution given in stackoverflow under this topic and no success. help me.
Thanks in advance.

I've just imported into a test project, and using the latest version of Xcode (7.2.1) it's slightly different than the installation instructions.
Assuming you're using pods, install the pod and make sure to open the .xcworkspace file.
Next add a bridging header to the project, and import the main calendar kit file, like so
#import <MBCalendarKit/CalendarKit.h>
Inside your UIViewController subclass, import MBCalendarKit like so:
import MBCalendarKit
Celebrate!

Related

Cocoapod not importing properly

I have some proprietary code I'm not able to share. But I need to import the code into another project. We typically use cocoapods for this sort of things but this project is behaving differently, and I can't figure out why. In the first project, let's call it FooKit, there are a number of dependencies which have been imported as pods, lets call them BarKit, BazKit, and ZotKit. I ran the create podspec command and built it all out correctly (I think), linting the podspec isn't throwing anything unexpected.
To test this out, I create a new project, which is just an empty project. I did the whole pod init. I setup the podfile and ran pod install, and it ran successfully. In the workspace, I now have the App and Pods projects. If I tap on the Pods project, I can see the list of targets. All of the dependencies of the FooKit have been installed, and they are all yellow toolbox icons. FooKit is also in the list of targets, but its icon is a red bullseye.
In the App project, if I go into the view controller and do
import Foundation
import FooKit
class viewController: UIViewController {
// View Controller boiler plate code
}
I get the error No such module 'FooKit'. But I can import any of the dependencies of FooKit, like this
import Foundation
import BarKit
import BazKit
import ZotKit
// View controller code from above
That doesn't throw any errors. What am I doing wrong? I need to access the functions built out in FooKit.
Thanks all
The issue ended up being that in the new podspec I had made, I hadn't specified some of the other dependencies for BazKit. This made it so that certain .swift files in both the new project I had made and the FooKit project were showing different versions. When I had specified in the podspec for FooKit all the correct dependencies versions, then everything resolved itself.

No such module 'GoogleAPIClientForREST'

I am attempting to import GoogleAPIClientForREST but Xcode is unable to find the module. I installed the following pods:
pod 'GoogleSignIn'
pod 'GoogleAPIClientForREST/Calendar'
GoogleSignIn is working and looks like all of the necessary files for GoogleAPIClientForREST were created in the project. In addition, I created a bridging header file with the following code:
#import "GTMAppAuth/GTMAppAuth.h"
#import "GTMSessionFetcher/GTMSessionFetcherLogging.h"
Not sure what I am doing wrong? I know others have run into this issue and I went through all of the provided solutions to no avail. I think I may need to add drag GTLR.framework to the project's Linked Frameworks source group, but am not sure how to do that nor if I actually need to given I installed GoogleAPIClient via cocoapods. I am using Xcode 12.4 and a laptop with the M1 chip if that makes a difference.
Thank you for the help!
Figured it out: needed to add: #import "GTLRCalendar.h" to my bridging file and did not need to add: import GoogleAPIClientForRest at the top of my files

Swift 4.0 No such module 'libxmlKanna'?

https://github.com/tid-kijyun/Kanna
I use Manual Installation
Ive tried multiple variations of this, but none of them seem to work. Any ideas?
Thanks in advance.
I was facing the same problem, but I followed the instructions given here:
https://github.com/tid-kijyun/Kanna#manual-installation
And it works for me!
I am on Xcode 9.4.1. My project uses swift 4.1.
Make sure you give proper path
$(SRCROOT)/Modules
in the target Build settings to the Swift Compiler - Search Paths > Import Paths field.
Once this is done, remove the following import statement from your file:
import Kanna
From the github link you shared, it seems the easiest way is to add pod 'Kanna' to your podfile, run pod install in your terminal, build your project cmd + b and then add import Kanna in your project. You said import libxmlKanna ?? Just try import Kanna

How to install SpriteKit-Spring extension

I want to use the SpriteKit-Spring Extension in my Swift SpriteKit project, but I do not get it working.
The GitHub repro is here, although there is an instruction, I do not get it working in my project.
So what I did is:
I downloaded the file 'SpriteKit-Spring.swift'
dragged it into my Xcode project
added 'import SpriteKit_Spring' at the top of my GameScene.swift file.
And then I got the error from the compiler, that there is no such module 'SpriteKit_Spring'.
What did I do wrong? I thought I followed the instructions. And I did not get the pods install right unfortunately, thats why I added this extension manually.

ios-ntp with Xcode 7 and swift 2.0

I am trying to integrate ios-ntp into my project, which I develop using Xcode 7, swift 2.0 and cocoapods. I am adding the library as a pod. But when I try to add <ios-ntp/ios-ntp.h> to my app-BridigingHeader.h, Xcode doesn't recognize it. When I try to simply import the module and use it by #import ios_ntp ; Xcode complains that he is not able to build module 'ios_ntp'. Am I doing smth wrong?
upd. Actually Xcode is not able to build the module due to the error
'GCDAsyncUdpSocket.h' file not found
but that framework is present and added in 'ios-ntp' pod spec as dependent.
You shouldn't need to #import the library in your bridging header, Cocoapods should take care of making your pods available in Swift.
In your Swift files, have you tried import ios_ntp to import the library?
EDIT: Think I got it. Not 100% sure on why this is happening, but my hunch is that it's related to Cocoapods and ios-ntp's dependency on CocoaAsyncSocket. Something about ios-ntp's import of a CocoaAsyncSocket header is creating a circular dependency, which is borking ios-ntp's build.
Solution:
https://github.com/ruddct/ios-ntp should do the trick, that branch contains a few very minor header changes to forward declare the CocoaAsyncSocket stuff in ios-ntp's headers, which fixes the issue.
See How to prevent circular reference when Swift bridging header imports a file that imports Hopscotch-Swift.h itself for more background on this issue.
When you use Pods, you have to:
Open Pods.xcodeproj
In Targets select ios-ntp
Select 'Build Phases' tab
Add GCDAsyncSocket.h and GCDAsyncUDPSocket.h to Compile Sources and Headers
Remember to set 'Allow Non-modular includes in Framework Modules' to Yes in ios-ntp
For me, this works.