Skip to content

Example of all List Styles realeased in iOS 14 and macOS 11

Notifications You must be signed in to change notification settings

SomuYadav/ListStyles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

List Styles in SwifUI

In this project i have tried to demonstrate diffrent type of ListStyles available in SwiftUI for iOS, iPadOS and macOS


InsetGroupedListStyle

This list style was introduced new in iOS and iPadOS 14, creates and List with inset and grouped backgroud. Documentation

Click to see code
struct ContentView: View {
    var body: some View{
        List(0..<15) { index in
            Text("Row \(index)")
        }
        .listStyle(InsetGroupedListStyle())
    }
 }

InsetListStyle

This list style was also introduced in iOS and iPadOS 14, it creates and insetted list. This list style also availaible in macOS but produce same results as the default. Please see the image below to compare default list and inset style list Documentation

Click to see code
struct ContentView: View {
    var body: some View{
        List(0..<15) { index in
            Text("Row \(index)")
        }
        .listStyle(InsetListStyle())
    }
 }

SidebarListStyle

Yet another new style realeased in iOS 14 and macOS 11, this style our list to the appearence of new sidebar in macOS and iPad, This really shine when used on app of iPad and macOS it also works in iOS but only gived the inset group style look. Documentation

Click to see code
struct ContentView: View {
    var body: some View{
        List(0..<15) { index in
            Text("Row \(index)")
        }
        .listStyle(SidebarListStyle())
    }
 }

About

Example of all List Styles realeased in iOS 14 and macOS 11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%