Skip to content

Commit d440175

Browse files
authored
fix: turbo modules with swift @objc annotation
1 parent 62b6897 commit d440175

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/the-new-architecture/turbo-modules-with-swift.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,22 @@ To achieve that, please follow these steps:
3333
```swift title="NativeLocalStorage.swift"
3434
import Foundation
3535

36-
@objc public class NativeLocalStorage: NSObject {
36+
@objcMembers public class NativeLocalStorage: NSObject {
3737
let userDefaults = UserDefaults(suiteName: "local-storage");
3838

39-
40-
@objc public func getItem(for key: String) -> String? {
39+
public func getItem(for key: String) -> String? {
4140
return userDefaults?.string(forKey: key)
4241
}
4342

44-
@objc public func setItem(for key: String, value: String) {
43+
public func setItem(for key: String, value: String) {
4544
userDefaults?.set(value, forKey: key)
4645
}
4746

48-
@objc public func removeItem(for key: String) {
47+
public func removeItem(for key: String) {
4948
userDefaults?.removeObject(forKey: key)
5049
}
5150

52-
@objc public func clear() {
51+
public func clear() {
5352
userDefaults?.dictionaryRepresentation().keys.forEach { removeItem(for: $0) }
5453
}
5554
}

0 commit comments

Comments
 (0)