privacy policy サンプルコード[Swift]

下記ファイルをコピーして貼り付けるとプライバシーポリシーを起動時に設定できます。

 PrivacyPolicyController.swift

import UIKit

import Foundation

import UIKit

import MessageUI

import AVFoundation

class PrivacyPolicyController: UIViewController, MFMailComposeViewControllerDelegate {

let userDefaults: UserDefaults = UserDefaults.standard

let defaults = UserDefaults.standard

var passedString: String ?

@IBOutlet weak
var termsBts: UIButton!

@IBOutlet weak
var feedbackBts: UIButton!

@IBOutlet weak
var backBtn: UIButton!

@IBOutlet weak
var agreeBtn: UIButton!

@IBOutlet weak
var disagreeBtn: UIButton!

@IBOutlet weak
var privacyTextView: UITextView!

///////////////////////////////////////////////////

// Back Section

///////////////////////////////////////////////////

@IBAction func onclickBack(_ sender: Any) {

self.dismiss(animated: true, completion: nil)

//let nextvc = ViewController()

//self.window?.rootViewController?.present(nextvc, animated: true, completion: nil)

// let parentVC = self.presentingViewController as! ViewController

// //parentVC.updateView()

// //自分を閉じる

// self.present(parentVC,animated: true, completion: nil)

//

//

// self.dismiss(animated: true, completion: nil)

}

///////////////////////////////////////////////////

// Term Section

///////////////////////////////////////////////////

@IBAction func onclickTerm(_ sender: Any) {

//purchase(productId:productIdentifiers[0])

let url: NSURL = NSURL(string: "https://bigtranslatorprivacy.blogspot.com/2018/11/privacy-policy.html") !

UIApplication.shared.openURL(url as URL)

//PrivacyPolicyViewController

//読み込みと同時に読んだことにしてします

Storage.sharedInstance.readPrivacy();

}

@IBAction func onclickAgree(_ sender: Any) {

//同意

Storage.sharedInstance.agreePrivacy();

let localStr18 = NSLocalizedString("privacyString1", comment: "")

let localStr19 = NSLocalizedString("privacyString2", comment: "")

let localStr20 = NSLocalizedString("privacyString3", comment: "")

let localStr21 = NSLocalizedString("privacyString4", comment: "")

utilityAlert(string: localStr19)

}

@IBAction func onclickDisagree(_ sender: Any) {

Storage.sharedInstance.disagreePrivacy();

let localStr18 = NSLocalizedString("privacyString1", comment: "")

let localStr19 = NSLocalizedString("privacyString2", comment: "")

let localStr20 = NSLocalizedString("privacyString3", comment: "")

let localStr21 = NSLocalizedString("privacyString4", comment: "")

utilityAlert(string: localStr20)

let delayTime = DispatchTime.now() + .seconds(2)

DispatchQueue.main.asyncAfter(deadline: delayTime) {

exit(0);

}

}

override func viewDidLoad() {

super.viewDidLoad()

// Do any additional setup after loading the view.

// let localStr1 = NSLocalizedString("done", comment: "")

// let localStr2 = NSLocalizedString("voice", comment: "")

// let localStr3 = NSLocalizedString("copy", comment: "")

// let localStr4 = NSLocalizedString("save", comment: "")

// let localStr5 = NSLocalizedString("delete", comment: "")

let localStr6 = NSLocalizedString("reward", comment: "")

let localStr7 = NSLocalizedString("back", comment: "")

// let localStr8 = NSLocalizedString("selectLanguage", comment: "")

// let localStr9 = NSLocalizedString("translate", comment: "")

// let localStr10 = NSLocalizedString("segmentString1", comment: "")

// let localStr11 = NSLocalizedString("segmentString2", comment: "")

// let localStr12 = NSLocalizedString("purchaseString1", comment: "")

let localStr13 = NSLocalizedString("feedback", comment: "")

let localStr18 = NSLocalizedString("privacyString1", comment: "")

let localStr19 = NSLocalizedString("privacyString2", comment: "")

let localStr20 = NSLocalizedString("privacyString3", comment: "")

let localStr21 = NSLocalizedString("privacyString4", comment: "")

self.termsBts.setTitle(localStr18,
for: .normal)

self.feedbackBts.setTitle(localStr13,
for: .normal)

//self.restoreBtn.setTitle(localStr17, for: .normal)

self.backBtn.setTitle(localStr7,
for: .normal)

self.agreeBtn.setTitle(localStr19,
for: .normal)

self.disagreeBtn.setTitle(localStr20,
for: .normal)

self.privacyTextView.text = localStr21;

// 角に丸みをつける.

privacyTextView.layer.masksToBounds = true

// 丸みのサイズを設定する.

privacyTextView.layer.cornerRadius = 20.0

// 枠線の太さを設定する.

privacyTextView.layer.borderWidth = 1

// 枠線の色を黒に設定する.

privacyTextView.layer.borderColor = UIColor.black.cgColor

// リンク、日付などを自動的に検出してリンクに変換する.

privacyTextView.dataDetectorTypes = UIDataDetectorTypes.all

// テキストを編集不可にする.

privacyTextView.isEditable = false

//NSNotificationCenterへ登録

//NSNotification.Name.UIApplicationWillEnterForegroundを受け取った時に、viewWillEnterForegroundを実行する設定

NotificationCenter.default.addObserver(self, selector: #selector(PrivacyPolicyController.viewWillEnterForeground(_: )), name:

UIApplication.willEnterForegroundNotification, object: nil)

//NSNotification.Name.UIApplicationDidEnterBackgroundを受け取った時に、viewDidEnterBackgroundを実行する設定

NotificationCenter.default.addObserver(self, selector: #selector(PrivacyPolicyController.viewDidEnterBackground(_: )), name: UIApplication.didEnterBackgroundNotification, object: nil)

}

//フォアグラウンドの処理を記載

//ViewControllerが表示されている場合のみ更新。

//こうしないと、複数ViewControllerでNSNotificationCenter登録している場合、表示されていないViewControllerでも処理が実行される

@objc func viewWillEnterForeground(_ notification: Notification ? ) {

if (self.isViewLoaded & amp; & amp;
(self.view.window != nil)) {

print("フォアグラウンド")

let isReadPrivacy: Bool = Storage.sharedInstance.isReadPrivacy()

self.defaults.synchronize()

if (isReadPrivacy) {

self.agreeBtn.isHidden = false

self.disagreeBtn.isHidden = false

} else {

self.agreeBtn.isHidden = true

self.disagreeBtn.isHidden = true

}

}

}

//バックグラウンドの処理を記載

@objc func viewDidEnterBackground(_ notification: Notification ? ) {

if (self.isViewLoaded & amp; & amp;
(self.view.window != nil)) {

let isReadPrivacy: Bool = Storage.sharedInstance.isReadPrivacy()

self.defaults.synchronize()

if (isReadPrivacy) {

self.agreeBtn.isHidden = false

self.disagreeBtn.isHidden = false

} else {

self.agreeBtn.isHidden = true

self.disagreeBtn.isHidden = true

}

}

}

override func viewWillAppear(_ animated: Bool) {

print("InnApp : ViewWillAppear")

super.viewWillAppear(animated)

let delayTime = DispatchTime.now() + .seconds(2)

DispatchQueue.main.asyncAfter(deadline: delayTime) {

let isReadPrivacy: Bool = Storage.sharedInstance.isReadPrivacy()

self.defaults.synchronize()

if (isReadPrivacy) {

self.agreeBtn.isHidden = false

self.disagreeBtn.isHidden = false

} else {

self.agreeBtn.isHidden = true

self.disagreeBtn.isHidden = true

}

}

}

///////////////////////////////////////////////////

// Mark - FeedBack Functions

///////////////////////////////////////////////////

@IBAction func onclickFeedBack(_ sender: Any) {

if MFMailComposeViewController.canSendMail() == false {

let localStr = NSLocalizedString("InnAppMsg7", comment: "")

self.utilityAlert(string: localStr)

return

}

let mailViewController = MFMailComposeViewController()

mailViewController.mailComposeDelegate = self

mailViewController.setSubject("Bug Report")

let toRecipients = ["t_iphone_app@yahoo.co.jp"]

mailViewController.setToRecipients(toRecipients)

mailViewController.setMessageBody("", isHTML: false)

self.present(mailViewController, animated: true, completion: nil)

}

// feedback mailComposeController

func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error ? ) {

switch result.rawValue {

case MFMailComposeResult.cancelled.rawValue:

print("SettingView : Mail Cancelled")

case MFMailComposeResult.saved.rawValue:

print("SettingView : Mail Saved")

case MFMailComposeResult.sent.rawValue:

print("SettingView : Mail Sent")

case MFMailComposeResult.failed.rawValue:

print("SettingView : Mail failed \(error!.localizedDescription)")

default:

break

}

controller.dismiss(animated: true, completion: nil)

}

// Alert functions for rewardedAds

func utilityAlert(string: String) {

let alert = UIAlertController(title: "", message: "\(string)", preferredStyle: UIAlertController.Style.alert)

self.present(alert, animated: true, completion: nil)

let localStr = NSLocalizedString("alertOKBtn", comment: "")

alert.addAction(UIAlertAction(title: localStr, style: .default, handler: {
action in

switch action.style {

case .default:

print("SettingView : utilityAlert default")

case .cancel:

print("SettingView : utilityAlert cancel")

case .destructive:

print("SettingView : utilityAlert destructive")

}

}))

}

override func didReceiveMemoryWarning() {

super.didReceiveMemoryWarning()

// Dispose of any resources that can be recreated.

}

}



