ContentRestrictionsKit
Features
- Get Device's Movie Rating Restriction Setting (Raw Value or Text Value)
- Get the raw value of a supplied Movie Rating (currently supports US ratings ONLY)
- Determine if supplied Movie Rating is allowed by device restrictions (again, US ONLY)
Movie Ratings
Get Device's Movie Rating Restrictions Setting
ContentRestrictionsKit.Movie.getDeviceRestrictionValue()
Returns Raw value of Movie Rating Restriction on Device (Int value 0-1000)
ContentRestrictionsKit.Movie.getDeviceRestriction(country: .US)
Returns Name value of Movie Rating Restriction on Device
Get Movie Rating Value
ContentRestrictionsKit.Movie.getRatingValue(country: .US, rating: "r") // 400
Returns raw value of supplied Movie Rating (Int value 0-1000)
Movie Rating is Allowed
ContentRestrictionsKit.Movie.ratingIsAllowed(country: .US, rating: "r") // returns Bool
Returns true/false if supplied rating is allowed by device's movie restriction rating
TV Show Ratings
Get Device's TV Show Rating Restrictions Setting
ContentRestrictionsKit.TVShow.getDeviceRestrictionValue()
Returns Raw value of TV Show Rating Restriction on Device (Int value 0-1000)
ContentRestrictionsKit.TVShow.getDeviceRestriction(country: .US)
Returns Name value of TV Show Rating Restriction on Device
Get TV Show Rating Value
ContentRestrictionsKit.TVShow.getRatingValue(country: .US, rating: "tvpg") // 400
Returns raw value of supplied TV Show Rating (Int value 0-1000)
TV Show Rating is Allowed
ContentRestrictionsKit.TVShow.ratingIsAllowed(country: .US, rating: "tvpg") // returns Bool
Returns true/false if supplied rating is allowed by device's TV Show restriction rating
App Ratings
Get Device's App Rating Restrictions Setting
ContentRestrictionsKit.App.getDeviceRestrictionValue()
Returns Raw value of App Rating Restriction on Device (Int value 0-1000)
ContentRestrictionsKit.App.getDeviceRestriction()
Returns Name value of App Rating Restriction on Device
Get App Rating Value
ContentRestrictionsKit.App.getRatingValue(rating: "12+") // 300
Returns raw value of supplied App Rating (Int value 0-1000)
App Rating is Allowed
ContentRestrictionsKit.App.ratingIsAllowed(rating: "12+") // returns Bool
Returns true/false if supplied rating is allowed by device's App restriction rating
Explicit Restrictions
Explicit Music Allowed
ContentRestrictionsKit.Explicit.isExplicitMusicAllowed() // returns Bool
Returns true/false if Explicit Music, Podcasts, & News are allowed on the device
Explicit Books Allowed
ContentRestrictionsKit.Explicit.isExplicitBooksAllowed() // returns Bool
Returns true/false if Explicit Books are allowed on the device
Installation
ContentRestrictionsKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ContentRestrictionsKit'
Features Planned
- TV Show Ratings
- App Ratings
- Explicit Books Allowed
- Explicit Music Podcasts Allowed
- Game Ratings (Mapped to closest App Rating)
Currently Supported Countries
(feel free to send me info on new countries, request new countries via issue or contribute via pull request. Gathering info for specific countries is very time consuming so additional countries will only be added upon request.)
- United States (US)