Skip to content

Commit 7f58441

Browse files
committed
初始化
1 parent f8d3d4b commit 7f58441

File tree

19 files changed

+1281
-0
lines changed

19 files changed

+1281
-0
lines changed

Diff for: 本地通知.xcodeproj/project.pbxproj

+552
Large diffs are not rendered by default.

Diff for: 本地通知.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>本地通知.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>6B2577BE1DDADF24000D054E</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
<key>6B2577D21DDADF24000D054E</key>
21+
<dict>
22+
<key>primary</key>
23+
<true/>
24+
</dict>
25+
<key>6B2577DD1DDADF24000D054E</key>
26+
<dict>
27+
<key>primary</key>
28+
<true/>
29+
</dict>
30+
</dict>
31+
</dict>
32+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0810"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "6B2577BE1DDADF24000D054E"
18+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;.app"
19+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;"
20+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "6B2577D21DDADF24000D054E"
36+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;Tests.xctest"
37+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;Tests"
38+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
<TestableReference
42+
skipped = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "6B2577DD1DDADF24000D054E"
46+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;UITests.xctest"
47+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;UITests"
48+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
49+
</BuildableReference>
50+
</TestableReference>
51+
</Testables>
52+
<MacroExpansion>
53+
<BuildableReference
54+
BuildableIdentifier = "primary"
55+
BlueprintIdentifier = "6B2577BE1DDADF24000D054E"
56+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;.app"
57+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;"
58+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
59+
</BuildableReference>
60+
</MacroExpansion>
61+
<AdditionalOptions>
62+
</AdditionalOptions>
63+
</TestAction>
64+
<LaunchAction
65+
buildConfiguration = "Debug"
66+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
67+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
68+
launchStyle = "0"
69+
useCustomWorkingDirectory = "NO"
70+
ignoresPersistentStateOnLaunch = "NO"
71+
debugDocumentVersioning = "YES"
72+
debugServiceExtension = "internal"
73+
allowLocationSimulation = "YES">
74+
<BuildableProductRunnable
75+
runnableDebuggingMode = "0">
76+
<BuildableReference
77+
BuildableIdentifier = "primary"
78+
BlueprintIdentifier = "6B2577BE1DDADF24000D054E"
79+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;.app"
80+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;"
81+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
82+
</BuildableReference>
83+
</BuildableProductRunnable>
84+
<AdditionalOptions>
85+
</AdditionalOptions>
86+
</LaunchAction>
87+
<ProfileAction
88+
buildConfiguration = "Release"
89+
shouldUseLaunchSchemeArgsEnv = "YES"
90+
savedToolIdentifier = ""
91+
useCustomWorkingDirectory = "NO"
92+
debugDocumentVersioning = "YES">
93+
<BuildableProductRunnable
94+
runnableDebuggingMode = "0">
95+
<BuildableReference
96+
BuildableIdentifier = "primary"
97+
BlueprintIdentifier = "6B2577BE1DDADF24000D054E"
98+
BuildableName = "&#x672c;&#x5730;&#x901a;&#x77e5;.app"
99+
BlueprintName = "&#x672c;&#x5730;&#x901a;&#x77e5;"
100+
ReferencedContainer = "container:&#x672c;&#x5730;&#x901a;&#x77e5;.xcodeproj">
101+
</BuildableReference>
102+
</BuildableProductRunnable>
103+
</ProfileAction>
104+
<AnalyzeAction
105+
buildConfiguration = "Debug">
106+
</AnalyzeAction>
107+
<ArchiveAction
108+
buildConfiguration = "Release"
109+
revealArchiveInOrganizer = "YES">
110+
</ArchiveAction>
111+
</Scheme>

Diff for: 本地通知/20100617172406530.png

20.3 KB
Loading

Diff for: 本地通知/AppDelegate.swift

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//
2+
// AppDelegate.swift
3+
// 本地通知
4+
//
5+
// Created by 何晓文 on 2016/11/15.
6+
// Copyright © 2016年 何晓文. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import UserNotifications
11+
@UIApplicationMain
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
var window: UIWindow?
15+
16+
17+
18+
//注册通知
19+
func registerAuthor(){
20+
if #available(iOS 8.0, *){
21+
//ios10
22+
// let type = UNAuthorizationOptions.alert.rawValue | UNAuthorizationOptions.badge.rawValue | UNAuthorizationOptions.sound.rawValue
23+
// let sets = UNNotificationSettings(
24+
let type = UIUserNotificationType.alert.rawValue | UIUserNotificationType.badge.rawValue | UIUserNotificationType.sound.rawValue
25+
let sets = UIUserNotificationSettings(types: UIUserNotificationType(rawValue: type), categories: nil)
26+
UIApplication.shared.registerUserNotificationSettings(sets)
27+
28+
}else if #available(iOS 10, *){
29+
30+
UNUserNotificationCenter.current().delegate = NotificationManager.sharedInstance
31+
32+
}
33+
}
34+
35+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
36+
37+
registerAuthor()
38+
39+
// Override point for customization after application launch.
40+
return true
41+
}
42+
43+
func applicationWillResignActive(_ application: UIApplication) {
44+
// 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.
45+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
46+
}
47+
48+
func applicationDidEnterBackground(_ application: UIApplication) {
49+
// 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.
50+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
51+
}
52+
53+
func applicationWillEnterForeground(_ application: UIApplication) {
54+
// 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.
55+
}
56+
57+
func applicationDidBecomeActive(_ application: UIApplication) {
58+
// 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.
59+
}
60+
61+
func applicationWillTerminate(_ application: UIApplication) {
62+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
63+
}
64+
65+
66+
}
67+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
}
43+
],
44+
"info" : {
45+
"version" : 1,
46+
"author" : "xcode"
47+
}
48+
}

Diff for: 本地通知/Base.lproj/LaunchScreen.storyboard

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>

Diff for: 本地通知/Base.lproj/Main.storyboard

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10+
</dependencies>
11+
<scenes>
12+
<!--View Controller-->
13+
<scene sceneID="tne-QT-ifu">
14+
<objects>
15+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="本地通知" customModuleProvider="target" sceneMemberID="viewController">
16+
<layoutGuides>
17+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
18+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
19+
</layoutGuides>
20+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23+
<subviews>
24+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lHu-1n-6Nw">
25+
<rect key="frame" x="220" y="298" width="46" height="30"/>
26+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
27+
<state key="normal" title="Button"/>
28+
<connections>
29+
<action selector="showNotification:" destination="BYZ-38-t0r" eventType="touchUpInside" id="uI1-jB-a43"/>
30+
</connections>
31+
</button>
32+
</subviews>
33+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
34+
</view>
35+
</viewController>
36+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
37+
</objects>
38+
<point key="canvasLocation" x="-196" y="36"/>
39+
</scene>
40+
</scenes>
41+
</document>

Diff for: 本地通知/Info.plist

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>LSRequiresIPhoneOS</key>
22+
<true/>
23+
<key>UILaunchStoryboardName</key>
24+
<string>LaunchScreen</string>
25+
<key>UIMainStoryboardFile</key>
26+
<string>Main</string>
27+
<key>UIRequiredDeviceCapabilities</key>
28+
<array>
29+
<string>armv7</string>
30+
</array>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeLeft</string>
35+
<string>UIInterfaceOrientationLandscapeRight</string>
36+
</array>
37+
</dict>
38+
</plist>

0 commit comments

Comments
 (0)