Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 947 Bytes

Annotation classes.md

File metadata and controls

31 lines (21 loc) · 947 Bytes

Annotation classes

Annotations are not supported and are not included in the .h file.

Explanations

Let's add annotations in Kotlin:

@Target(AnnotationTarget.CLASS)
annotation class AnnotationClassExample

@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS)
annotation class BinaryClassExample

@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS)
annotation class RuntimeAnnotationClass

@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class SourceAnnotationClass

Regardless of the specified retentions, the annotations did not get into the .h file, and they cannot be used in Swift.

Swift does not have annotations in the sense that they exist in Kotlin, but there are attributes that are used for specific purposes.


Table of contents