PrivacyPolicyController.xib

xibにそのままコピーして下さい。(xml形式になります)

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="Kaiso-Makina-B.otf">
<string>Kaiso-Makina-B</string>
</array>
</customFonts>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PrivacyPolicyController" customModule="Korean_Translation" customModuleProvider="target">
<connections>
<outlet property="agreeBtn" destination="liI-DT-NgR" id="0hY-bJ-Yjx"/>
<outlet property="backBtn" destination="dOM-NA-q9h" id="HkW-Br-vev"/>
<outlet property="bannerView" destination="Tej-ML-QiV" id="oU2-0M-yuF"/>
<outlet property="disagreeBtn" destination="GqS-kP-MF7" id="u1H-f7-t0F"/>
<outlet property="feedbackBts" destination="mqI-WP-LwP" id="j9W-HQ-bZt"/>
<outlet property="privacyTextView" destination="3RL-oX-6dI" id="HSY-8J-T1W"/>
<outlet property="termsBts" destination="sz0-dE-gmC" id="zGk-ih-a2B"/>
<outlet property="view" destination="Gtq-RP-sf9" id="PUD-at-VDn"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="Gtq-RP-sf9">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DvS-la-AfP">
<rect key="frame" x="0.0" y="34" width="375" height="44"/>
<items>
<navigationItem id="2ta-zE-oxh">
<barButtonItem key="leftBarButtonItem" title="Item" style="plain" id="3eK-YD-j61">
<button key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="dOM-NA-q9h">
<rect key="frame" x="16" y="7" width="30" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="✖️">
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="onclickBack:" destination="-1" eventType="touchUpInside" id="MbD-fn-qHG"/>
</connections>
</button>
</barButtonItem>
</navigationItem>
</items>
</navigationBar>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sz0-dE-gmC">
<rect key="frame" x="97" y="144" width="181" height="31"/>
<rect key="contentStretch" x="1" y="0.0" width="1" height="1"/>
<fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/>
<state key="normal" title="privacy policy"/>
<connections>
<action selector="onclickTerm:" destination="-1" eventType="touchUpInside" id="mwz-q4-qrg"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mqI-WP-LwP" customClass="Button_Custom" customModule="Korean_Translation" customModuleProvider="target">
<rect key="frame" x="97" y="548" width="181" height="31"/>
<rect key="contentStretch" x="1" y="0.0" width="1" height="1"/>
<fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/>
<state key="normal" title="Feedback">
<color key="titleColor" red="0.0" green="0.56031829119999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onclickFeedBack:" destination="-1" eventType="touchUpInside" id="zWv-pY-uex"/>
</connections>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="3RL-oX-6dI">
<rect key="frame" x="16" y="183" width="343" height="124"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<string key="text">In the privacy policy, the data collected by the application and its handling and purpose of use are indicated.If you do not agree, you can not use the application.</string>
<fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="liI-DT-NgR">
<rect key="frame" x="119" y="333" width="137" height="31"/>
<fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/>
<state key="normal" title="agree privacy policy"/>
<connections>
<action selector="onclickAgree:" destination="-1" eventType="touchUpInside" id="fCr-kq-d7b"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GqS-kP-MF7">
<rect key="frame" x="109.5" y="436" width="156" height="31"/>
<fontDescription key="fontDescription" name="Kaiso-Makina-B" family="Kaiso" pointSize="17"/>
<state key="normal" title="disagree privacy policy">
<color key="titleColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onclickDisagree:" destination="-1" eventType="touchUpInside" id="cSp-CM-oFO"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tej-ML-QiV" customClass="GADBannerView">
<rect key="frame" x="0.0" y="617" width="375" height="50"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Kk3-8b-4tZ"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="s0B-K2-ury"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.92143100499999997" green="0.92145264149999995" blue="0.92144101860000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="DvS-la-AfP" firstAttribute="width" secondItem="Gtq-RP-sf9" secondAttribute="width" id="2Cz-TF-QyZ"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="centerX" secondItem="liI-DT-NgR" secondAttribute="centerX" id="6st-C0-x7C"/>
<constraint firstItem="3RL-oX-6dI" firstAttribute="top" secondItem="sz0-dE-gmC" secondAttribute="bottom" constant="8" id="8AI-kk-LRZ"/>
<constraint firstItem="Tej-ML-QiV" firstAttribute="trailing" secondItem="CLZ-YP-Hdw" secondAttribute="trailing" id="AEN-BF-Kjr"/>
<constraint firstItem="3RL-oX-6dI" firstAttribute="leading" secondItem="CLZ-YP-Hdw" secondAttribute="leading" constant="16" id="C8J-eW-gg6"/>
<constraint firstItem="mqI-WP-LwP" firstAttribute="top" secondItem="GqS-kP-MF7" secondAttribute="bottom" constant="81" id="FBn-Jq-s0u"/>
<constraint firstItem="CLZ-YP-Hdw" firstAttribute="trailing" secondItem="3RL-oX-6dI" secondAttribute="trailing" constant="16" id="HR7-dI-kjE"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="leading" secondItem="mqI-WP-LwP" secondAttribute="leading" id="K9F-eU-q2W"/>
<constraint firstItem="DvS-la-AfP" firstAttribute="leading" secondItem="Gtq-RP-sf9" secondAttribute="leading" id="QMy-z9-pWV"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="leading" secondItem="CLZ-YP-Hdw" secondAttribute="leading" constant="97" id="R0x-8P-UMO"/>
<constraint firstItem="CLZ-YP-Hdw" firstAttribute="bottom" secondItem="mqI-WP-LwP" secondAttribute="bottom" constant="88" id="WQs-Tq-W7x"/>
<constraint firstItem="mqI-WP-LwP" firstAttribute="centerX" secondItem="GqS-kP-MF7" secondAttribute="centerX" id="YqD-jy-gMO"/>
<constraint firstItem="mqI-WP-LwP" firstAttribute="centerX" secondItem="DvS-la-AfP" secondAttribute="centerX" id="aGU-lC-dMr"/>
<constraint firstItem="DvS-la-AfP" firstAttribute="top" secondItem="CLZ-YP-Hdw" secondAttribute="top" constant="14" id="eGe-TS-KEY"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="centerX" secondItem="DvS-la-AfP" secondAttribute="centerX" id="gJ2-nR-GPR"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="centerX" secondItem="CLZ-YP-Hdw" secondAttribute="centerX" id="i1a-Dg-fhK"/>
<constraint firstItem="Tej-ML-QiV" firstAttribute="leading" secondItem="CLZ-YP-Hdw" secondAttribute="leading" id="ibu-xD-09I"/>
<constraint firstItem="liI-DT-NgR" firstAttribute="centerX" secondItem="CLZ-YP-Hdw" secondAttribute="centerX" id="lbP-BV-ZlW"/>
<constraint firstItem="liI-DT-NgR" firstAttribute="centerX" secondItem="CLZ-YP-Hdw" secondAttribute="centerX" id="r60-Bu-7FT"/>
<constraint firstItem="liI-DT-NgR" firstAttribute="top" secondItem="3RL-oX-6dI" secondAttribute="bottom" constant="26" id="t00-bU-lKi"/>
<constraint firstItem="GqS-kP-MF7" firstAttribute="top" secondItem="liI-DT-NgR" secondAttribute="bottom" constant="72" id="x5G-dN-0QI"/>
<constraint firstItem="Tej-ML-QiV" firstAttribute="bottom" secondItem="CLZ-YP-Hdw" secondAttribute="bottom" id="xYs-yy-LPG"/>
<constraint firstItem="sz0-dE-gmC" firstAttribute="top" secondItem="Gtq-RP-sf9" secondAttribute="top" constant="144" id="zSO-nP-fhA"/>
</constraints>
<viewLayoutGuide key="safeArea" id="CLZ-YP-Hdw"/>
<point key="canvasLocation" x="52.5" y="59.5"/>
</view>
</objects>
</document>

 



