commit | author | age
|
2e29a3
|
1 |
/* |
L |
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 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
#import <FBSDKCoreKit/FBSDKCoreKit.h> |
|
12 |
|
|
13 |
NS_ASSUME_NONNULL_BEGIN |
|
14 |
|
|
15 |
/** |
|
16 |
Represents a single hashtag that can be used with the share dialog. |
|
17 |
*/ |
|
18 |
NS_SWIFT_NAME(Hashtag) |
|
19 |
@interface FBSDKHashtag : NSObject <NSCopying, NSObject, NSSecureCoding> |
|
20 |
|
|
21 |
/** |
|
22 |
Convenience method to build a new hashtag with a string identifier. Equivalent to setting the |
|
23 |
`stringRepresentation` property. |
|
24 |
@param hashtagString The hashtag string. |
|
25 |
*/ |
|
26 |
|
|
27 |
// UNCRUSTIFY_FORMAT_OFF |
|
28 |
+ (instancetype)hashtagWithString:(NSString *)hashtagString |
|
29 |
NS_SWIFT_NAME(init(_:)); |
|
30 |
// UNCRUSTIFY_FORMAT_ON |
|
31 |
|
|
32 |
/** |
|
33 |
The hashtag string. |
|
34 |
|
|
35 |
You are responsible for making sure that `stringRepresentation` is a valid hashtag (a single '#' followed |
|
36 |
by one or more word characters). Invalid hashtags are ignored when sharing content. You can check validity with the |
|
37 |
`valid` property. |
|
38 |
@return The hashtag string. |
|
39 |
*/ |
|
40 |
@property (nonatomic, copy) NSString *stringRepresentation; |
|
41 |
|
|
42 |
/** |
|
43 |
Tests if a hashtag is valid. |
|
44 |
|
|
45 |
A valid hashtag matches the regular expression "#\w+": A single '#' followed by one or more |
|
46 |
word characters. |
|
47 |
@return YES if the hashtag is valid, NO otherwise. |
|
48 |
*/ |
|
49 |
@property (nonatomic, readonly, getter = isValid, assign) BOOL valid; |
|
50 |
|
|
51 |
/** |
|
52 |
Compares the receiver to another hashtag. |
|
53 |
@param hashtag The other hashtag |
|
54 |
@return YES if the receiver is equal to the other hashtag; otherwise NO |
|
55 |
*/ |
|
56 |
- (BOOL)isEqualToHashtag:(FBSDKHashtag *)hashtag; |
|
57 |
|
|
58 |
@end |
|
59 |
|
|
60 |
NS_ASSUME_NONNULL_END |