SVSAdRules
Objective-C
@interface SVSAdRules : NSObject <NSCopying, NSCoding>Swift
class SVSAdRules : NSObject, NSCopying, NSCodingRepresents a set of ad rules.
- 
                    
                    Initialize a SVSAdRules instance from an array of valid ad rules. DeclarationObjective-C - (nullable instancetype)initWithRules:(nonnull NSArray<SVSAdRule *> *)adRules;Swift init?(rules adRules: [SVSAdRule])ParametersadRulesAn array of valid SVSAdRule instances. Return ValueAn initialized SVSAdRules instance or nil if the adRules array is empty. 
- 
                    
                    Initialize a SVSAdRules instance from a valid ad rules JSON. DeclarationObjective-C - (nullable instancetype)initWithJSON:(nonnull NSString *)jsonRules;Swift convenience init?(json jsonRules: String)ParametersjsonRulesA string containing a valid ad rules JSON. Return ValueAn initialized SVSAdRules instance or nil if the JSON is not valid. 
- 
                    
                    Creates a SVSAdRules instance from an array of valid ad rules. DeclarationObjective-C + (nonnull instancetype)adRulesWithRules: (nonnull NSArray<SVSAdRule *> *)adRules;ParametersadRulesAn array of valid SVSAdRule instances. Return ValueAn initialized SVSAdRules instance. 
- 
                    
                    Creates a SVSAdRules instance from a valid ad rules JSON. DeclarationObjective-C + (nonnull instancetype)adRulesWithJSON:(nonnull NSString *)jsonRules;ParametersjsonRulesA string containing a valid ad rules JSON. Return ValueAn initialized SVSAdRules instance or nil if the JSON is not valid. 
- 
                    
                    Asynchronously retrieve a JSON based ad rules set from a given URL. Warning The execution thread for the completion handler is not guaranteed. If you make UI modification in this handler, make sure to perform them on the main thread. DeclarationObjective-C + (void)adRulesFromURL:(nonnull NSURL *)adRulesURL completionHandler:(nonnull void (^)(SVSAdRules *_Nullable, NSError *_Nullable))completionHandler;Swift class func adRules(from adRulesURL: URL) async throws -> SVSAdRulesParametersadRulesURLThe URL of the JSON describing the ad rules. completionHandlerThe completion handler that will be called with the SVSAdRules object (or with an error if the ad rules object can be retrieved). 
