generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
87 additions
and
12 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
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
// | ||
|
||
import Contacts | ||
import MessageUI | ||
@_implementationOnly import MessageUI | ||
import SpeziPersonalInfo | ||
import SpeziViews | ||
import SwiftUI | ||
|
@@ -238,9 +238,45 @@ struct ContactView_Previews: PreviewProvider { | |
] | ||
) | ||
} | ||
|
||
|
||
static let leland = Contact( | ||
name: PersonNameComponents( | ||
givenName: "Leland", | ||
familyName: "Stanford" | ||
), | ||
image: Image(systemName: "figure.wave.circle"), // swiftlint:disable:this accessibility_label_for_image | ||
Check failure on line 247 in Sources/SpeziContact/Contact Views/ContactView.swift GitHub Actions / SwiftLint / SwiftLint / SwiftLint
|
||
title: "University Founder", | ||
description: """ | ||
Amasa Leland Stanford (March 9, 1824 – June 21, 1893) was an American industrialist and politician. [...] \ | ||
He and his wife Jane were also the founders of Stanford University, which they named after their late son. | ||
[https://en.wikipedia.org/wiki/Leland_Stanford] | ||
""", | ||
organization: "Stanford University", | ||
address: { | ||
let address = CNMutablePostalAddress() | ||
address.country = "USA" | ||
address.state = "CA" | ||
address.postalCode = "94305" | ||
address.city = "Stanford" | ||
address.street = "450 Serra Mall" | ||
return address | ||
}(), | ||
contactOptions: [ | ||
.call("+1 (650) 723-2300"), | ||
.text("+1 (650) 723-2300"), | ||
.email(addresses: ["[email protected]"]), | ||
ContactOption( | ||
image: Image(systemName: "safari.fill"), // swiftlint:disable:this accessibility_label_for_image | ||
Check failure on line 269 in Sources/SpeziContact/Contact Views/ContactView.swift GitHub Actions / SwiftLint / SwiftLint / SwiftLint
|
||
title: "Website", | ||
action: {} | ||
) | ||
] | ||
) | ||
|
||
|
||
|
||
static var previews: some View { | ||
ContactView(contact: Self.leland) | ||
ContactView(contact: Self.mock) | ||
} | ||
} | ||
|
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
Binary file modified
BIN
-31.5 KB
(70%)
Sources/SpeziContact/SpeziContact.docc/Resources/Overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-35.8 KB
(67%)
Sources/SpeziContact/SpeziContact.docc/Resources/Overview~dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -11,6 +11,45 @@ import SwiftUI | |
|
||
|
||
struct ContactsTestsView: View { | ||
@MainActor | ||
static let leland = Contact( | ||
Check failure on line 15 in Tests/UITests/TestApp/ContactsTestsView.swift GitHub Actions / SwiftLint / SwiftLint / SwiftLint
|
||
name: PersonNameComponents( | ||
givenName: "Leland", | ||
familyName: "Stanford" | ||
), | ||
image: Image(systemName: "figure.wave.circle"), // swiftlint:disable:this accessibility_label_for_image | ||
title: "University Founder", | ||
description: """ | ||
Amasa Leland Stanford (March 9, 1824 – June 21, 1893) was an American industrialist and politician. [...] \ | ||
He and his wife Jane were also the founders of Stanford University, which they named after their late son. | ||
[https://en.wikipedia.org/wiki/Leland_Stanford] | ||
""", | ||
organization: "Stanford University", | ||
address: { | ||
let address = CNMutablePostalAddress() | ||
address.country = "USA" | ||
address.state = "CA" | ||
address.postalCode = "94305" | ||
address.city = "Stanford" | ||
address.street = "450 Serra Mall" | ||
return address | ||
}(), | ||
contactOptions: [ | ||
.call("+1 (650) 723-2300"), | ||
.text("+1 (650) 723-2300"), | ||
.email(addresses: ["[email protected]"]), | ||
ContactOption( | ||
image: Image(systemName: "safari.fill"), // swiftlint:disable:this accessibility_label_for_image | ||
title: "Website", | ||
action: { | ||
if let url = URL(string: "https://stanford.edu") { | ||
UIApplication.shared.open(url) | ||
} | ||
} | ||
) | ||
] | ||
) | ||
|
||
static let mock = Contact( | ||
name: PersonNameComponents(givenName: "Paul", familyName: "Schmiedmayer"), | ||
image: Image(systemName: "figure.wave.circle"), // swiftlint:disable:this accessibility_label_for_image | ||
|
@@ -41,7 +80,7 @@ struct ContactsTestsView: View { | |
|
||
|
||
var body: some View { | ||
ContactsList(contacts: [ContactsTestsView.mock, ContactsTestsView.mock]) | ||
ContactsList(contacts: [ContactsTestsView.mock, ContactsTestsView.leland]) | ||
.navigationTitle("Contacts") | ||
.background(Color(.systemGroupedBackground)) | ||
} | ||
|
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