// // ContentView.swift // AcaMate // // Created by Sean Kim on 11/26/24. // import SwiftUI import Combine private var cancellables = Set() struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") .background(Color("Point/Dark")) Button { SNSLogin().login(type: .Kakao) // self.versionCheck() } label : { Text("카카오") } } .padding() } func versionCheck() { loadAPIData(url: "https://devacamate.ipstein.myds.me", path: "/api/v1/in/app/version", method: .get, parameters: [ "type": "I"], decodingType: APIResponse.self) .sink { completion in switch completion { case .failure(let error): printLog("ERROR: \(error)") case .finished: printLog("Version call Successed") } } receiveValue: { data in guard let responseData = data as? APIResponse else {return} printLog(responseData.status.toStringDict()) printLog(responseData.data.toStringDict()) } .store(in: &cancellables) } } #Preview { ContentView() }