diff --git a/ios/RIBs/Classes/DI/Component.swift b/ios/RIBs/Classes/DI/Component.swift index 4a178ff58..6c0d7cc3e 100644 --- a/ios/RIBs/Classes/DI/Component.swift +++ b/ios/RIBs/Classes/DI/Component.swift @@ -49,11 +49,7 @@ open class Component: Dependency { lock.unlock() } - // Additional nil coalescing is needed to mitigate a Swift bug appearing in Xcode 10. - // see https://bugs.swift.org/browse/SR-8704. - // Without this measure, calling `shared` from a function that returns an optional type - // will always pass the check below and return nil if the instance is not initialized. - if let instance = (sharedInstances[__function] as? T?) ?? nil { + if let instance = (sharedInstances[__function] as? T) { return instance }