Skip to content

Commit 5b5737a

Browse files
ramz1tdefaultdino
andauthored
#156 - iOS 26 update (#157)
* updated colors * fixed widget background * minor design updates with liquid glass * new TabView for iOS 26 * fixed next class location button * added last synced status * added special event text * updated news item sheet * added new localization strings * updated feedback email * conversations resolved * moved tabbar items in account * Add 'buy me a coffee' link and remove github link from Settings. * Bump version 3.9.1 -> 4.0.0 --------- Co-authored-by: Adis Veletanlic <[email protected]>
1 parent ca99423 commit 5b5737a

File tree

39 files changed

+302
-114
lines changed

39 files changed

+302
-114
lines changed

App/Extensions/Presentation/View/UIApplicationExtension.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ extension UIApplication {
1414
private var keyWindow: UIWindow? {
1515
/// Get connected scenes
1616
return UIApplication.shared.connectedScenes
17-
/// Keep only active scenes, onscreen and visible to the user
17+
/// Keep only active scenes, onscreen and visible to the user
1818
.filter { $0.activationState == .foregroundActive }
19-
/// Keep only the first `UIWindowScene`
19+
/// Keep only the first `UIWindowScene`
2020
.first(where: { $0 is UIWindowScene })
21-
/// Get its associated windows
21+
/// Get its associated windows
2222
.flatMap { $0 as? UIWindowScene }?.windows
23-
/// Finally, keep only the key window
23+
/// Finally, keep only the key window
2424
.first(where: \.isKeyWindow)
2525
}
2626

2727
/// Opens the default mail application on users
2828
/// phones and allows them to send an email to support
2929
func shareFeedback() {
30-
if let url = URL(string: "mailto:tumbleapps.studios@gmail.com") {
30+
if let url = URL(string: "mailto:support@tumbleforkronox.com") {
3131
UIApplication.shared.open(url)
3232
}
3333
}
@@ -44,6 +44,12 @@ extension UIApplication {
4444
}
4545
}
4646

47+
func openBuyMeACoffee() {
48+
if let url = URL(string: "https://buymeacoffee.com/defaultdino") {
49+
UIApplication.shared.open(url)
50+
}
51+
}
52+
4753
/// Opens the App Store application with the review
4854
/// sheet already opened
4955
func openAppStoreForReview() {

App/Extensions/Presentation/View/ViewExtensions.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ extension View {
3333

3434
func searchBox() -> some View {
3535
padding(10)
36-
.background(Color.gray.opacity(0.2))
37-
.cornerRadius(10)
36+
.apply {
37+
if #available(iOS 26.0, *) {
38+
$0.glassEffect(.regular.interactive())
39+
} else {
40+
$0
41+
.background(Color.gray.opacity(0.15))
42+
.cornerRadius(10)
43+
}
44+
}
3845
}
3946

4047
func getRect() -> CGRect {
@@ -46,4 +53,8 @@ extension View {
4653
.foregroundColor(.onBackground)
4754
.padding(.top, 5)
4855
}
56+
57+
func apply<V: View>(@ViewBuilder _ block: (Self) -> V) -> V {
58+
block(self)
59+
}
4960
}

App/Presentation/Styles/ButtonStyles/Bookmarks/ToTopButtonStyle.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ import SwiftUI
1111
struct ToTopButtonStyle: ButtonStyle {
1212
func makeBody(configuration: Self.Configuration) -> some View {
1313
configuration.label
14-
.background(Color.primary)
15-
.clipShape(Circle())
16-
.cornerRadius(40)
17-
.scaleEffect(configuration.isPressed ? 0.9 : 1)
18-
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
14+
.apply {
15+
if #available(iOS 26.0, *) {
16+
$0.glassEffect(.regular.interactive().tint(.primary))
17+
} else {
18+
$0
19+
.background(Color.primary)
20+
.clipShape(Circle())
21+
.cornerRadius(40)
22+
.scaleEffect(configuration.isPressed ? 0.9 : 1)
23+
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
24+
}
25+
}
1926
}
2027
}

App/Presentation/Styles/ButtonStyles/CloseButtonStyle.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ struct CloseButtonStyle: ButtonStyle {
1313
func makeBody(configuration: Self.Configuration) -> some View {
1414
configuration.label
1515
.padding(10)
16-
.background(Color.surface)
16+
.apply {
17+
if #available(iOS 26.0, *) {
18+
$0.glassEffect()
19+
} else {
20+
$0.background(Color.surface)
21+
}
22+
}
1723
.cornerRadius(25)
1824
.scaleEffect(configuration.isPressed ? 0.9 : 1)
1925
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)

App/Presentation/Styles/ButtonStyles/SearchMenuActionStyle.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ struct SearchMenuActionStyle: ButtonStyle {
1212
func makeBody(configuration: Self.Configuration) -> some View {
1313
configuration.label
1414
.padding(10)
15-
.background(Color.primary)
16-
.cornerRadius(15)
17-
.scaleEffect(configuration.isPressed ? 0.9 : 1)
18-
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
15+
.apply {
16+
if #available(iOS 26.0, *) {
17+
$0.glassEffect(.regular.interactive().tint(.primary))
18+
} else {
19+
$0
20+
.background(Color.primary)
21+
.cornerRadius(15)
22+
.scaleEffect(configuration.isPressed ? 0.9 : 1)
23+
.animation(.easeOut(duration: 0.2), value: configuration.isPressed)
24+
}
25+
}
1926
}
2027
}

