Skip to content

Commit cab917b

Browse files
authored
fix(ios): enable dev menu on home screen (#1131)
1 parent 6e44c6e commit cab917b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ios/ReactTestApp/ContentView.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ final class ContentViewController: UITableViewController {
4949
fatalError("\(#function) has not been implemented")
5050
}
5151

52+
// MARK: - UIResponder overrides
53+
54+
override public func motionEnded(_: UIEvent.EventSubtype, with event: UIEvent?) {
55+
guard event?.subtype == .motionShake,
56+
let bridge = reactInstance.bridge,
57+
let settings = bridge.module(for: RCTDevSettings.self) as? RCTDevSettings,
58+
settings.isShakeToShowDevMenuEnabled,
59+
let devMenu = bridge.module(for: RCTDevMenu.self) as? RCTDevMenu
60+
else {
61+
return
62+
}
63+
64+
devMenu.show()
65+
}
66+
5267
// MARK: - UIViewController overrides
5368

5469
override public func viewDidLoad() {

0 commit comments

Comments
 (0)