Storage.swift

import Foundation

import Parse

class Storage: NSObject {

let defaults = UserDefaults.standard

let currentDate = Date()

let unixTime: Int = Int(NSDate().timeIntervalSince1970)

static
let sharedInstance = Storage()

//プラポリを読みました

func readPrivacy() {

defaults.set(true, forKey: "readPrivacy")

defaults.synchronize()

}

//プラポリ判定

func isReadPrivacy() - & gt;
Bool {

// Keyを指定して読み込み

let isReadPrivacy = defaults.object(forKey: "readPrivacy") as!Bool!

if isReadPrivacy == nil {

return false

} else {

return true

}

}

//プラポリ同意

func agreePrivacy() {

defaults.set(true, forKey: "agreePrivacy")

defaults.synchronize()

}

//プラポリ非同意

func disagreePrivacy() {

defaults.set(false, forKey: "agreePrivacy")

defaults.synchronize()

}

//プラポリ同意判定

func isAgreePrivacy() - & gt;
Bool {

// Keyを指定して読み込み

let agreePrivacy = defaults.object(forKey: "agreePrivacy") as!Bool!

defaults.synchronize()

if agreePrivacy == nil {

return false

} else {

return true

}

}

}

Localizable.strings

そのままコピーしてください。(.stringsファイルになります。)

