Skip to content

Commit

Permalink
Better document need for declare_class! when conforming to protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 24, 2024
1 parent a6389c3 commit 702f367
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/objc2/src/macros/extern_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
/// general information about protocols in Objective-C.
///
/// This macro will create an `unsafe` trait with methods which all have
/// default implementations, such that an object that conforms to the protocol
/// can write `unsafe impl MyProtocol for MyClass {}`, and get access to the
/// functionality exposed by the protocol.
/// default implementations, such that an external class that conforms to the
/// protocol can write `unsafe impl MyProtocol for MyClass {}`, and get access
/// to the functionality exposed by the protocol.
///
/// Note that that conforming to a protocol in a custom object requires
/// putting the implementation inside the [`declare_class!`] invocation.
///
/// Objective-C has a smart feature where you can write `id<MyProtocol>`, and
/// then work with the protocol as-if it was an object; this is very similar
Expand Down

0 comments on commit 702f367

Please sign in to comment.