Skip to content

How to use Nitro Image in nitro module library? #127

Description

@kerryaustin

I'm having trouble using nitro image in another nitro module. I've followed the instructions here and have successfully used NitroImage in android, but on iOS when trying to implement HybridImageSpec, xcode is giving the following error:

Type 'HybridUIImage' cannot conform to protocol 'HybridImageSpec_protocol' because it has requirements that cannot be satisfied

Here is the implementation (this is ripped straight from react-native-vision-camera).

import AVFoundation
import Foundation
import NitroImage
import NitroModules

internal final class HybridUIImage: HybridImageSpec, NativeImage {
  let uiImage: UIImage
  init(uiImage: UIImage) {
    self.uiImage = uiImage
  }
}

Did I miss a step/config? Any help would be much appreciated.

versions being used:

"react-native-nitro-image": "^0.14.0",
"react-native-nitro-modules": "^0.35.6",

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions