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

I think protocol should inherit from AnyObject. #278

Closed
keisukeYamagishi opened this issue Sep 21, 2021 · 1 comment · May be fixed by #279
Closed

I think protocol should inherit from AnyObject. #278

keisukeYamagishi opened this issue Sep 21, 2021 · 1 comment · May be fixed by #279

Comments

@keisukeYamagishi
Copy link

keisukeYamagishi commented Sep 21, 2021

Expected Behavior

I think protocol should inherit from AnyObject.
As described in the following article, the specification is such that if you do not inherit AnyObject in protocol, you will get a warning.
Swift forums 'Class-only protocols, class vs AnyObject?'

Actual Behavior

Since the class is inherited by protocol, we get a warning.

Steps to Reproduce the Problem

  1. Build with Xcode

Specifications

  • Xcode version: 12.5
  • iOS version: 14.0
  • Dependency manager + version: n/a
@bannzai
Copy link
Owner

bannzai commented Oct 9, 2021

As described in the following article

Maybe swift forum link is https://forums.swift.org/t/class-only-protocols-class-vs-anyobject/11507.

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

Successfully merging a pull request may close this issue.

2 participants