-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ParsaKargari <[email protected]>
- Loading branch information
1 parent
66d0289
commit 7a235ef
Showing
9 changed files
with
99 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// MainView.swift | ||
// InstReels | ||
// | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct FullVidView: View { | ||
|
||
init() { | ||
UITabBar.appearance().isHidden = true | ||
} | ||
|
||
@State var currentTab = "Reel" | ||
|
||
enum Tab: String, CaseIterable { | ||
case search = "Search", reel = "Reel", home = "Home" | ||
|
||
var image: String { | ||
switch self { | ||
case .home: "house.fill" | ||
case .search: "magnifyingglass" | ||
case .reel: "play.rectangle" | ||
} | ||
} | ||
} | ||
|
||
|
||
var body: some View { | ||
VStack(spacing: 0) { | ||
TabView(selection: $currentTab) { | ||
ForEach(Tab.allCases, id: \.self) { tab in | ||
|
||
if tab == .reel { | ||
ReelView() | ||
.tag(tab.rawValue) | ||
} else { | ||
Rectangle() | ||
.fill(Color(uiColor: .systemGray6)) | ||
.frame(width: 300, height: 500) | ||
.clipShape(RoundedRectangle(cornerRadius: 12)) | ||
.overlay { | ||
Text(tab.rawValue) | ||
} | ||
.tag(tab.rawValue) | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
HStack(spacing: 0) { | ||
ForEach(Tab.allCases, id: \.self) { tab in | ||
makeTabBarButton(for: tab) | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
extension FullVidView { | ||
private func makeTabBarButton(for tab: Tab) -> some View { | ||
Button { | ||
withAnimation { currentTab = tab.rawValue } | ||
} label: { | ||
Image(systemName: tab.image) | ||
.resizable() | ||
.renderingMode(.template) | ||
.foregroundStyle(.gray) | ||
.aspectRatio(contentMode: .fit) | ||
.frame(width: 26, height: 26) | ||
.padding(.top, 16) | ||
.frame(maxWidth: .infinity) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
FullVidView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters