Introducción al curso
Construyamos una app para iOS
Introducción a la arquitectura MVVM
Planeando nuestra app
Creando las primeras pantallas de la app
Programando la primera pantalla en módulos
Escribiendo la lógica para mostrar dos pantallas
Pantalla de inicio de sesión con SecureField y Scroll
Completando nuestra pantalla de inicio de sesión
Pantalla de registro de usuario
Comprobando el funcionamiento de nuestras pantallas
Estructura de las pantallas con TabView
Creando nuestra pantalla home
Pantalla home: logo y barra de búsqueda
Pantalla home: programación de interfaces estáticas
Pantalla home: carruseles
Aplicando arquitectura MVVM
Creando estructura para arquitectura MVVM
Modelando nuestro JSON
Peticiones al servidor
Mostrar información de un servidor de manera dinámica
Mostrar imágenes de forma dinámica y eficiente con LazyVGrid
Reproductor y búsqueda de video
Pasar datos entre pantallas
Darle datos de inicio a un Canvas
Reproducir videos dinámicamente de un servidor
Mostrar imágenes dinámicamente de un servidor
Mostrar alertas
Programar clase de búsqueda
Programar método de búsqueda
Últimas pantallas de la app
Pantalla de favoritos
Pantalla de perfil de usuario
Módulo de ajustes de perfil con Toggle
Pantalla de edición de perfil
Módulo de edición de perfil
Guardado interno de datos
Utilizando la cámara y fotos del iPhone
Captura de foto de perfil: ImagePicker y vista Sheet
Captura de foto de perfil con la cámara: modificar librerías de terceros
Captura de foto de perfil con la cámara: recuperar imágenes guardadas
¿Qué más posibilidades tiene SwiftUI?
Mejoremos nuestra app
No tienes acceso a esta clase
¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera
Aportes 7
Preguntas 1
El código en structs para no repetir
struct TitleView:View {
var title: String
var body: some View{
Text(title)
.font(.title3)
.foregroundColor(.white)
.bold()
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
}
}
struct CategoryCarrouselItem:View {
var image, text: String
var action: () -> Void
var body: some View{
Button(action: action, label: {
ZStack{
RoundedRectangle(cornerRadius: 8)
.fill(Color("BlueGray"))
.frame(width: 160, height: 90)
VStack {
Image(image)
Image(text)
}
}
})
}
}
.padding(.top, 25)
Y la última sección “Videos que podrían gustarte”
Text("VIDEOS QUE PODRÍAN GUSTARTE")
.font(.title3)
.foregroundColor(.white)
.bold()
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
.padding(.top, 25)
ScrollView(.horizontal, showsIndicators: false)
{
HStack
{
//
Button(action: {
url = urlVideos[4]
print("URL: \(url)")
isPlayerActive = true
}, label: {
Image("lastofus").resizable()
.scaledToFit()
.frame(width: 240, height: 135)
})
//
Button(action: {
url = urlVideos[5]
print("URL: \(url)")
isPlayerActive = true
}, label: {
Image("destiny_complete").resizable()
.scaledToFit()
.frame(width: 240, height: 135)
})
//
Button(action: {
url = urlVideos[6]
print("URL: \(url)")
isPlayerActive = true
}, label: {
Image("spiderman").resizable()
.scaledToFit()
.frame(width: 240, height: 135)
})
}
Para los que vean esto en Xcode 16.0+
Los NavigationLink quedarían de la siguiente manera:
Primera parte del reproductor.
NavigationLink {
VideoPlayer(player: AVPlayer(url: URL(string: url)!)).frame(width: 420, height: 360, alignment: .center)
} label: {
ZStack{
Button {
url = urlVideos[0]
print("URL: \(url)")
isPlayerActive = true
} label: {
VStack(spacing: 0){
Image("The Witcher 3")
.resizable()
.scaledToFill()
Text("The Witcher 3")
.foregroundColor(.white)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color("blue-gray"))
}
}
Image(systemName: "play.circle.fill")
.resizable()
.foregroundColor(.white)
.frame(width: 42, height: 42)
}.frame(minWidth: 0, maxWidth: .infinity, alignment: .center)
.padding(.vertical)
}
Carrusel de imágenes de videojuegos.
ScrollView(.horizontal, showsIndicators: false){
HStack{
NavigationLink {
VideoPlayer(player: AVPlayer(url: URL(string: urlVideos[1])!)).frame(width: 420, height: 360, alignment: .center)
} label: {
Image("Abzu")
.resizable()
.scaledToFit()
.frame(width: 240, height: 135)
}
NavigationLink {
VideoPlayer(player: AVPlayer(url: URL(string: urlVideos[2])!)).frame(width: 420, height: 360, alignment: .center)
} label: {
Image("Crash Bandicoot")
.resizable()
.scaledToFit()
.frame(width: 240, height: 135)
}
NavigationLink {
VideoPlayer(player: AVPlayer(url: URL(string: urlVideos[3])!)).frame(width: 420, height: 360, alignment: .center)
} label: {
Image("DEATH STRANDING")
.resizable()
.scaledToFit()
.frame(width: 240, height: 135)
}
}
}
No te funciona el scroll vertical?
ScrollView(showsIndicators: false){
SubModuloHome()
}
De nada.
Mi .navigationBarHidden(true) dejo de funcionar, al parecer es un bug de swiftUI.
Reto
Text("Videos que podrían gustarte")
.font(.title3)
.foregroundColor(.white)
.bold()
.frame(maxWidth: .infinity, alignment: .leading)
ScrollView(.horizontal, showsIndicators: false) {
HStack {
Button(action: {
url = urlVideos[4]
print("URL:", url)
isPlayerActive = true
}) {
Image("Grand Theft Auto V")
.resizable()
.scaledToFit()
.frame(width: 240, height: 135)
}
Button(action: {
url = urlVideos[5]
print("URL:", url)
isPlayerActive = true
}) {
Image("Hades")
.resizable()
.scaledToFit()
.frame(width: 240, height: 135)
}
}
}
.padding(.bottom)
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?
o inicia sesión.