1 // Copyright 2022-present 650 Industries. All rights reserved. 2 3 import ABI48_0_0ExpoModulesCore 4 5 public final class BlurViewModule: Module { definitionnull6 public func definition() -> ModuleDefinition { 7 Name("ExpoBlurView") 8 9 View(BlurView.self) { 10 Prop("tint") { (view, tint: String) in 11 view.setTint(tint) 12 } 13 14 Prop("intensity") { (view, intensity: Double) in 15 view.setIntensity(intensity / 100) 16 } 17 } 18 19 AsyncFunction("setNativeProps") { (props: [String: Any], viewTag: Int) in 20 guard let view = appContext?.findView(withTag: viewTag, ofType: BlurView.self) else { 21 throw Exceptions.ViewNotFound((tag: viewTag, type: BlurView.self)) 22 } 23 if let tint = props["tint"] as? String { 24 view.setTint(tint) 25 } 26 if let intensity = props["intensity"] as? Double { 27 view.setIntensity(intensity / 100) 28 } 29 } 30 .runOnQueue(.main) 31 } 32 } 33