Skip to content

Commit 68ec671

Browse files
author
Mithun
committed
Bug Fix: Beta 4
1 parent 3f65d4a commit 68ec671

File tree

7 files changed

+30
-23
lines changed

7 files changed

+30
-23
lines changed

DesignCode.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
ABB215E322DC7D0000424B38 /* TabBar.swift */,
8080
ABE07CC222D74F5700D209BE /* ContentView.swift */,
8181
AB62172622D870540039BC73 /* Home.swift */,
82-
ABB215E522DC808A00424B38 /* Settings.swift */,
83-
ABB215E722DC8ABD00424B38 /* CertificateRow.swift */,
82+
AB1D3B1B22D9CDEF00D0AEA6 /* HomeList.swift */,
8483
ABB215DD22DB713300424B38 /* UpdateList.swift */,
8584
ABB215DF22DB7F4700424B38 /* UpdateDetail.swift */,
8685
ABB215E122DC472900424B38 /* UpdateStore.swift */,
87-
AB1D3B1B22D9CDEF00D0AEA6 /* HomeList.swift */,
86+
ABB215E522DC808A00424B38 /* Settings.swift */,
87+
ABB215E722DC8ABD00424B38 /* CertificateRow.swift */,
8888
ABB215DB22DB353800424B38 /* BlurView.swift */,
8989
ABE07CC422D74F5900D209BE /* Assets.xcassets */,
9090
ABE07CC922D74F5900D209BE /* LaunchScreen.storyboard */,