App/Presentation/Types/Types.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99
import SwiftUI
1010

1111
/// Bottom tab bar
12-
enum TabbarTabType: String {
12+
enum TabbarTabType: String, Identifiable {
1313
case home = "house"
1414
case bookmarks = "bookmark"
1515
case account = "graduationcap"
@@ -29,6 +29,8 @@ enum TabbarTabType: String {
2929
return NSLocalizedString("Search", comment: "")
3030
}
3131
}
32+
33+
var id: String { rawValue }
3234
}
3335

3436
/// Bookmarks page switcher options
@@ -62,3 +64,4 @@ enum ViewType {
6264
}
6365

6466
}
67+

App/Presentation/Views/Account/Account.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,23 @@ struct Account: View {
3030
.if(viewModel.authStatus == .authorized) { view in
3131
view.navigationTitle(NSLocalizedString("Account", comment: ""))
3232
}
33-
.navigationBarItems(trailing: HStack {
34-
if viewModel.authStatus == .authorized {
35-
SignOutButton(showConfirmationDialog: {
36-
isSigningOut = true
37-
})
33+
.toolbar {
34+
ToolbarItem(placement: .topBarLeading) {
35+
if viewModel.authStatus == .authorized {
36+
SignOutButton(showConfirmationDialog: {
37+
isSigningOut = true
38+
})
39+
.confirmationDialog(LocalizedStringKey("Are you sure you want to log out of your account?"), isPresented: $isSigningOut, actions: {
40+
Button(LocalizedStringKey("Yes"), action: logOut)
41+
}, message: {
42+
Text(LocalizedStringKey("Are you sure you want to log out of your account?"))
43+
})
44+
}
3845
}
39-
SettingsButton()
40-
})
41-
.confirmationDialog(LocalizedStringKey("Are you sure you want to log out of your account?"), isPresented: $isSigningOut, actions: {
42-
Button(LocalizedStringKey("Yes"), action: logOut)
43-
}, message: {
44-
Text(LocalizedStringKey("Are you sure you want to log out of your account?"))
45-
})
46+
ToolbarItem(placement: .primaryAction) {
47+
SettingsButton()
48+
}
49+
}
4650

4751
}
4852
.tag(TabbarTabType.account)

App/Presentation/Views/Account/Login/PasswordField.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ struct PasswordField: View {
4747
Spacer()
4848
}
4949
.padding(Spacing.medium)
50-
.background(Color.surface)
51-
.cornerRadius(15)
50+
.apply {
51+
if #available(iOS 26.0, *) {
52+
$0.glassEffect(.regular.interactive())
53+
} else {
54+
$0
55+
.background(Color.surface)
56+
.cornerRadius(15)
57+
}
58+
}
5259
}
5360
}

