Skip to content

Instantly share code, notes, and snippets.

@paulw11
Last active January 23, 2022 19:08
Show Gist options
  • Save paulw11/7772e98743bcf39407e2bad884018330 to your computer and use it in GitHub Desktop.
Save paulw11/7772e98743bcf39407e2bad884018330 to your computer and use it in GitHub Desktop.
import Passbase
class MyPassbaseWrapper {
static func initialisePassbase:(_ apiKey: String) {
PassbaseSDK.initialize(publishableApiKey: apiKey)
}
}
@paulw11
Copy link
Author

paulw11 commented Jan 22, 2022

You might also need to add the @objc decorator to the function.

@dbarrett
Copy link

ok... will try. Thank you!

@dbarrett
Copy link

dbarrett commented Jan 23, 2022

These are the errors I get without making any changes to your code:

::ERROR:: swiftWrapper.swift:14:40: Expected '(' in argument list of function declaration
Current code: @objc static func initialisePassbase:(_ apiKey: String)
Xcode suggested change(fix): @objc static func initialisePassbase():(_ apiKey: String)
::ERROR:: swiftWrapper.swift:14:40: Expected '->' after function parameter tuple
Current code: @objc static func initialisePassbase:(_ apiKey: String)
Xcode suggested change(fix): @objc static func initialisePassbase -> (_ apiKey: String)
::ERROR:: swiftWrapper.swift:14:42: Tuple element cannot have two labels
Current code: @objc static func initialisePassbase:(_ apiKey: String)
Xcode suggested change(fix): @objc static func initialisePassbase:(String)
::ERROR:: swiftWrapper.swift:15:51: Cannot find 'apiKey' in scope
Current code: PassbaseSDK.initialize(publishableApiKey: apiKey)
Xcode suggested change(fix): NONE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment