You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To properly handle interface orientation changes in iOS, you need to update your AppDelegate file. Since React Native
70
102
0.77, the AppDelegate has been migrated to Swift, so see the instructions below for both Swift and Objective-C.
71
103
72
-
### Objective-C
104
+
####Objective-C
73
105
74
106
In your AppDelegate.h file, import "OrientationDirector.h" and implement supportedInterfaceOrientationsForWindow method as follows:
75
107
@@ -82,7 +114,7 @@ In your AppDelegate.h file, import "OrientationDirector.h" and implement support
82
114
}
83
115
```
84
116
85
-
### Swift
117
+
####Swift
86
118
87
119
You need to create a [bridging header](https://developer.apple.com/documentation/swift/importing-objective-c-into-swift#Import-Code-Within-an-App-Target)
If you need help, you can check the example project.
103
135
104
-
There is no need to do anything in Android, it works out of the box.
105
-
106
136
## Usage
107
137
108
138
This library exports a class called: [RNOrientationDirector](https://github.com/gladiuscode/react-native-orientation-director/blob/main/src/RNOrientationDirector.ts) that exposes the following methods:
// React Native Orientation Director @generated begin @react-native-orientation-director/library-import - expo prebuild (DO NOT MODIFY) sync-dd77fee7fe624fed474053ea60c3105920a01a6a
// React Native Orientation Director @generated begin @react-native-orientation-director/supportedInterfaceOrientationsFor-implementation - expo prebuild (DO NOT MODIFY) sync-7a5cdf10057b2ddf1bcf4593bf408862cbed5473
0 commit comments