GridTrending.swift
      
  
// // GridTrending.swift // MovieLookUp // // Created by Alexander Pahl // 13.08.24 - 14.08.24 //
import SwiftUI
struct GridTrending: View {
// MARK: - PROPERTIES
@ObservedObject var viewModel: MovieDiscoverViewModel let columns = [ GridItem(.flexible(), spacing: 5), GridItem(.flexible(), spacing: 5), GridItem(.flexible(), spacing: 5) ]
// MARK: - BODY
var body: some View { LazyVGrid(columns: gridColumns, spacing: 5) { ForEach(0..min(moviesViewModel.latestMovies.count, 12), id: \.self) { index in let movie = viewModel.latestMovies[index] NavigationLink(destination: MovieDetailView(movie: currentMovie)) { MovieCardView(movie: movie) .frame(width: 140, height: 130, alignment: .center) .clipped() } } } .padding(0) .onAppear { viewModel.loadLatestMovies() } }
// MARK: - PREVIEW
struct GridTrending_Previews: PreviewProvider { static var previews: some View { GridTrending(viewModel: MovieDiscoverViewModel()) } }
CoomingSoon.swift
      
  
// // Cooming Soon //
CoomingSoon.swift
      
  
// // Cooming Soon //

Behind the scenes - GridView

I would like to give you a little insight behind the scenes of the MovieLookUp app.

The app is based on the API by themoviedb.

The file name and UI alone show that this is an Xcode file. I programmed MovieLookUp using SwiftUI to give it the best possible experience on all Apple hardware.

The SwiftUI file shown here is the GridView, it is one of the first elements in the user interface. This App was based on the new released iOS 18 Photos App Design, this is shown with this element. It is simply an incredibly nice and quick overview of diverse movie world.

In combination with a ton of other small and big elements it's create the DiscoverView. In an One-Page-App design like this one it's crucial to not overwhelm the user and keep it simple and clean which is a one of the benefits of grids like this.

Cooming soon

Cooming soon