Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 835 Bytes

File metadata and controls

17 lines (9 loc) · 835 Bytes

Objective-C Example

Make sure installation is complete and pre-requisites are met

HCaptcha exposes its API to real native code, so it can be used from Objective-C.

Because HCaptcha is a pure Swift library, it exposes its API through the @objc attribute.

The @objc attribute makes Swift methods, properties, and classes available to Objective-C code. By marking a Swift method or class with @objc, it is automatically bridged to Objective-C, allowing for interoperability between Swift and Objective-C.

Also because Objective-C doesn't support optional arguments, the most popular constructors of HCaptcha are available in Objective-C

The full code is in ViewController.m.


Back to the main README