@@ -10,121 +10,44 @@ import Foundation
1010import UIKit
1111
1212extension UICollectionViewScrollDirection {
13-
14- @available ( * , deprecated, message: " Use 'direction(withConfiguration:)' instead. " )
15- static func direction( ) -> UICollectionViewScrollDirection {
16- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
17- return . vertical
18- }
19-
20- return UICollectionViewScrollDirection . direction ( withConfiguration: readerConfig)
21- }
22-
2313 static func direction( withConfiguration readerConfig: FolioReaderConfig ) -> UICollectionViewScrollDirection {
2414 return readerConfig. isDirection ( . vertical, . horizontal, . horizontal)
2515 }
2616}
2717
2818extension UICollectionViewScrollPosition {
29-
30- @available ( * , deprecated, message: " Use 'direction(withConfiguration:)' instead. " )
31- static func direction( ) -> UICollectionViewScrollPosition {
32- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
33- return . top
34- }
35-
36- return UICollectionViewScrollPosition . direction ( withConfiguration: readerConfig)
37- }
38-
3919 static func direction( withConfiguration readerConfig: FolioReaderConfig ) -> UICollectionViewScrollPosition {
4020 return readerConfig. isDirection ( . top, . left, . left)
4121 }
4222}
4323
4424extension CGPoint {
45-
46- @available ( * , deprecated, message: " Use 'forDirection(withConfiguration:)' instead. " )
47- func forDirection( ) -> CGFloat {
48- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
49- return self . y
50- }
51-
52- return self . forDirection ( withConfiguration: readerConfig)
53- }
54-
5525 func forDirection( withConfiguration readerConfig: FolioReaderConfig , scrollType: ScrollType = . page) -> CGFloat {
5626 return readerConfig. isDirection ( self . y, self . x, ( ( scrollType == . page) ? self . y : self . x) )
5727 }
5828}
5929
6030extension CGSize {
61-
62- @available ( * , deprecated, message: " Use 'forDirection(withConfiguration:)' instead. " )
63- func forDirection( ) -> CGFloat {
64- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
65- return self . height
66- }
67- return self . forDirection ( withConfiguration: readerConfig)
68- }
69-
7031 func forDirection( withConfiguration readerConfig: FolioReaderConfig ) -> CGFloat {
7132 return readerConfig. isDirection ( height, width, height)
7233 }
7334
74- @available ( * , deprecated, message: " Use 'forReverseDirection(withConfiguration:)' instead. " )
75- func forReverseDirection( ) -> CGFloat {
76- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
77- return self . width
78- }
79-
80- return self . forReverseDirection ( withConfiguration: readerConfig)
81- }
82-
8335 func forReverseDirection( withConfiguration readerConfig: FolioReaderConfig ) -> CGFloat {
8436 return readerConfig. isDirection ( width, height, width)
8537 }
8638}
8739
8840extension CGRect {
89-
90- @available ( * , deprecated, message: " Use 'forDirection(withConfiguration:)' instead. " )
91- func forDirection( ) -> CGFloat {
92- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
93- return self . height
94- }
95-
96- return self . forDirection ( withConfiguration: readerConfig)
97- }
98-
9941 func forDirection( withConfiguration readerConfig: FolioReaderConfig ) -> CGFloat {
10042 return readerConfig. isDirection ( height, width, height)
10143 }
10244}
10345
10446extension ScrollDirection {
105-
106- @available ( * , deprecated, message: " Use 'negative(withConfiguration:)' instead. " )
107- static func negative( ) -> ScrollDirection {
108- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
109- return self . down
110- }
111-
112- return self . negative ( withConfiguration: readerConfig)
113- }
114-
11547 static func negative( withConfiguration readerConfig: FolioReaderConfig , scrollType: ScrollType = . page) -> ScrollDirection {
11648 return readerConfig. isDirection ( . down, . right, . right)
11749 }
11850
119- @available ( * , deprecated, message: " Use 'positive(withConfiguration:)' instead. " )
120- static func positive( ) -> ScrollDirection {
121- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
122- return self . up
123- }
124-
125- return self . positive ( withConfiguration: readerConfig)
126- }
127-
12851 static func positive( withConfiguration readerConfig: FolioReaderConfig , scrollType: ScrollType = . page) -> ScrollDirection {
12952 return readerConfig. isDirection ( . up, . left, . left)
13053 }
@@ -416,18 +339,6 @@ internal extension UIImage {
416339 self . init ( named: readerImageNamed, in: Bundle . frameworkBundle ( ) , compatibleWith: nil )
417340 }
418341
419- /// Forces the image to be colored with Reader Config tintColor
420- ///
421- /// - Returns: Returns a colored image
422- @available ( * , deprecated, message: " Use 'ignoreSystemTint(withConfiguration:)' instead. " )
423- func ignoreSystemTint( ) -> UIImage ? {
424- guard let readerConfig = FolioReader . shared. readerContainer? . readerConfig else {
425- return nil
426- }
427-
428- return self . ignoreSystemTint ( withConfiguration: readerConfig)
429- }
430-
431342 /// Forces the image to be colored with Reader Config tintColor
432343 ///
433344 /// - Parameter readerConfig: Current folio reader configuration.
@@ -519,15 +430,6 @@ internal extension UIImage {
519430
520431internal extension UIViewController {
521432
522- @available ( * , deprecated, message: " Use 'setCloseButton(withConfiguration:)' instead. " )
523- func setCloseButton( ) {
524- guard let config = FolioReader . shared. readerContainer? . readerConfig else {
525- return
526- }
527-
528- self . setCloseButton ( withConfiguration: config)
529- }
530-
531433 func setCloseButton( withConfiguration readerConfig: FolioReaderConfig ) {
532434 let closeImage = UIImage ( readerImageNamed: " icon-navbar-close " ) ? . ignoreSystemTint ( withConfiguration: readerConfig)
533435 self . navigationItem. leftBarButtonItem = UIBarButtonItem ( image: closeImage, style: . plain, target: self , action: #selector( dismiss as ( ) -> Void ) )
0 commit comments