BLWebSocketsServer
BLWebSocketsServer copied to clipboard
Advice on using with Swift with a framework target
I'm having some trouble adding BLWebSocketsServer to a Swift project with a framework as a target.
I've tried adding the BLWebSocketsServer in several ways and followed Apple's guidelines in adding the import statement to my umbrella header.
@benlodotcom - do you think you could give this a try and see if you can figure it out?
Thanks!
These are the steps I've taken:
Step 1
git add submodule [email protected]:benlodotcom/BLWebSocketsServer.git External/BLWebSocketsServer
Step 2
Added the BLWebSocketsDirectory
(Added folders: Create groups)
Step 3
Linked libz.dylib
with the target
Step 4
Tried to build:
Step 5 Set "Treat Warnings as Errors" to "No" (for now).
Step 6 Tried to build. 21 issues, mostly "Implicit conversion loses integer precision" warnings, and:
Worth noting that at this point at haven't even tried importing the header file and gotten into anything Swift related yet.
So, contrary to the README
, adding -fno-objc-arc
to BLWebSocketsServer.m
in Build Phases -> Compile Sources caused the build to succeed.
After that I needed to move BLWebSocketsServer.h
to Public in Build Phases -> Compile Sources in order to import it in my umbrella header file and have the build succeed.
This appears to work although there are lots of warnings.
Re-opened just get some clarity on the ARC flag, and anything else I may have done incorrectly.
I haven't tried this yet, did you get other warnings apart from the one you describe in #7 ?
Only the ones mentioned in step 6.
Just want to add that this is not related to swift - I added the project to an objective-c framework of mine and also got a compiler error on the use of dispatch_release()
.
I should remove this now, this was necessary only for < iOS 6 support.