react-native-readium 1.0.0-alpha.3 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/Readium.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Readium.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Readium.xcodeproj/project.xcworkspace/xcuserdata/jspizziri.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Readium.xcodeproj/xcuserdata/jspizziri.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/ReadiumView.swift +7 -4
- package/package.json +1 -1
|
Binary file
|
package/ios/Readium.xcodeproj/xcuserdata/jspizziri.xcuserdatad/xcschemes/xcschememanagement.plist
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Readium.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
package/ios/ReadiumView.swift
CHANGED
|
@@ -9,6 +9,10 @@ import R2Navigator
|
|
|
9
9
|
class ReadiumView : UIView, Loggable {
|
|
10
10
|
var readerService: ReaderService = ReaderService()
|
|
11
11
|
var readerViewController: ReaderViewController?
|
|
12
|
+
var viewController: UIViewController? {
|
|
13
|
+
let viewController = sequence(first: self, next: { $0.next }).first(where: { $0 is UIViewController })
|
|
14
|
+
return viewController as? UIViewController
|
|
15
|
+
}
|
|
12
16
|
private var subscriptions = Set<AnyCancellable>()
|
|
13
17
|
|
|
14
18
|
@objc var file: NSDictionary? = nil {
|
|
@@ -138,11 +142,12 @@ class ReadiumView : UIView, Loggable {
|
|
|
138
142
|
self.updateUserSettings(settings)
|
|
139
143
|
}
|
|
140
144
|
|
|
141
|
-
let rootViewController = UIApplication.shared.delegate?.window??.rootViewController
|
|
142
|
-
rootViewController?.addChild(readerViewController!)
|
|
143
145
|
readerViewController!.view.frame = self.superview!.frame
|
|
146
|
+
self.viewController!.addChild(readerViewController!)
|
|
144
147
|
let rootView = self.readerViewController!.view!
|
|
145
148
|
self.addSubview(rootView)
|
|
149
|
+
self.viewController!.addChild(readerViewController!)
|
|
150
|
+
self.readerViewController!.didMove(toParent: self.viewController!)
|
|
146
151
|
|
|
147
152
|
// bind the reader's view to be constrained to its parent
|
|
148
153
|
rootView.translatesAutoresizingMaskIntoConstraints = false
|
|
@@ -150,7 +155,5 @@ class ReadiumView : UIView, Loggable {
|
|
|
150
155
|
rootView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
|
|
151
156
|
rootView.leftAnchor.constraint(equalTo: self.leftAnchor).isActive = true
|
|
152
157
|
rootView.rightAnchor.constraint(equalTo: self.rightAnchor).isActive = true
|
|
153
|
-
|
|
154
|
-
self.readerViewController!.didMove(toParent: rootViewController)
|
|
155
158
|
}
|
|
156
159
|
}
|