-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
112 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
Sources/Xcore/SwiftUI/Components/List/List+RowInsets.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Xcore | ||
// Copyright © 2021 Xcore | ||
// MIT license, see LICENSE file for details | ||
// | ||
|
||
import SwiftUI | ||
|
||
// MARK: - List Row Insets Environment | ||
|
||
extension EnvironmentValues { | ||
private struct CustomListRowInsetsKey: EnvironmentKey { | ||
static var defaultValue: EdgeInsets = .listRow | ||
} | ||
|
||
var customListRowInsets: EdgeInsets { | ||
get { self[CustomListRowInsetsKey.self] } | ||
set { self[CustomListRowInsetsKey.self] = newValue } | ||
} | ||
} | ||
|
||
// MARK: - View Helpers | ||
|
||
extension View { | ||
/// Applies an inset to the rows in a list. | ||
public func customListRowInsets(_ insets: EdgeInsets) -> some View { | ||
environment(\.customListRowInsets, insets) | ||
} | ||
|
||
/// Applies an inset to the rows in a list. | ||
public func customListRowInsets(_ edges: Edge.Set, _ length: CGFloat) -> some View { | ||
customListRowInsets(.init(edges, length)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
Sources/Xcore/SwiftUI/Components/List/List+Separator.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters