Skip to content

Instantly share code, notes, and snippets.

@ijaureguialzo
Created December 1, 2021 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijaureguialzo/6304ea553c34d222aab48b0be0491519 to your computer and use it in GitHub Desktop.
Save ijaureguialzo/6304ea553c34d222aab48b0be0491519 to your computer and use it in GitHub Desktop.
Prueba de CocoaPods con SwiftUI
//
// ContentView.swift
// EjemploCocoaPods
//
// Created by Ion Jaureguialzo Sarasola on 1/12/21.
//
import SwiftUI
import Alamofire
struct ContentView: View {
@State var datos = "..."
var body: some View {
Text(datos)
.padding()
.onAppear {
leerFecha()
}
}
func leerFecha() {
AF.request("https://time.jaureguialzo.com").responseString { response in
datos = response.value ?? "?"
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment