Skip to content
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

[swift2objc] Support Protocols #1832

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nikeokoronkwo
Copy link
Contributor

From https://docs.swift.org/swift-book/documentation/the-swift-programming-language/protocols/#Protocol-Extensions:

A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be adopted by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to conform to that protocol.

This pull request adds support for parsing protocols by achieving the following:

  • Adding support for parsing basic protocols
  • Adding parsing support for optional methods and properties
  • Adding parsing support for conformed protocols (protocols that the given protocol inherits)
  • Adding support for custom types in protocols via associatedTypes
  • Adding support for methods and properties that act as default initialisations for protocols
  • Writing tests that cover all given requirements

See #1828 for more information

@nikeokoronkwo
Copy link
Contributor Author

Extension support (#1815) might need to be added to implement default initialisation functionality

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

Successfully merging this pull request may close these issues.

1 participant