mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #269] Support for integration into Objective-C project? #157
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dfclark on GitHub (Aug 17, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/269
So far I've been unable to get this framework to integrate with an existing project written in Objective-C, either a standalone app or a framework that is consumed by that app. I add the OAuthSwift project to the target project, or I add the framework in via the Build Phases tab, and all seems as it should be, but "@import OAuthSwift" in an Objective-C class, or "import OAuthSwift" in a Swift class, results in the compiler reporting No such module" Could you provide any guidance?
@phimage commented on GitHub (Aug 17, 2016):
Could you try with cocoapod or Carthage
I am not sure that you add the project correctly by reading the error message
Or there is elsewhere an other error message about OAuthSwift, a framework build issue
General guidance https://github.com/gergelyorosz/swift-objective-c-mixed-project
Maybe there is some code that cannot bé converted (generic enum...)
@dfclark commented on GitHub (Aug 17, 2016):
First I tried adding the OAuthSwift project as described in the README on the github page, and that didn’t work. So I built the framework using Carthage, added the resulting OAuthSwift.framework into the project (via the Build Phases page for the consuming project), and that didn’t work either.
Following the link you provided led to this bit on that page:
Invoking Swift code from Objective C
#import "MixedLanugageExample-Swift.h"
https://github.com/gergelyorosz/swift-objective-c-mixed-project#unit-testing-swift-classes-from-objective-c
This applies for accessing Swift code compiled in the project, and there is a chicken & egg problem with this too. Suppose I have a project named foo, and inside it I have a Swift class named bar. When I build the project, as long as nothing references bar yet, the bar declarations/definitions will be added to the foo-Swift.h file. The foo-Swift.h file is constructed down inside the build folder hierarchy, and must then be manually copied up to the project file so that it can be included in the foo project settings (and later checked into the VCS). If the build fails (perhaps because some code in foo is already referencing bar) the foo-Swift.h file won’t be built. Assuming that the header file was built, and copied to the project file, and referenced from the project settings, now Objective-C code in the foo project can reference bar, because now it’s defined. But that doesn’t apply to a framework that is incorporated into a project like foo – the framework is included, is not re-compiled, is not referenced in the foo-Swift file, and thus cannot be resolved by the compiler.
There must be a way to do this, but so far it has eluded me.
Thanks for the response.
From: Eric Marchand <notifications@github.commailto:notifications@github.com>
Reply-To: OAuthSwift/OAuthSwift <reply@reply.github.commailto:reply@reply.github.com>
Date: Wednesday, August 17, 2016 at 3:50 PM
To: OAuthSwift/OAuthSwift <OAuthSwift@noreply.github.commailto:OAuthSwift@noreply.github.com>
Cc: Don Clark <don_clark@onsetcomp.commailto:don_clark@onsetcomp.com>, Author <author@noreply.github.commailto:author@noreply.github.com>
Subject: [GRAYMAIL] Re: [OAuthSwift/OAuthSwift] Support for integration into Objective-C project? (#269)
Could you try with cocoapod or Carthage
I am not sure that you add the project correctly by reading the error message
Or there is elsewhere an other error message about OAuthSwift, a framework build issue
General guidance https://github.com/gergelyorosz/swift-objective-c-mixed-project
Maybe there is some code that cannot bé converted (generic enum...)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/OAuthSwift/OAuthSwift/issues/269#issuecomment-240526592, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJWcFcEgb2Hy2DF8suM96-3H8hTpv4p3ks5qg2YSgaJpZM4Jm0Fm.
@phimage commented on GitHub (Aug 19, 2016):
I try with cocoapod
the framework has been compiled, header generated in the "Headers" folder of ios framework OAuthSwift-swift.h
In my objc class I add
and test with
@phimage commented on GitHub (Sep 22, 2016):
I close because that's work for me (cocoapod tested only), feel free to open an other issue or comment this one (I will reopen it)
@smbhuin commented on GitHub (Nov 2, 2016):
authorize method not generating in objc in OAuthSwift class, so it completely useless in objc project.
@phimage commented on GitHub (Nov 2, 2016):
@5mb so you comment in closed issue... please see open issue