App/Presentation/Views/Account/Login/UsernameField.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ struct UsernameField: View {
2525
Spacer()
2626
}
2727
.padding(Spacing.medium)
28-
.background(Color.surface)
29-
.cornerRadius(15)
28+
.apply {
29+
if #available(iOS 26.0, *) {
30+
$0.glassEffect(.regular.interactive())
31+
} else {
32+
$0
33+
.background(Color.surface)
34+
.cornerRadius(15)
35+
}
36+
}
3037
.padding(.bottom, Spacing.small)
3138
}
3239
}

App/Presentation/Views/AppParent.swift

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct AppParent: View {
2222

2323
init(viewModel: ParentViewModel) {
2424
navigationBarAppearance.titleTextAttributes = [.font: navigationBarFont()]
25-
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor(named: "OnSurface")!]
25+
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor(named: "OnBackground")!]
2626

2727
self.viewModel = viewModel
2828
self.homeView = Home(
@@ -35,28 +35,49 @@ struct AppParent: View {
3535
self.searchView = Search(viewModel: viewModel.searchViewModel).eraseToAnyView()
3636
}
3737

38+
@ViewBuilder
39+
private func getView(for tab: TabbarTabType) -> some View {
40+
switch tab {
41+
case .home: homeView
42+
case .bookmarks: bookmarkView
43+
case .account: accountView
44+
case .search: searchView
45+
}
46+
}
3847

3948
var body: some View {
4049
VStack (spacing: 0) {
41-
ZStack {
42-
homeView
43-
.opacity(appController.selectedAppTab == .home ? 1 : 0)
44-
bookmarkView
45-
.opacity(appController.selectedAppTab == .bookmarks ? 1 : 0)
46-
searchView
47-
.opacity(appController.selectedAppTab == .search ? 1 : 0)
48-
accountView
49-
.opacity(appController.selectedAppTab == .account ? 1 : 0)
50+
if #available(iOS 26.0, *) {
51+
TabView {
52+
ForEach(TabbarTabType.allValues) { tab in
53+
Tab("", systemImage: tab.rawValue) {
54+
getView(for: tab)
55+
}
56+
}
57+
}
58+
.onChange(of: appController.selectedAppTab) { oldValue, newValue in
59+
HapticsController.triggerHapticLight()
60+
}
61+
} else {
62+
ZStack {
63+
homeView
64+
.opacity(appController.selectedAppTab == .home ? 1 : 0)
65+
bookmarkView
66+
.opacity(appController.selectedAppTab == .bookmarks ? 1 : 0)
67+
searchView
68+
.opacity(appController.selectedAppTab == .search ? 1 : 0)
69+
accountView
70+
.opacity(appController.selectedAppTab == .account ? 1 : 0)
71+
}
72+
CustomTabBar(selectedTab: $appController.selectedAppTab)
5073
}
51-
CustomTabBar(selectedTab: $appController.selectedAppTab)
5274
}
5375
.ignoresSafeArea(.keyboard)
5476
.fullScreenCover(isPresented: $viewModel.userNotOnBoarded, content: {
5577
OnBoarding(finishOnBoarding: viewModel.finishOnboarding)
5678
})
5779
.navigationViewStyle(StackNavigationViewStyle())
5880
.onOpenURL(perform: { url in
59-
/// To be changed to user preference
6081
if PreferenceManager().openEventFromWidget {
6182
guard let event = RealmManager().getEventByEventId(eventId: url.absoluteString) else { return }
6283
AppController.shared.eventSheet = EventDetailsSheetModel(event: event)

0 commit comments

Comments
 (0)