Giter Site home page Giter Site logo

huss3n / practiceui Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.26 MB

This repository contains a collection of popular app UIs built using SwiftUI. The purpose of this project is to practice and perfect SwiftUI skills by recreating the user interfaces of well-known apps.

Swift 100.00%

practiceui's Introduction

Practice UI

Popular Apps UI Showcase using SwiftUI

This repository contains a collection of popular app UIs built using SwiftUI. The purpose of this project is to practice and perfect SwiftUI skills by recreating the user interfaces of well-known apps.

Completed Apps:

Spotify

  • A replica of the Spotify app interface, showcasing various UI components and interactions commonly found in music streaming applications.
  • Data is fetched from DummyJSON to use as placeholder content during development and prototyping.

Features:

  • Dynamic Content: Utilize DummyJSON to generate mock data for realistic UI representation.
  • Reusable Components: Implement SwiftUI components in a modular manner to ensure reusability and maintainability.
  • Interactive UI: Emphasize user interactions through animations and gestures to enhance the user experience.

Future Plans:

  • Expand the collection by adding more popular apps UIs.
  • Integrate real data sources to create fully functional prototypes.
  • Optimize code structure and architecture for scalability.

Getting Started:

  1. Clone the repository
    https://github.com/Huss3n/PracticeUI/tree/main/PracticeUI
    
  2. Navigate to the project directory:
    cd PracticeUI
    
  3. Run the project in Xcode:

practiceui's People

Contributors

huss3n avatar

Stargazers

 avatar

Watchers

 avatar

practiceui's Issues

Add stretchy header

Modify the header in the Playlist View to have a stretchy animation like event when pulled down

Move scoll view and hstack to a sub view

Move the scroll view and header view to a private func some view as demonstrated below

private func header: some View {
  HStack(spacing: 16) {
                ZStack {
                    if let currentUser {
                        ImageLoader(url: currentUser.image)
                            .background(.spotifyWhite)
                            .clipShape(Circle())
                            .onTapGesture {
                                
                            }
                    }
                }
                .frame(width: 35, height: 35)
                
                ScrollView(.horizontal) {
                    HStack(spacing: 8) {
                        ForEach(Category.allCases, id: \.self) { category in
                            SpotifyCategoryCell(
                                title: category.rawValue.capitalized,
                                isSelected: category == selectedCategory
                            )
                            .onTapGesture {
                                selectedCategory = category
                            }
                        }
                    }
                    .padding(.horizontal, 16)
                }
                .scrollIndicators(.hidden)
            }
}

Mock data

Use this mock data for the product view in the cell.

Update product model with this:

// MARK: - Product
struct Product: Codable, Identifiable {
    let id: Int
    let title, description: String
    let price: Int
    let discountPercentage, rating: Double
    let stock: Int
    let brand, category: String
    let thumbnail: String
    let images: [String]
    
    var firstImage: String {
        images.first ?? Constants.url
    }
    
    static var mock: Product {
        Product(
            id: 124,
            title: "Mock Product",
            description: "This is a mock product",
            price: 100,
            discountPercentage: 20,
            rating: 4.5,
            stock: 400,
            brand: "Apple",
            category: "Laptops",
            thumbnail: "thumbnail image",
            images: ["image1", "image2", "image3"]
        )
    }
}

Lazy Loading

Fix the loading of the scroll view using a lazyHstack to limit the number of rows and optimize the application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.