commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
|
21 |
#import <FBSDKCoreKit/FBSDKCopying.h> |
|
22 |
|
e81c27
|
23 |
NS_ASSUME_NONNULL_BEGIN |
H |
24 |
|
9febd9
|
25 |
/** |
W |
26 |
Represents a single hashtag that can be used with the share dialog. |
bad748
|
27 |
*/ |
e81c27
|
28 |
NS_SWIFT_NAME(Hashtag) |
bad748
|
29 |
@interface FBSDKHashtag : NSObject <FBSDKCopying, NSSecureCoding> |
W |
30 |
|
9febd9
|
31 |
/** |
W |
32 |
Convenience method to build a new hashtag with a string identifier. Equivalent to setting the |
bad748
|
33 |
`stringRepresentation` property. |
13e53a
|
34 |
@param hashtagString The hashtag string. |
bad748
|
35 |
*/ |
e81c27
|
36 |
+ (instancetype)hashtagWithString:(NSString *)hashtagString |
H |
37 |
NS_SWIFT_NAME(init(_:)); |
bad748
|
38 |
|
9febd9
|
39 |
/** |
W |
40 |
The hashtag string. |
|
41 |
|
|
42 |
You are responsible for making sure that `stringRepresentation` is a valid hashtag (a single '#' followed |
bad748
|
43 |
by one or more word characters). Invalid hashtags are ignored when sharing content. You can check validity with the |
W |
44 |
`valid` property. |
13e53a
|
45 |
@return The hashtag string. |
bad748
|
46 |
*/ |
13e53a
|
47 |
@property (nonatomic, copy) NSString *stringRepresentation; |
bad748
|
48 |
|
9febd9
|
49 |
/** |
W |
50 |
Tests if a hashtag is valid. |
|
51 |
|
|
52 |
A valid hashtag matches the regular expression "#\w+": A single '#' followed by one or more |
bad748
|
53 |
word characters. |
13e53a
|
54 |
@return YES if the hashtag is valid, NO otherwise. |
bad748
|
55 |
*/ |
W |
56 |
@property (nonatomic, readonly, assign, getter=isValid) BOOL valid; |
|
57 |
|
9febd9
|
58 |
/** |
W |
59 |
Compares the receiver to another hashtag. |
13e53a
|
60 |
@param hashtag The other hashtag |
H |
61 |
@return YES if the receiver is equal to the other hashtag; otherwise NO |
bad748
|
62 |
*/ |
W |
63 |
- (BOOL)isEqualToHashtag:(FBSDKHashtag *)hashtag; |
|
64 |
|
|
65 |
@end |
e81c27
|
66 |
|
H |
67 |
NS_ASSUME_NONNULL_END |