ASVisibilityProtocols.m 779 B

1234567891011121314151617181920212223242526
  1. //
  2. // ASVisibilityProtocols.m
  3. // AsyncDisplayKit
  4. //
  5. // Created by Garrett Moon on 4/28/16.
  6. //
  7. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  8. // This source code is licensed under the BSD-style license found in the
  9. // LICENSE file in the root directory of this source tree. An additional grant
  10. // of patent rights can be found in the PATENTS file in the same directory.
  11. //
  12. #import "ASVisibilityProtocols.h"
  13. ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visibilityDepth)
  14. {
  15. if (visibilityDepth == 0) {
  16. return ASLayoutRangeModeFull;
  17. } else if (visibilityDepth == 1) {
  18. return ASLayoutRangeModeMinimum;
  19. } else if (visibilityDepth == 2) {
  20. return ASLayoutRangeModeVisibleOnly;
  21. }
  22. return ASLayoutRangeModeLowMemory;
  23. }