diff --git a/Shared/Components/RefreshableScrollView.swift b/Shared/Components/RefreshableScrollView.swift index a0abf31..561ee30 100644 --- a/Shared/Components/RefreshableScrollView.swift +++ b/Shared/Components/RefreshableScrollView.swift @@ -14,6 +14,7 @@ struct RefreshableScrollView: UIViewRepresentable { func makeUIView(context: Context) -> UIScrollView { let scrollView = UIScrollView() + scrollView.delaysContentTouches = false let refreshControl = UIRefreshControl() refreshControl.addTarget(context.coordinator, action: #selector(Coordinator.handleRefresh), for: .valueChanged) diff --git a/Shared/Views/Tab/ContactsTab.swift b/Shared/Views/Tab/ContactsTab.swift index 6a896ab..8e23708 100644 --- a/Shared/Views/Tab/ContactsTab.swift +++ b/Shared/Views/Tab/ContactsTab.swift @@ -4,6 +4,7 @@ // // Created by cheykrym on 09/06/2025. // +// НЕ ИСПОЛЬЗУЕТСЯ import SwiftUI diff --git a/Shared/Views/Tab/HomeTab.swift b/Shared/Views/Tab/HomeTab.swift index 788ac3c..a027c92 100644 --- a/Shared/Views/Tab/HomeTab.swift +++ b/Shared/Views/Tab/HomeTab.swift @@ -22,7 +22,10 @@ struct HomeTab: View { } } } - .navigationTitle("Лента") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .principal) {} + } .onAppear { if posts.isEmpty { fetchData(isInitialLoad: true) @@ -35,6 +38,8 @@ struct HomeTab: View { private func fetchData(isInitialLoad: Bool = false) { if isInitialLoad { isLoading = true + } else { + isRefreshing = true } PostService.shared.fetchAllPosts { fetchedPosts in diff --git a/Shared/Views/Tab/Profile/ProfileTab.swift b/Shared/Views/Tab/ProfileTab.swift similarity index 89% rename from Shared/Views/Tab/Profile/ProfileTab.swift rename to Shared/Views/Tab/ProfileTab.swift index 0a132ac..25e64b8 100644 --- a/Shared/Views/Tab/Profile/ProfileTab.swift +++ b/Shared/Views/Tab/ProfileTab.swift @@ -22,13 +22,19 @@ struct ProfileTab: View { @State private var selectedPostData: (Post, [Post])? + @State private var isShowingFollowers = false + @State private var isShowingFollowing = false + var body: some View { NavigationView { if !isContentLoaded { SplashScreenView() } else { VStack(spacing: 0) { - // Скрытый NavigationLink для программного перехода + // Скрытые NavigationLink для программного перехода + NavigationLink(destination: FollowersView(followers: followers), isActive: $isShowingFollowers) { EmptyView() } + NavigationLink(destination: FollowingView(following: following), isActive: $isShowingFollowing) { EmptyView() } + if let (post, posts) = selectedPostData { NavigationLink( destination: PostFeedView(posts: posts, selectedPostID: post.id), @@ -65,7 +71,7 @@ struct ProfileTab: View { ToolbarItem(placement: .principal) { Button(action: { sheetType = .accountShare }) { HStack(spacing: 4) { - Text("custom_user_name") + Text(selectedAccount) .font(.headline) .foregroundColor(.primary) Image(systemName: "chevron.down") @@ -131,7 +137,7 @@ struct ProfileTab: View { .frame(width: 72, height: 72) .foregroundColor(.gray) - Text(selectedAccount) + Text("custom_user_name") .font(.headline) } .padding(.top, 16) @@ -145,10 +151,10 @@ struct ProfileTab: View { // Статистика HStack(spacing: 32) { statView("24", "Посты") - NavigationLink(destination: FollowersView(followers: followers)) { + Button(action: { isShowingFollowers = true }) { statView("1.2k", "Подписчики") } - NavigationLink(destination: FollowingView(following: following)) { + Button(action: { isShowingFollowing = true }) { statView("156", "Подписки") } } @@ -164,5 +170,6 @@ struct ProfileTab: View { Text(label) .font(.caption) } + .foregroundColor(.primary) } } diff --git a/Shared/Views/Tab/PublicsTab.swift b/Shared/Views/Tab/PublicsTab.swift index 50c40f4..cc6d66e 100644 --- a/Shared/Views/Tab/PublicsTab.swift +++ b/Shared/Views/Tab/PublicsTab.swift @@ -1,3 +1,5 @@ +// НЕ ИСПОЛЬЗУЕТСЯ + import SwiftUI struct PublicsTab: View { diff --git a/yobble.xcodeproj/project.pbxproj b/yobble.xcodeproj/project.pbxproj index 82d96ea..200fa38 100644 --- a/yobble.xcodeproj/project.pbxproj +++ b/yobble.xcodeproj/project.pbxproj @@ -250,13 +250,14 @@ 1AEE5EA92E21A4FC00A3DCA3 /* Tab */ = { isa = PBXGroup; children = ( - 1AEE5ECC2E21C9D100A3DCA3 /* Profile */, - 1A7940C52DF7A98E002569DA /* ContactsTab.swift */, - 1A7940C92DF7A99B002569DA /* ChatsTab.swift */, 1A7940B52DF77F21002569DA /* MainView.swift */, 1AEE5EAA2E21A83200A3DCA3 /* HomeTab.swift */, - 1AEE5EAE2E21A84500A3DCA3 /* PublicsTab.swift */, 1AEE5EB22E21A85800A3DCA3 /* SearchTab.swift */, + 1A7940C92DF7A99B002569DA /* ChatsTab.swift */, + 1A7940CD2DF7A9AA002569DA /* ProfileTab.swift */, + 1AEE5ECC2E21C9D100A3DCA3 /* Profile */, + 1A7940C52DF7A98E002569DA /* ContactsTab.swift */, + 1AEE5EAE2E21A84500A3DCA3 /* PublicsTab.swift */, ); path = Tab; sourceTree = ""; @@ -266,7 +267,6 @@ children = ( 1AD757CC2E27608C0069C1FD /* PostFeedView.swift */, 1ACE60FF2E22F54700B37AC5 /* Settings */, - 1A7940CD2DF7A9AA002569DA /* ProfileTab.swift */, 1AB4F8CC2E22E341002B6E40 /* AccountShareSheet.swift */, 1AE587242E23337000254F06 /* ProfileContentGrid.swift */, 1ACE61202E22FFD000B37AC5 /* ProfileContentTabbedGrid.swift */, diff --git a/yobble.xcodeproj/xcuserdata/cheykrym.xcuserdatad/xcschemes/xcschememanagement.plist b/yobble.xcodeproj/xcuserdata/cheykrym.xcuserdatad/xcschemes/xcschememanagement.plist index 2de711f..c9f74cd 100644 --- a/yobble.xcodeproj/xcuserdata/cheykrym.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/yobble.xcodeproj/xcuserdata/cheykrym.xcuserdatad/xcschemes/xcschememanagement.plist @@ -17,12 +17,12 @@ yobble (iOS).xcscheme_^#shared#^_ orderHint - 0 + 1 yobble (macOS).xcscheme_^#shared#^_ orderHint - 1 + 0