ProfilePlaceholderView

1.0.0

Add profile placeholder when there is no image 😎
cs4alhaider/ProfilePlaceholderView

What's New

SPM support

2020-08-01T01:20:46Z

ProfilePlaceholderView

Add profile placeholder when there is no image 😎

Example Contacts app

List of contacts #1. #2. #3.

Installation

It requires iOS 13 and Xcode 11!

In Xcode go to File -> Swift Packages -> Add Package Dependency and paste in the repo's url: https://github.com/cs4alhaider/ProfilePlaceholderView

Usage

import ProfilePlaceholderView

Then add .withProfilePlaceholderView( ... ) under Image like:

struct ContactRow: View {
    let contact: Contact
    
    var body: some View {
        HStack {
            Image(contact.imageString ?? "")
                .resizable()
                .withProfilePlaceholderView(name: contact.name) // HERE YOU CAN PASS MANY THINGS ALSO
                .clipShape(Circle())
                .frame(width: 60, height: 60)
            
            Text(contact.name)
                .font(.headline)
        }
    }
}

Check the Example project for more details

Author

Abdullah Alhaider, cs.alhaider@gmail.com

License

This project is under the MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Oct 17 2024 17:52:21 GMT-0900 (Hawaii-Aleutian Daylight Time)