Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aries framework swift sample 코드 분석 #40

Open
yangbongsoo opened this issue Dec 21, 2022 · 3 comments
Open

aries framework swift sample 코드 분석 #40

yangbongsoo opened this issue Dec 21, 2022 · 3 comments
Assignees
Labels

Comments

@yangbongsoo
Copy link
Owner

yangbongsoo commented Dec 21, 2022

//
//  WalletMainView.swift
//  wallet-app-ios
//

import SwiftUI

enum MainMenu: Identifiable {
    case qrcode, list, loading
    var id: Int {
        hashValue
    }
}

struct WalletMainView: View {
    @State var invitation: String = ""
    @StateObject var credentialHandler = CredentialHandler.shared

    var body: some View {
        ZStack {
            NavigationView {
                VStack {
                    List {
                        Button(action: {
                            credentialHandler.menu = .qrcode
                        }) {
                            Text("Connect")
                        }

                        Button(action: {
                            credentialHandler.menu = .list
                        }) {
                            Text("Credentials")
                        }
                    }
                    .navigationTitle("Wallet App")
                    .listStyle(.plain)

                    Spacer()

                    HStack {
                        TextField("invitation url", text: $invitation)
                            .textFieldStyle(.roundedBorder)

                        Button("Clear", action: {
                            invitation = ""
                        })
                        .buttonStyle(.bordered)
                        Button("Connect", action: {
                            QRCodeHandler().receiveInvitation(url: invitation)
                        })
                        .buttonStyle(.bordered)
                    }
                    .padding()
                }
            }
            .sheet(item: $credentialHandler.menu) { item in
                switch item {
                case .qrcode:
                    QRScanView(handler: QRCodeHandler())
                case .list:
                    CredentialListView()
                case .loading:
                    Text("Processing ...")
                }
            }
            .alert(item: $credentialHandler.actionType) { item in
                switch item {
                case .credOffer:
                    return Alert(title: Text("Credential"), message: Text(credentialHandler.confirmMessage), primaryButton: .default(Text("OK"), action: {
                        credentialHandler.getCredential()
                    }), secondaryButton: .cancel())
                case .proofRequest:
                    return Alert(title: Text("Proof"), message: Text(credentialHandler.confirmMessage), primaryButton: .default(Text("OK"), action: {
                        credentialHandler.sendProof()
                    }), secondaryButton: .cancel())
                }
            }
            .alert(credentialHandler.alertMessage, isPresented: $credentialHandler.showAlert) {}
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        WalletMainView()
    }
}
@yangbongsoo yangbongsoo self-assigned this Dec 21, 2022
@yangbongsoo
Copy link
Owner Author

yangbongsoo commented Dec 21, 2022

precompiled 에서 platform.hpp file not found 에러가 왜 발생하는지

스크린샷 2022-12-21 오후 7 15 03

인텔 맥북으로 해도 동일하게 발생함
스크린샷 2022-12-21 오후 10 33 24

@yangbongsoo
Copy link
Owner Author

Building on Apple silicon Mac is not supported yet

@yangbongsoo
Copy link
Owner Author

yangbongsoo commented Dec 22, 2022

cmake 가 깔려있어야함. 근데 brew install cmake 해도 바로 되진 않음 캐시된게 있음 cocoapod 캐시 삭제하고 다시 pod install
hyperledger/aries-framework-swift#14 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant