Skip to content

Commit 575a9dc

Browse files
committed
Appearance Customization: add Appearance protocol
Add the `Appearance` protocol definition.
1 parent 4f46e2f commit 575a9dc

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright © 2020 Saleem Abdulrasool <[email protected]>
3+
* All rights reserved.
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
**/
7+
8+
/// A collection of methods that gives you access to the appearance proxy for a
9+
/// class.
10+
public protocol Appearance {
11+
// MARK - Appearance Methods
12+
13+
/// Returns the appearance proxy for the receiver.
14+
static func appearance() -> Self
15+
16+
/// Returns the appearance proxy for the receiver that has the passed trait
17+
/// collection.
18+
static func appearance(for trait: TraitCollection) -> Self
19+
20+
/// Returns the appearance proxy for the object when it is contained in the
21+
/// hierarchy the specified classes describe.
22+
static func appearance(whenContainedInInstancesOf containerTypes: [AppearanceContainer.Type])
23+
-> Self
24+
25+
/// Returns the appearance proxy for the object when it is contained in the
26+
/// hierarchy the specified classes describe and has the specified trait
27+
/// collection.
28+
static func appearance(for trait: TraitCollection,
29+
whenContainedInInstancesOf containerTypes: [AppearanceContainer.Type]) -> Self
30+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright © 2020 Saleem Abdulrasool <[email protected]>
3+
* All rights reserved.
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
**/
7+
8+
/// A protocol that a class must adopt to allow appearance customization using
9+
/// the `Appearance` API.
10+
public protocol AppearanceContainer {
11+
}

0 commit comments

Comments
 (0)