-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Objective-C support #32
base: master
Are you sure you want to change the base?
Conversation
@Eradash thanks for the effort.
:) |
The problem comes with the callback... The method can't be marked with |
@Eradash can you please show how you're calling the library function from your objective c? |
My class is implementing the new - (void)biometricResultOK {
}
- (void)biometricErrorWithError:(enum AuthenticationErrorOBJC)error {
}
- (void)authenticate:(UITapGestureRecognizer *)gesture {
[BioMetricAuthenticator authenticateWithPasscodeWithReason:@"Test" cancelTitle:@"Cancel test" completion:self];
} |
@Eradash why do you want to go with the protocol approach? I agree that may be swift completion with result type is not accessible from the objc, Converting or making it reverse compatible with objc is not a good solution though. |
I'm quite new to Objective C and Swift, and this solution was the fastest and easiest way for me to make the library works |
|
This will create a real mess in every project in objc that wants to implement your library. It creates a other file were code can be, and debugging and maintainability are affected. I don't intend to make the switch to Swift in my project, and I think I'm not the only one only for a library. |
I needed to use this library inside an Objective-C project. This is the modifications I've done to make it work.