Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Saik0s
Copy link
Contributor

@Saik0s Saik0s commented Apr 7, 2023

Thanks for creating an awesome library!

This PR implements icon support for SettingButton and SettingPicker, as well as trailing label support for SettingPage, to ensure consistency with the look and feel of iOS Settings.

Saik0s added 2 commits April 3, 2023 18:54
…wThis commit adds an optional `icon` property to `SettingButton` and `SettingPagePreviewView` structs, allowing for the display of an icon alongside the title in these settings components
@Saik0s
Copy link
Contributor Author

Saik0s commented Apr 7, 2023

This PR would cover #12

@aheze
Copy link
Owner

aheze commented Apr 29, 2023

Thanks for the PR - sorry for getting back to you so late. Checking this out...

@aheze aheze merged commit 4f9c736 into aheze:main Apr 29, 2023
@aheze
Copy link
Owner

aheze commented Apr 29, 2023

Thanks!

@aheze
Copy link
Owner

aheze commented Apr 29, 2023

Resolved the merge conflict here: 4f9c736

@aheze
Copy link
Owner

aheze commented Apr 29, 2023

Added an example:

Buttons with icon on the left

SettingPage(title: "Extras", selectedChoice: "Hello, world!") {
    SettingGroup {
        SettingButton(title: "Hello, world!") {
            print("Hello world pressed!")
        }
        .icon(icon: .system(icon: "ellipsis", backgroundColor: Color.teal))
    }
    
    SettingGroup {
        SettingButton(title: ":)") {
            print(":) pressed!")
        }
        .icon(icon: .system(icon: "sparkles", backgroundColor: Color.pink))
        .indicator("face.smiling")
    }
}
.previewIcon(icon: .system(icon: "ellipsis", backgroundColor: Color.teal))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants