-
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.
创建历史记录视图 接下来,您将构建Scrumdinger的最后一个视图。您已使用语音识别器转录会议。现在,您将创建一个历史视图,以显示会议文本和与会者。
- Loading branch information
1 parent
8501127
commit 87bc990
Showing
5 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
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 modified
BIN
+142 Bytes
(100%)
...eproj/project.xcworkspace/xcuserdata/shiyulong.xcuserdatad/UserInterfaceState.xcuserstate
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// HistoryView.swift | ||
// SwiftUIPro | ||
// | ||
// Created by 石玉龙 on 2021/1/6. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct HistoryView: View { | ||
let history:History | ||
var body: some View { | ||
ScrollView{ | ||
VStack(alignment:.leading){ | ||
Divider() | ||
.padding(.bottom) | ||
Text("Attendees") | ||
.font(.headline) | ||
Text(history.attendeeString) | ||
if let transcript=history.transcript{ | ||
Text("Transcript") | ||
.font(.headline) | ||
.padding(.top) | ||
Text(transcript) | ||
} | ||
} | ||
} | ||
.navigationTitle(Text(history.date,style: .date)) | ||
.padding() | ||
} | ||
} | ||
extension History{ | ||
var attendeeString:String{ | ||
ListFormatter.localizedString(byJoining: attendees) | ||
} | ||
} | ||
struct HistoryView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
HistoryView(history: History(attendees: ["Jon", "Darla", "Luis"], lengthInMinutes: 10, transcript:"Darla, would you like to start today? Sure, yesterday I reviewed Luis' PR and met with the design team to finalize the UI...")) | ||
} | ||
} |
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