DesignCode/ContentView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct ContentView: View {
3333
.scaleEffect(0.85)
3434
.rotationEffect(Angle(degrees: show ? 15 : 0))
3535
.blendMode(.hardLight)
36-
.animation(.basic(duration: 0.7, curve: .easeInOut))
36+
.animation(.easeInOut(duration: 0.6))
3737
.offset(x: viewState.width, y: viewState.height)
3838

3939
CardView()
@@ -44,7 +44,7 @@ struct ContentView: View {
4444
.scaleEffect(0.9)
4545
.rotationEffect(Angle(degrees: show ? 10 : 0))
4646
.blendMode(.hardLight)
47-
.animation(.basic(duration: 0.5, curve: .easeInOut))
47+
.animation(.easeInOut(duration: 0.4))
4848
.offset(x: viewState.width, y: viewState.height)
4949

5050
CertificateView()
@@ -98,11 +98,11 @@ struct CertificateView: View {
9898
Text(item.title)
9999
.font(.headline)
100100
.fontWeight(.bold)
101-
.color(Color("accent"))
101+
.foregroundColor(Color("accent"))
102102
.padding(.top)
103103

104104
Text("Certificate")
105-
.color(.white)
105+
.foregroundColor(.white)
106106
}
107107
Spacer()
108108

DesignCode/Home.swift

+10-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ struct Home: View {
2727
.frame(minWidth: 0, maxWidth: 712)
2828
.cornerRadius(30)
2929
.shadow(radius: 20)
30-
.animation(.fluidSpring())
30+
.animation(.spring())
3131
.offset(y: showProfile ? statusBarHeight + 40 : UIScreen.main.bounds.height)
3232

3333
MenuButton(show: $show)
3434
.offset(x: -40, y: showProfile ? statusBarHeight : 80)
35-
.animation(.fluidSpring())
35+
.animation(.spring())
3636

3737
MenuRight(show: $showProfile)
3838
.offset(x: -16, y: showProfile ? statusBarHeight : 88)
@@ -66,7 +66,7 @@ struct MenuRow: View {
6666

6767
Text(text)
6868
.font(.headline)
69-
.color(.primary)
69+
.foregroundColor(.primary)
7070

7171
Spacer()
7272
}
@@ -91,14 +91,16 @@ struct MenuView: View {
9191

9292
var menu = menuData
9393
@Binding var show: Bool
94+
@State var showSettings = false
9495

9596
var body: some View {
9697
return HStack {
9798
VStack(alignment: .leading) {
9899
ForEach(menu) { item in
99100
if item.title == "Settings" {
100-
PresentationLink(destination: Settings()) {
101+
Button(action: { self.showSettings.toggle() }) {
101102
MenuRow(image: item.icon, text: item.title)
103+
.sheet(isPresented: self.$showSettings) { Settings() }
102104
}
103105
} else {
104106
MenuRow(image: item.icon, text: item.title)
@@ -114,7 +116,7 @@ struct MenuView: View {
114116
.padding(.trailing, 60)
115117
.shadow(radius: 20)
116118
.rotation3DEffect(Angle(degrees: show ? 0 : 60), axis: (x: 0, y: 10.0, z: 0))
117-
.animation(.basic())
119+
.animation(.default)
118120
.offset(x: show ? 0 : -UIScreen.main.bounds.width)
119121
.tapAction {
120122
self.show.toggle()
@@ -167,15 +169,17 @@ struct MenuButton: View {
167169
struct MenuRight: View {
168170

169171
@Binding var show: Bool
172+
@State var showUpdate = false
170173

171174
var body: some View {
172175
return ZStack(alignment: .topTrailing) {
173176
HStack {
174177
Button(action: { self.show.toggle() }) {
175178
CircleButton(icon: "person.crop.circle")
176179
}
177-
PresentationLink(destination: UpdateList()) {
180+
Button(action: { self.showUpdate.toggle() }) {
178181
CircleButton(icon: "bell")
182+
.sheet(isPresented: self.$showUpdate) { UpdateList() }
179183
}
180184
}
181185
Spacer()

DesignCode/HomeList.swift

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import SwiftUI
1111
struct HomeList: View {
1212

1313
var courses = coursesData
14+
@State var showContent = false
1415

1516
var body: some View {
1617
ScrollView {
@@ -22,7 +23,7 @@ struct HomeList: View {
2223
.fontWeight(.heavy)
2324

2425
Text("22 Courses")
25-
.color(.gray)
26+
.foregroundColor(.gray)
2627
}
2728
Spacer()
2829
}
@@ -31,13 +32,15 @@ struct HomeList: View {
3132
ScrollView(.horizontal, showsIndicators: false) {
3233
HStack(spacing: 30.0) {
3334
ForEach(courses) { item in
34-
PresentationLink(destination: ContentView()) {
35+
Button(action: { self.showContent.toggle() }) {
3536
GeometryReader { geometry in
3637
CourseView(title: item.title,
3738
image: item.image,
3839
color: item.color,
3940
shadowColor: item.shadowColor)
40-
.rotation3DEffect(Angle(degrees: Double(geometry.frame(in: .global).minX - 30) / -40), axis: (x: 0, y: 10.0, z: 0))
41+
.rotation3DEffect(Angle(degrees:
42+
Double(geometry.frame(in: .global).minX - 30) / -40), axis: (x: 0, y: 10.0, z: 0))
43+
.sheet(isPresented: self.$showContent) { ContentView() }
4144
}
4245
.frame(width: 246, height: 360)
4346
}
@@ -75,7 +78,7 @@ struct CourseView: View {
7578
Text(title)
7679
.font(.title)
7780
.fontWeight(.bold)
78-
.color(.white)
81+
.foregroundColor(.white)
7982
.padding(30)
8083
.lineLimit(4)
8184
.padding(.trailing, 50)

DesignCode/Settings.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ struct Settings: View {
3030
Text("SwiftUI").tag(1)
3131
Text("React").tag(2)
3232
}
33-
DatePicker($date) {
33+
DatePicker(selection: $date, label: {
3434
Text("Date")
35-
}
35+
})
3636
Section(header: Text("Email")) {
3737
TextField("Your email: ", text: $email)
3838
.textFieldStyle(.roundedBorder)
3939
}
4040
Button(action: { self.submit.toggle() }) {
4141
Text("Submit")
4242
}
43-
.presentation($submit, alert: {
43+
.alert(isPresented: $submit, content: {
4444
Alert(title: Text("Thanks"), message: Text("Email: \(email)"))
4545
})
4646
}

DesignCode/UpdateList.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct UpdateList: View {
4747
Text(item.date)
4848
.font(.caption)
4949
.fontWeight(.bold)
50-
.color(.gray)
50+
.foregroundColor(.gray)
5151
}
5252
}
5353
}

DesignCode/UpdateStore.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import Combine
1010
import SwiftUI
1111

1212
class UpdateStore: BindableObject {
13-
var didChange = PassthroughSubject<Void, Never>()
13+
var willChange = PassthroughSubject<Void, Never>()
1414

1515
var updates: [Update] {
1616
didSet {
17-
didChange.send()
17+
willChange.send()
1818
}
1919
}
2020

0 commit comments

Comments
 (0)