Skip to content

Commit

Permalink
perf: Mark all protocols as AnyObject, since they're always class…
Browse files Browse the repository at this point in the history
…es (#176)
  • Loading branch information
mrousavy authored Oct 5, 2024
1 parent a4e15b5 commit 0d06c78
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/nitrogen/src/syntax/swift/SwiftHybridObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import NitroModules
* }
* \`\`\`
*/
public protocol ${protocolName}: ${baseClasses.join(', ')} {
public protocol ${protocolName}: AnyObject, ${baseClasses.join(', ')} {
// Properties
${indent(properties, ' ')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NitroModules
* }
* ```
*/
public protocol HybridBaseSpec: HybridObjectSpec {
public protocol HybridBaseSpec: AnyObject, HybridObjectSpec {
// Properties
var baseValue: Double { get }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NitroModules
* }
* ```
*/
public protocol HybridChildSpec: HybridObjectSpec, HybridBaseSpec {
public protocol HybridChildSpec: AnyObject, HybridObjectSpec, HybridBaseSpec {
// Properties
var childValue: Double { get }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NitroModules
* }
* ```
*/
public protocol HybridImageFactorySpec: HybridObjectSpec {
public protocol HybridImageFactorySpec: AnyObject, HybridObjectSpec {
// Properties


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NitroModules
* }
* ```
*/
public protocol HybridImageSpec: HybridObjectSpec {
public protocol HybridImageSpec: AnyObject, HybridObjectSpec {
// Properties
var size: ImageSize { get }
var pixelFormat: PixelFormat { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NitroModules
* }
* ```
*/
public protocol HybridTestObjectSwiftKotlinSpec: HybridObjectSpec {
public protocol HybridTestObjectSwiftKotlinSpec: AnyObject, HybridObjectSpec {
// Properties
var thisObject: HybridTestObjectSwiftKotlinSpec { get }
var numberValue: Double { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
/**
* A base protocol for all Swift-based Hybrid Objects.
*/
public protocol HybridObjectSpec {
public protocol HybridObjectSpec: AnyObject {
/**
* Holds the C++ HybridObject and it's context.
* Use the default initializer in your implementation, C++ will set and get this value.
Expand Down

0 comments on commit 0d06c78

Please sign in to comment.