Posts

Post marked as solved
1 Replies
I found an old .git folder 2 levels up from where my project .git folder is (the path to my project in my post was made up). I'm not sure why it was there but I'm sure it isn't needed. I deleted it and now the Apple repository is gone, so my problem is solved. Not sure why Xcode was picking up something from a .git folder 2 levels up from my project.
Post marked as solved
4 Replies
Here is the code using an ObservedObject. import SwiftUI import OSLog final class NavigationModel: ObservableObject { @Published var path = NavigationPath() { didSet { print("navigationModel.path.count: \(path.count)") } } } class Report: ObservableObject { @Published var title: String @Published var photo: UIImage? init(title: String, photo: UIImage? = UIImage(systemName: "z.circle")) { self.title = title self.photo = photo } } private let logger = Logger() struct ViewType: Identifiable, Hashable { let id: String } private var viewTypes = [ ViewType(id: "First View"), ] struct ContentView: View { @StateObject private var navigationModel = NavigationModel() @State var selection: Set<String> = [viewTypes[0].id] @StateObject var report = Report(title: "ContentView Report") var body: some View { NavigationSplitView { List(viewTypes, selection: $selection) { viewType in Text("\(viewType.id)") } } detail: { if let viewTitle = selection.first { switch viewTitle { case "First View": FirstView(report: report) default: Text("Invalid View") } } } .environmentObject(navigationModel) } } // FirstView struct FirstView: View { @EnvironmentObject var navigationModel: NavigationModel @ObservedObject var report: Report private enum NavigationLinkValueFirstView { case secondView } var body: some View { NavigationStack(path: $navigationModel.path) { NavigationLink(value: NavigationLinkValueFirstView.secondView) { let _ = logger.debug("FirstView NavigationLink") Text("Push Second View") } .navigationDestination(for: NavigationLinkValueFirstView.self) { value in let _ = logger.debug("FirstView navigationDestination") SecondView(report: report) } } .navigationTitle("First View") } } // SecondView struct SecondView: View { @State var showTheView = false @ObservedObject var report: Report private enum NavigationLinkValueSecondView { case firstView } var body: some View { NavigationLink(value: NavigationLinkValueSecondView.firstView) { let _ = logger.debug("SecondView NavigationLink") Text("Push New/Different Instantiation of First View") } .navigationDestination(for: NavigationLinkValueSecondView.self) { value in FirstView(report: report) let _ = logger.debug("SecondView navigationDestination") } .navigationTitle("Second View") } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Post marked as solved
7 Replies
I agree. That's why I used SHA512. Unfortunately, this is a legacy app and it was coded with Hmac-SHA512, the password was passed as the key, and there is a lot of data stored that way, so that‘s what I’ll have to continue to use,
Post marked as solved
7 Replies
Thank you. I hadn't realized that one was using Hmac-SHA512 and the other SHA512,
Post marked as solved
7 Replies
CCHmac takes both a key and data, where the CyrptoKit hash just takes data. In the CCHmac I'm passing the password for both the key and data. I guess the quesion is what do I pass CCHmac for the key?
Post marked as solved
7 Replies
That value isn't used, it's just a random value to allocate space for the digest that is returned. I had already tried 0, and that or any other value has no effect because it's just overwritten by the digest.