Swiftystorekit: How to use this library in objective-c project?

Created on 31 Dec 2016  路  7Comments  路  Source: bizz84/SwiftyStoreKit

It will be great if we can use SwiftyStoreKit in old OC project. Please consider this suggestion.

answered question

Most helpful comment

Currently, SwiftyStoreKit cannot be used in Objective-C projects.

The main limitation is that most classes and types in the library are Swift-only.

To address this, two routes are possible:

  1. Make all public symbols in SwiftyStoreKit Objective-C compatible (for example by changing class SwiftyStoreKit to class SwiftyStoreKit: NSObject)
  2. Write an Objective-C Swift wrapper on top of SwiftyStoreKit and wrap all required types.

Any pull requests for option 1 are welcome. From a maintainer standpoint I wish for the API and code to remain as clean as possible. Any proposed changes will be reviewed with this in mind.

Option 2. may be a quick solution for clients but I would be inclined to not merge this in the main codebase.

Popular ObjC alternatives:

All 7 comments

+100

+1

Any alternatives you guys are currently using for Objective-C projects?

Currently, SwiftyStoreKit cannot be used in Objective-C projects.

The main limitation is that most classes and types in the library are Swift-only.

To address this, two routes are possible:

  1. Make all public symbols in SwiftyStoreKit Objective-C compatible (for example by changing class SwiftyStoreKit to class SwiftyStoreKit: NSObject)
  2. Write an Objective-C Swift wrapper on top of SwiftyStoreKit and wrap all required types.

Any pull requests for option 1 are welcome. From a maintainer standpoint I wish for the API and code to remain as clean as possible. Any proposed changes will be reviewed with this in mind.

Option 2. may be a quick solution for clients but I would be inclined to not merge this in the main codebase.

Popular ObjC alternatives:

As outlined in the project guidelines, Objective-C support is not planned for this library.

If you want to use this library on Objective-C projects, I suggest writing an Objective-C compatible Swift wrapper for the specific functionality that you need, and import that.

I'm going to close this issue for now.

@bizz84 did anyone ever take up option 1? I dont have the time now, but would be willing to help down the line.

Please support objective-c
Thanks

Was this page helpful?
0 / 5 - 0 ratings