hossinasaadi / ParentalGate

simple swift Library to initialize Parental Gate For iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parental Gate For iOS

Applications made for kids very often contain screens that are designed for adults, e.g. in app purchases, feedback forms, etc. Apple requires those screens to be protected by Parental Gate.

From AppStore review guidelines:

24.3 Apps in the Kids Category must get parental permission or use a parental gate before allowing the user to link out of the app or engage in commerce

Screenshots:

Math Slide Custom
Screen Recording 2024-01-25 at 2 20 20 AM Screen Recording 2024-01-25 at 2 22 20 AM Screen Recording 2024-01-25 at 2 21 41 AM

Integration

Swift Package Manager: You can use The Swift Package Manager to install ParentalGate by adding the proper description to your Package.swift file:

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/hossinasaadi/ParentalGate"),
    ]
)

Usage :

types : .math,.slide,.custom

ParentalGate(isPresent: .constant(true), style: .math) {
         // Solved
    } dismiss: {
        // Canceled
    
    }

custom usage :

        ParentalGate(isPresent: $isPresent, style: .custom) {
            isPresent = false
            text = "Solved!"
        } dismiss: {
            isPresent = false
            text = "Canceled,Click Here again!"

        
        }.customGate { ParentalGate in
            CustomGate(solved: ParentalGate.solved, dismiss:ParentalGate.dismiss)
        }
       // CustomGate should use GateProtocol as well

feel free to contribute ❤️

About

simple swift Library to initialize Parental Gate For iOS


Languages

Language:Swift 100.0%