Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 6e04bfb

Browse files
committed
Merge pull request #657 from nguyenhuy/AppledocInASLayoutSpec
Fix appledoc warnings in ASLayoutSpec.h
2 parents c9aa2de + 0c068c4 commit 6e04bfb

1 file changed

Lines changed: 60 additions & 22 deletions

File tree

AsyncDisplayKit/Layout/ASLayoutSpec.h

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,85 @@
1414
@interface ASLayoutSpec : NSObject <ASLayoutable>
1515

1616
/**
17-
Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a
18-
layout spec can be created and mutated. Once it is passed back to ASDK, the isMutable flag will be
19-
set to NO and any further mutations will cause an assert.
17+
* Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a
18+
* layout spec can be created and mutated. Once it is passed back to ASDK, the isMutable flag will be
19+
* set to NO and any further mutations will cause an assert.
2020
*/
2121
@property (nonatomic, assign) BOOL isMutable;
2222

2323
- (instancetype)init;
2424

2525
/**
26-
* Set child methods
26+
* Adds a child to this layout spec using a default identifier.
2727
*
28-
* Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
29-
* reponsibility of holding on to the spec children. For a layout spec like ASInsetLayoutSpec that
30-
* only requires a single child, the child can be added by calling setChild:.
28+
* @param child A child to be added.
3129
*
32-
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
33-
* a subclass should use the setChild to set the "primary" child. It can then use setChild:forIdentifier:
34-
* to set any other required children. Ideally a subclass would hide this from the user, and use the
35-
* setChildWithIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild
36-
* property that behind the scenes is calling setChild:forIdentifier:.
30+
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
31+
* reponsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
32+
* only require a single child.
3733
*
38-
* Finally, a layout spec like ASStackLayoutSpec can take an unknown number of children. In this case,
39-
* the setChildren: method should be used. For good measure, in these layout specs it probably makes
40-
* sense to define setChild: to do something appropriate or to assert.
34+
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
35+
* a subclass should use this method to set the "primary" child. It can then use setChild:forIdentifier:
36+
* to set any other required children. Ideally a subclass would hide this from the user, and use the
37+
* setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild
38+
* property that behind the scenes is calling setChild:forIdentifier:.
4139
*/
4240
- (void)setChild:(id<ASLayoutable>)child;
41+
42+
/**
43+
* Adds a child with the given identifier to this layout spec.
44+
*
45+
* @param child A child to be added.
46+
*
47+
* @param identifier An identifier associated with the child.
48+
*
49+
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
50+
* reponsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
51+
* only require a single child.
52+
*
53+
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
54+
* a subclass should use the setChild method to set the "primary" child. It can then use this method
55+
* to set any other required children. Ideally a subclass would hide this from the user, and use the
56+
* setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild
57+
* property that behind the scenes is calling setChild:forIdentifier:.
58+
*/
4359
- (void)setChild:(id<ASLayoutable>)child forIdentifier:(NSString *)identifier;
44-
- (void)setChildren:(NSArray *)children;
4560

4661
/**
47-
* Get child methods
62+
* Adds childen to this layout spec.
4863
*
49-
* There is a corresponding "getChild" method for the above "setChild" methods. If a subclass
50-
* has extra layoutable children, it is recommended to make a corresponding get method for that
51-
* child. For example, the ASBackgroundLayoutSpec responds to backgroundChild.
64+
* @param children An array of ASLayoutable children to be added.
65+
*
66+
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
67+
* reponsibility of holding on to the spec children. Some layout specs, like ASStackLayoutSpec,
68+
* can take an unknown number of children. In this case, the this method should be used.
69+
* For good measure, in these layout specs it probably makes sense to define
70+
* setChild: and setChild:forIdentifier: methods to do something appropriate or to assert.
71+
*/
72+
- (void)setChildren:(NSArray *)children;
73+
74+
/**
75+
* Get child methods
5276
*
53-
* If a get method is called on a spec that doesn't make sense, then the standard is to assert.
54-
* For example, calling children on an ASInsetLayoutSpec will assert.
77+
* There is a corresponding "getChild" method for the above "setChild" methods. If a subclass
78+
* has extra layoutable children, it is recommended to make a corresponding get method for that
79+
* child. For example, the ASBackgroundLayoutSpec responds to backgroundChild.
80+
*
81+
* If a get method is called on a spec that doesn't make sense, then the standard is to assert.
82+
* For example, calling children on an ASInsetLayoutSpec will assert.
5583
*/
84+
85+
/** Returns the child added to this layout spec using the default identifier. */
5686
- (id<ASLayoutable>)child;
87+
88+
/**
89+
* Returns the child added to this layout spec using the given identifier.
90+
*
91+
* @param identifier An identifier associated withe the child.
92+
*/
5793
- (id<ASLayoutable>)childForIdentifier:(NSString *)identifier;
94+
95+
/** Returns all children added to this layout spec. */
5896
- (NSArray *)children;
5997

6098
@end

0 commit comments

Comments
 (0)