-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: do not rerender tab on navigate #26
Conversation
Conflicts: Sources/TabBar/View/TabBar.swift
Conflicts: Sources/TabBar/View/TabBar.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello and thanks for your PR!
I have indicated some small issues that should be fixed before we move forward with the merge. Also, if the thing with ignoring keyboard area is not connected with the issue #7, it should be moved into separate PR.
@@ -5,7 +5,7 @@ import PackageDescription | |||
let package = Package( | |||
name: "TabBar", | |||
platforms: [ | |||
.iOS(.v13) | |||
.iOS("14") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use .v14
value here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content | ||
.opacity(self.item == self.selectionObject.selection ? 1 : 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct indentation of opacity
modifier
ZStack { | ||
self.content | ||
.environmentObject(self.selectedItem) | ||
.padding(.bottom, 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please clarify why we need this padding here, and what does value of 50 points mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Child view of TabBar collides with TabBar without this. 50 is the DefaultTabBarStyle tabbar height. Bottom 50px of view is not visible without this padding.
self.items = value | ||
} | ||
} | ||
.ignoresSafeArea(.keyboard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why we need this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use a keyboard inside a child view of tabbar. The tabbar moves up with keyboard without this modifier. This is the reason I increased iOS version from 13 to 14.
Ignoring keyboard codes are not related. Sorry for that, I will seperate. |
by using opacity, instead of if; tabs view state stays on changing to another tab. If you have a scroll view and user scrolled, switching tab and returning back preserves scroll view state. Tab view do not reinit.