Woopra / Woopra-iOS

MIT License
1 stars 5 forks source link

Expose classes and members to Objective-C #10

Closed JungHsuan closed 6 months ago

JungHsuan commented 6 months ago

Purpose:

Exposing swift classes and members to Objective-C.

Changes:

  1. Adding @objcMembers to public classes.
  2. Make WIdentify an internal class as it can only be accessed from WTracker

Expected Behavior:

  1. Public methods can be accessed in an Objective-C code.
  2. WIdentify is not available for public access.

How To Verify it:

  1. Trying to use WIdentify directly, there should be a compile error of "cannot find WIdentify" or "undeclared identifier WIdentify"
  2. Trying to call API in Objective-C, you can directly add the following code in AppDelegate.m in AIQUA project. Remember to import the headers in the file:
    #import "WoopraSDK/WoopraSDK.h"
    #import "WoopraSDK/WoopraSDK-Swift.h"