sjrmanning / Birdsong

:bird::musical_score: Swift WebSockets client for Phoenix Channels.
MIT License
127 stars 37 forks source link

Fresh clone does not compile in Xcode #28

Open linovate opened 4 years ago

linovate commented 4 years ago

Following is the XCode error I got when open fresh clone from this github page, could someone shed some light on how to fix it?

Showing All Messages :-1: ../Birdsong/Example/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example.debug.xcconfig: unable to open file (in target "Birdsong_Example" in project "Birdsong") (in target 'Birdsong_Example')

linovate commented 4 years ago

I was able to compile it after doing a pod update. However, when I tried to add Birdsong pod to an existing iOS project using swift 4.0 (which uses a few other pods already), I always get errors like following:

self.channel = self.socket.channel("rooms:lobby", payload: ["user": "test"]) //'Cannot assign value of type 'Channel' to type 'Channel?''

self.channel?.on("new:msg", callback: { response in self.lastMessageLabel.text = "Received message: (response.payload["body"]!)" }) //Value of type 'Channel' has no member 'on'; did you mean 'zone'?

self.channel?.join()?.receive("ok", callback: { payload in self.lastMessageLabel.text = "Joined channel: (self.channel!.topic)" }).receive("error", callback: { payload in self.lastMessageLabel.text = "Failed joining channel." }) //Value of type 'Channel' has no member 'join'

Here the part I added to Podfile for Birdsong:

pod 'Birdsong', :path => '../'

:path => '../' gives me error during pod install.

pod 'Birdsong', '~> 0.6'

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| puts "[post install] " << target.name << ":" << config.name << " set SWIFT_VERSION to 4.0" config.build_settings['SWIFT_VERSION'] = '4.0' end end end

Could some one shed some light on how to add Birdsong pod to an existing iOS project? Thanks a lot !