Skip to content

Commit 0ea2b55

Browse files
committed
Made necessary functions open and updated readme
1 parent e458fea commit 0ea2b55

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ and run `pod install`
3535

3636
## 👩‍💻 How to use
3737

38-
WaveTab can be used both programmatically and through storyboards. To use it programmatically, simply replace `UITabBarController` with `WaveTab` and it'll handle the rest. For usage in storyboards, just set your class of the selected `UITabBarController` to be a `WaveTab`.
38+
WaveTab can be used both programmatically and through storyboards. To use it programmatically, simply replace `UITabBarController` with `WaveTabBarController` and it'll handle the rest. For usage in storyboards, just set your class of the selected `UITabBarController` to be a `WaveTabBarController`.
39+
40+
If you inherit from the `WaveTabBarController` and call `func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem)`, you must call to the `super` class.
3941

4042
## 👨‍👩‍👧‍👦 Contributing
4143

WaveTab/Classes/Implementation/Wave Tab Bar Controller/WaveTabBarController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import UIKit
99

10-
class WaveTabBarController: UITabBarController, WaveTabBarProtocol {
10+
open class WaveTabBarController: UITabBarController, WaveTabBarProtocol {
1111

1212
private struct Constants {
1313

@@ -48,33 +48,33 @@ class WaveTabBarController: UITabBarController, WaveTabBarProtocol {
4848
presenter = WaveTabBarPresenterBase(view: self)
4949
}
5050

51-
required init?(coder aDecoder: NSCoder) {
51+
required public init?(coder aDecoder: NSCoder) {
5252
super.init(coder: aDecoder)
5353

5454
presenter = WaveTabBarPresenterBase(view: self)
5555
}
5656

5757
// MARK: - Lifecycle
5858

59-
override func viewDidLoad() {
59+
override open func viewDidLoad() {
6060
super.viewDidLoad()
6161

6262
presenter.viewDidLoad()
6363
}
6464

65-
override func viewDidAppear(_ animated: Bool) {
65+
override open func viewDidAppear(_ animated: Bool) {
6666
super.viewDidAppear(animated)
6767

6868
presenter.viewDidAppear(portrait: UIDevice.current.orientation.isPortrait)
6969
}
7070

7171
// MARK: - Overridden functions
7272

73-
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
73+
override open func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
7474
presenter.tabBarDidSelectItem(with: item.tag)
7575
}
7676

77-
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
77+
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
7878
super.viewWillTransition(to: size, with: coordinator)
7979

8080
DispatchQueue.main.async {

0 commit comments

Comments
 (0)