Questions tagged [swiftui-tabview]

For questions about TabView - a component in Apple's SwiftUI framework that switches between multiple child views using interactive user interface elements. When using this tag also include the more generic [swiftui] tag where possible.

Links:

  • Apple Developer Documentation for TabView.
325 questions
1
vote
2 answers

SwiftUI onAppear called when TabView is released

I have a TabView with 4 tabs (page1, page2, page3, menu). When I click on any tab, onAppear is called, the problem is when I select menu and then click logout to switch from TabView to Login screen, all pages loaded before are called again (onAppear…
OuSS
  • 19
  • 3
1
vote
2 answers

What is the height of the SwiftUI TabView index with PageTabViewStyle?

I am writing an application using Xcode 14.0.1, and testing on an iPhone 12 mini running iOS 16.0. The current project build is for iOS 14.7. Here is my TabView... TabView { ByEyeView() .tabItem {…
Richard Kirk
  • 281
  • 1
  • 12
1
vote
0 answers

How to create tableView and collectionview in swiftUI

I have been working on an e-commerce project that is for the IOS application. I am using SwiftUi for the UI instead of UIKIT. Now i am new to swiftUI and i have no idea to how to develop homescreen that contains tableview and collectionview. I…
Hasnain ahmad
  • 301
  • 1
  • 10
  • 33
1
vote
1 answer

How to popToRoot with the new iOS 16 NavigationStack inside a TabView?

I would like to be able to popToRoot from my first tabItem (when im on page2 (from first tabItem) and tap twice on first tabItem when im on second tabItem) without having to use the NavigationViewKit package and only the new NavigationStack, is that…
1
vote
1 answer

NavigationStack in combination with a TabView (SwiftUI, iOS16)

What is the correct way to combine the mentioned views. As of now, i have a NavigationStack at the bottom of my app. It displays a LaunchView as root. When a user is authenticated, the main view is added to the stack, if not, the login/ register…
lr058
  • 273
  • 2
  • 11
1
vote
0 answers

Use TabView to implement inifinite scroll like the WeekView of Calendar app

I am trying to implement a component with a "Horizontal Scroll View" of weekdays similar to the iOS Calendar App. When the user swipe left/right, the dates in scope will be updated to the previous/next week with animation just like the pagers. I…
Sheffield
  • 355
  • 4
  • 18
1
vote
0 answers

matchedGeometryEffect does not work for same object on different tab views

I was working on an app store mock up project and I was trying to implement the "Hero" Animation. At first the matchedGeometryEffect was working fine for the home page. Ideal Effect However on another tab view, when the same picture was show in…
GeekNomore
  • 13
  • 4
1
vote
1 answer

SwiftUI Tabbed View prevent swipe to next tab

I'm trying to prevent swiping to the second tab until the user has clicked a button on the first tabbed view indicating the data is complete. Then the user can swipe. I thought it was @State in the first tab view since it's the source of truth and a…
darkenney
  • 37
  • 1
  • 6
1
vote
1 answer

How to dismiss all the navigationLink views by tapping on TabItem?

ContentView.swift TabView{ RoomListView(myRoom: $viewModel.rooms) .onAppear { viewModel.populateRoomList() viewModel.roomJoinRequestUpdate() } .tabItem {Label("Rooms",…
1
vote
1 answer

Size A TabView With PageTabViewStyle at a Certain Aspect Ratio in SwiftUI

I want to display a paging view of images sized to a certain aspect ratio. This is straightforward enough with a single image, but using a TabView seems to have some strange sizing behavior. I can't get it to size correctly within the stack that it…
Chris
  • 1,750
  • 2
  • 14
  • 23
1
vote
2 answers

SwiftUI TabView doesn't not update ui

import SwiftUI import UIKit import Foundation struct ContentView: View { @State private var tabSelection = 0 let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() var body: some View { …
1
vote
0 answers

How to manually reload any row in swiftUI

I wanted to create List in SwiftUI with following requirements: Each row has some detail, and Toggle which represents its isEnabled status. If someone enables or disables that toggle, then based on some logic, Either I have to allow its to be…
Mehul Thakkar
  • 12,440
  • 10
  • 52
  • 81
1
vote
1 answer

SwiftUI - How to add a pageTabView inside a scrollview with PinnedViews

I had one problem while using SwiftUI. I have implemented a sectionHeader using PinnedView which is currently scrollable all up and down, has a header area, and is LazyVStack. Below is the implementation to show the corresponding content. struct…
okstring
  • 11
  • 1
1
vote
1 answer

Adding animation to TabViews in SwiftUI when switching between tabs

The question might look familiar, but I went through all solutions on this topic but none had a working approach for the latest versions of SwiftUI and iOS. So here is my tab view, I am trying to animate when switching between the tabs. I tried…
1
vote
1 answer

SwiftUI TabView is not working properly on Orientation Change

I created a simple tabView like this struct ContentView: View { var body: some View { TabView{ TabItemView(color: .red, title: "Page 1") TabItemView(color: .yellow, title: "Page 2") TabItemView(color:…
Ae Ri
  • 185
  • 1
  • 12