iOS SDK Version

FBSDKHashtag

@interfaceFBSDKHashtag:NSObject<FBSDKCopying,NSSecureCoding>
Represents a single hashtag that can be used with the share dialog.
  • Convenience method to build a new hashtag with a string identifier. Equivalent to setting the stringRepresentation property.

    Declaration

    Objective-C
    +(nonnullinstancetype)hashtagWithString:(nonnullNSString*)hashtagString;
    Swift
    convenienceinit(_hashtagString:String)

    Parameters

    hashtagString
    The hashtag string.
  • The hashtag string.
    You are responsible for making sure that stringRepresentation is a valid hashtag (a single ‘#’ followed by one or more word characters). Invalid hashtags are ignored when sharing content. You can check validity with the valid property.

    Declaration

    Objective-C
    @property(nonatomic,copy,readwrite)NSString*_NonnullstringRepresentation;
    Swift
    varstringRepresentation:String{getset}

    Return Value

    The hashtag string.
  • Tests if a hashtag is valid.
    A valid hashtag matches the regular expression “#\w+”: A single ‘#’ followed by one or more word characters.

    Declaration

    Objective-C
    @property(nonatomic,assign,unsafe_unretained,readonly,getter=isValid)BOOLvalid;
    Swift
    varisValid:Bool{get}

    Return Value

    YES if the hashtag is valid, NO otherwise.
  • Compares the receiver to another hashtag.

    Declaration

    Objective-C
    -(BOOL)isEqualToHashtag:(nonnullFBSDKHashtag*)hashtag;
    Swift
    funcisEqual(tohashtag:Hashtag)->Bool

    Parameters

    hashtag
    The other hashtag

    Return Value

    YES if the receiver is equal to the other hashtag; otherwise NO