-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds dependency on CodeScanner library and refactors QR reader to SwiftUI view.
- Loading branch information
Showing
13 changed files
with
268 additions
and
453 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,34 @@ | ||
// | ||
// Links.swift | ||
// ArtAtGVSU | ||
// | ||
// Created by Josiah Campbell on 12/1/23. | ||
// Copyright © 2023 Applied Computing Institute. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Links { | ||
static func artworkDetail(id: String) -> URL { | ||
return URL(string: "https://artgallery.gvsu.edu/Detail/objects/\(id)")! | ||
} | ||
|
||
static func fromDetailLink(_ link: String) -> String? { | ||
guard let url = URL(string: link) else { | ||
return nil | ||
} | ||
|
||
if (!url.isDetailLink || url.pathComponents.isEmpty) { | ||
return nil | ||
} | ||
|
||
return url.pathComponents.last | ||
} | ||
} | ||
|
||
private extension URL { | ||
var isDetailLink: Bool { | ||
return scheme == "http" || scheme == "https" && | ||
host == "artgallery.gvsu.edu" | ||
} | ||
} |
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,25 @@ | ||
// | ||
// Logging.swift | ||
// ArtAtGVSU | ||
// | ||
// Created by Josiah Campbell on 12/1/23. | ||
// Copyright © 2023 Applied Computing Institute. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import os.log | ||
|
||
protocol Logging { | ||
var logger: Logger { get } | ||
static var logger: Logger { get } | ||
} | ||
|
||
extension Logging { | ||
var logger: Logger { | ||
Logger(subsystem: Bundle.main.bundleIdentifier!, category: String(describing: type(of: self))) | ||
} | ||
|
||
static var logger: Logger { | ||
Logger(subsystem: Bundle.main.bundleIdentifier!, category: String(describing: type(of: self))) | ||
} | ||
} |
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
Oops, something went wrong.