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.
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -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>
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-readium",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.4",
4
4
  "description": "A react-native wrapper for https://readium.org/",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",