"languageBtn1" = "選択";
"languageBtn2" = "言語を変更する";
"loadingHUD" = "ロード中......(^^)";
"errorHUD" = "インターネットの接続が失敗しました!!!";
"successHUD" = "成功!";
"updateTitle" = "アップデートがあります(^^)";
"updateBtn1" = "AppStore";
"updateBtn2" = "キャンセル";
"adsAlert1" = "申し訳ありません. ロードが失敗しました";
"adsAlert2" = "申し訳ありません. 接続が失敗しました";
"alertOKBtn" = "確認";
"storeUpdate" = "データベース更新中";
"storeError" = "更新失敗!";
"storeFinish" = "アップデート成功!";
"InnAppMsg1" = "商品情報の取得に失敗";
"InnAppMsg2" = "商品がありません!";
"InnAppMsg3" = "課金完了(中断していたもの)";
"InnAppMsg4" = "課金失敗";
"InnAppMsg5" = "リストア完了";
"InnAppMsg6" = "課金 承認待ち";
"InnAppMsg7" = "メールは送信できません";
"NoVoice" = "音声をサポートしていません";
"feedback" = "フィードバック";
"purchase" = "全ての機能を追加";
"purchaseM" = "全ての機能を追加/月額";
"restore" = "購入復元";
"purchaseString" = "---月額購入に関して---\n--タイトル--\n広告の削除\n• 月額購入期間(各月額購入期間中に提供される期間およびコンテンツまたはサービス)\ n月額購入期間(1ヶ月)\n================\n広告の削除をすることができます!\n================\n• 月額購入価格、および必要に応じて単価\n0.99ドル\n• 購入の確認時にiTunesアカウントにて支払いが行われます\n• 現在の期間が終了する前に少なくとも24時間、自動更新がオフになっていない限り、登録は自動的に更新されます\n• アカウントには、現在の期間が終了する前の24時間以内に更新が請求され、更新の費用が識別されます\n• 購読はユーザーによって管理され、購入後にユーザーのアカウント設定に移動すると自動更新がオフになることがあります\n• 無料試用期間の未使用部分は、提供されている場合は、ユーザーが該当する場合はその書籍の購読を購入すると失効します\n– 利用規約へのリンク\nhttps://bigtranslatorprivacy.blogspot.com/2018/11/terms-conditions.html\n–プライバシーポリシーリンク\nhttps://bigtranslatorprivacy.blogspot.com/2018/11/privacy-policy.html";
"purchaseString1" = "購入";
"purchaseString2" = "購入をして下さい";
"purchaseString3" = "購入";
"purchaseString4" = "購入/月額";
"purchaseString5" = "";
"mailString" = "iPhoneの設定でメールアカウントを接続するか、直接私に連絡するにはt_iphone_app@yahoo.co.jpを使用してください。";
"Thanks!" = "ありがとう!";
"selectLanguage" = "言語とテキストを選択して入力してください";
"googleResult" = "谷歌翻译结果 ";
"bingResult" = "必应翻译结果 ";
"yandexResult" = "Yandex翻译结果 ";
"weblioResult" = "Weblio翻译结果 ";
"exciteResult" = "Excite翻译结果 ";
"youdaoResult" = "有道翻译结果 ";
"share" = "シェア";
"removeads" = "広告の削除";
"translate" = "翻訳";
"voice" = "音声";
"copy" = "コピー";
"save" = "セーブ";
"delete" = "削除";
"reward" = "動画広告🎥";
"purchase" = "プライバシーポリシー";
"done" = "終了";
"back" = "戻る";
"info" = "プライバシーポリシー";
"selectT" = "繁体字优先";
"selectS" = "简体的字优先";
"privacyString1" = "プライバシーポリシー";
"privacyString2" = "同意";
"privacyString3" = "同意しない";
"privacyString4" = "プライバシーポリシーでは、アプリケーションによって収集されたデータとその取り扱いと使用目的が示されます。同意しない場合、このアプリを使用することはできません。プライバシーポリシーボタンをクリックして、プライバシーポリシーをお読みください";
"watchads" = "動画広告🎥";
"onclickTerm" = "利用規約";
"3minutes" = "広告のを視聴後に60分間アンロックされます";

