FBSDKUserAgeRange.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. NS_SWIFT_NAME(UserAgeRange)
  11. @interface FBSDKUserAgeRange : NSObject <NSCopying, NSObject, NSSecureCoding>
  12. /// The user's minimum age, nil if unspecified
  13. @property (nullable, nonatomic, readonly, strong) NSNumber *min;
  14. /// The user's maximum age, nil if unspecified
  15. @property (nullable, nonatomic, readonly, strong) NSNumber *max;
  16. - (instancetype)init NS_UNAVAILABLE;
  17. + (instancetype)new NS_UNAVAILABLE;
  18. /**
  19. Returns a UserAgeRange object from a dinctionary containing valid user age range.
  20. @param dictionary The dictionary containing raw user age range
  21. Valid user age range will consist of "min" and/or "max" values that are
  22. positive integers, where "min" is smaller than or equal to "max".
  23. */
  24. + (nullable instancetype)ageRangeFromDictionary:(NSDictionary<NSString *, NSNumber *> *)dictionary;
  25. @end
  26. NS_ASSUME_NONNULL_END