Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 特定时间的消防警报-Swift_Ios_Swift_Apple Push Notifications_Uipickerview - Fatal编程技术网

Ios 特定时间的消防警报-Swift

Ios 特定时间的消防警报-Swift,ios,swift,apple-push-notifications,uipickerview,Ios,Swift,Apple Push Notifications,Uipickerview,您好,我想知道是否有一种方法可以显示推送通知,并在特定日期获得用户的批准。我目前有一个推送通知的切换,当这个切换被调用时,它应该显示一个选择器视图,以便用户希望这些通知何时出现。例如,用户可以选择每周、每天、每月(这非常好)或每年发送通知。此外,让用户能够选择具体的日期也是一个不错的选择。我不知道我怎样才能做到这一点。我希望在整个过程中得到任何指导或帮助 背景:我正在为我高中的报纸制作一个应用程序,希望提醒用户查看该应用程序。在每个月的第一天通知用户会很好,因为我们学校在每个月的第一天发布一个新

您好,我想知道是否有一种方法可以显示推送通知,并在特定日期获得用户的批准。我目前有一个推送通知的切换,当这个切换被调用时,它应该显示一个选择器视图,以便用户希望这些通知何时出现。例如,用户可以选择每周、每天、每月(这非常好)或每年发送通知。此外,让用户能够选择具体的日期也是一个不错的选择。我不知道我怎样才能做到这一点。我希望在整个过程中得到任何指导或帮助

背景:我正在为我高中的报纸制作一个应用程序,希望提醒用户查看该应用程序。在每个月的第一天通知用户会很好,因为我们学校在每个月的第一天发布一个新版本

以下是我的应用程序现在的外观

以下是我当前的AppDelegate.swift代码,以供参考:

//
//  AppDelegate.swift
//  TheGunnOracleApp
//
//  Created by Rajat Khare on 11/22/16.
//  Copyright © 2016 RDKhare. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {




        if(!UserDefaults.standard.bool(forKey: "HasLaunchedOnce"))
        {

            UserDefaults.standard.set(true, forKey: "HasLaunchedOnce")
            UserDefaults.standard.synchronize()

        }
        else{

            let storyboard = UIStoryboard(name: "Main", bundle: nil)

            self.window!.rootViewController = storyboard.instantiateViewController(withIdentifier: "StartAfterFirst")

            self.window?.makeKeyAndVisible()

        }



        if Reachability.checkIntenetRechable() == false {



            let alert = UIAlertController(title: "No Internet Connection", message: "The Internet connection appears to be offline. Please connect to Wi-Fi or use Cellular Data to continue", preferredStyle: UIAlertControllerStyle.alert)

            alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))

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

        }


        return true
    }





    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {





        return true
    }

    func applicationWillResignActive(_ application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
    }

    func applicationDidEnterBackground(_ application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    func applicationWillEnterForeground(_ application: UIApplication) {
        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }


    func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {

        if shortcutItem.type == "com.rdkhare.Home"{

            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            let frontNavigationController = storyboard.instantiateViewController(withIdentifier: "VCHome")
            let rearNavigationController = storyboard.instantiateViewController(withIdentifier: "menuVC")
            let mainRevealController : SWRevealViewController = SWRevealViewController(rearViewController: rearNavigationController, frontViewController: frontNavigationController)

            self.window?.rootViewController? = mainRevealController
//            let homeVC = sb.instantiateViewController(withIdentifier: "homePage1") as! WebViewHome
//            let root = UIApplication.shared.keyWindow?.rootViewController
//            let navController = UINavigationController(rootViewController: homeVC)
//            root?.present(navController, animated: true, completion: {
//                completionHandler(true)


//            })

    }




    }


}