Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Commit

Permalink
增加一个软重启启动APP的接口以后备用
Browse files Browse the repository at this point in the history
  • Loading branch information
kagurazakayashi committed Jun 21, 2015
1 parent e4aaa33 commit 8606cb7
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<key>IDESourceControlProjectIdentifier</key>
<string>270F49D8-2546-471C-BECA-AC0F8289B12A</string>
<key>IDESourceControlProjectName</key>
<string>project</string>
<string>CloudEmoticon2iOS</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>B286D462F13F08B6F79FE367145C9A00DF281073</key>
<string>https://github.com/cxchope/CloudEmoticon2iOS.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CloudEmoticon2iOS.xcodeproj/project.xcworkspace</string>
<string>CloudEmoticon2iOS.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>B286D462F13F08B6F79FE367145C9A00DF281073</key>
Expand Down
Binary file not shown.
29 changes: 26 additions & 3 deletions CloudEmoticon2iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var statBar: CustomStatusBar!
var netto:NetDownloadTo = NetDownloadTo.NONE
let filemgr:FileManager = FileManager()
var 应用运行参数:[NSObject : AnyObject]? = nil

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
if (url.scheme == "emostart") {
Expand Down Expand Up @@ -44,8 +45,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return false
}

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {

func 应用初始化(launchOptions: [NSObject : AnyObject]?) {
// [Optional] Power your app with Local Datastore. For more info, go to
// https://parse.com/docs/ios_guide#localdatastore/iOS
Parse.enableLocalDatastore()
Expand Down Expand Up @@ -82,15 +82,38 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
NSNotificationCenter.defaultCenter().addObserver(self, selector: "loadwebdataokce:", name: "loaddataokce", object: nil)

lang.载入语言(lang.当前系统语言())
// println(lang.系统支持的所有语言())
// println(lang.系统支持的所有语言())
let 当前语言包名称:String = lang.uage("语言包名称")
let 当前语言包作者:String = lang.uage("语言包作者")
NSLog("[AppDelegate]当前语言包名称:%@",当前语言包名称)
NSLog("[AppDelegate]当前语言包作者:%@",当前语言包作者)
}

func 界面初始化() {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let IB:UIStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
self.window?.rootViewController = IB.instantiateInitialViewController() as? UIViewController
}

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {

应用运行参数 = launchOptions
NSNotificationCenter.defaultCenter().addObserver(self, selector: "重新启动", name: "重新启动通知", object: nil)
界面初始化()
应用初始化(应用运行参数)
self.window?.makeKeyAndVisible()

return true
}

func 重新启动() {
self.window?.removeFromSuperview()
self.window = nil
界面初始化()
// 应用初始化(应用运行参数)
self.window?.makeKeyAndVisible()
}

func initSetting()
{
var defaults:NSUserDefaults = NSUserDefaults.standardUserDefaults()
Expand Down
2 changes: 0 additions & 2 deletions CloudEmoticon2iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Loading

0 comments on commit 8606cb7

Please sign in to comment.