//////追加
"ocr" = "OCR";
"history" = "履歴";
"translation" = "翻訳";
"dictionary" = "辞書";
"result1" = "日本語 Or ビルマ語の結果";
"result1a" = "英語 Or ビルマ語の結果";
"result1b" = "中国語(繁) Or ビルマ語の結果";
"result1c" = "中国語(簡) Or ビルマ語の結果";
"result2" = "英語の結果";
"segmentString1" = "日本語→ビルマ語";
"segmentString2" = "ビルマ語→日本語";
"segmentString3" = "英語→ビルマ語";
"segmentString4" = "ビルマ語→英語";
"segmentString5" = "中国語(繁)→ビルマ語";
"segmentString6" = "ビルマ語→中国語(繁)";
"segmentString7" = "中国語(簡)→ビルマ語";
"segmentString8" = "ビルマ語→中国語(簡)";
"hereText" = "テキストを入力して言語を選択して翻訳ボタンを押した下さい ";//请输入内容
"hereText2" = "言語選択";//请选择选项
"masaru" = "まさる";
"voiceJapanese" = "日本語音声";
"voiceBurmese" = "ビルマ語音声";
"voiceEnglish" = "英語音声";
"voiceCht" = "中国語(繁)音声";
"voiceChs" = "中国語(簡)音声";
"selectVoice" = "音声選択";
"learnLanguage0" = "日本語とビルマ語を学習できます🤤画像を押してください";
"learnLanguage1" = "英語とビルマ語を学習できます🤤画像を押してください";
"learnLanguage2" = "中国語(繁)とビルマ語を学習できます🤤画像を押してください";
"learnLanguage3" = "中国語(簡)とビルマ語を学習できます🤤画像を押してください";
"learnLanguage4" = "ビルマ語の言語コードを取得できます🤤画像を押してください";
"currentLanguage0" = "現在の言語: 日本語ビルマ語";
"currentLanguage1" = "現在の言語: 英語ビルマ語";
"currentLanguage2" = "現在の言語: 中国語(繁)ビルマ語";
"currentLanguage3" = "現在の言語: 中国語(簡)ビルマ語";
"mapalert9" = "購入をすればアンロックができます";
"trip" = "旅行";
"firstMeeting" = "初対面";
"conversation" = "会話";
"work" = "仕事";
"date" = "デート";
"greeting" = "挨拶";
"others" = "その他";
"goAPP" = "アプリへ";//立即进入
"startOCRText" = "スタート";
"startText" = "認識テキスト:";
"startText2" = "これをやろう!";
"ADD" = "Menu";
"menuBtn" = "MENU";
"start" = "MENU";



肝心の呼び出し方はこんな感じで起動時に呼べば良いと思う

 

let isAgreePrivacy: Bool = Storage.sharedInstance.isAgreePrivacy()
self.defaults.synchronize()
if (!isAgreePrivacy) {

print("同意していない")

Storage.sharedInstance.agreePrivacy() //Appleリジェクト対策//同意させる

let nextvc = PrivacyPolicyController()

self.present(nextvc, animated: true, completion: nil)

} else {

print("同意している")
let isLaunchLanguage: Bool = Storage.sharedInstance.isSelectLanguageCheck()
self.defaults.synchronize()

}

 

 

 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA