Add article preview notification extension

This commit is contained in:
Chris Li 2017-02-01 11:38:26 -05:00
parent ab0bf5e738
commit 956818bc00
5 changed files with 288 additions and 12 deletions

View File

@ -77,6 +77,11 @@
977AE7F91DD8F22400F1E581 /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A102A1D022AD5007FC62C /* SearchBar.swift */; };
977B121C1E3A5E8D00981890 /* LibraryCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977B121B1E3A5E8D00981890 /* LibraryCells.swift */; };
977B954D1DD4C40400F6F62B /* ScanLocalBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D6811E1D6F70AC00E5FA99 /* ScanLocalBook.swift */; };
978C9DC01E4245B60078BFF7 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 978C9DBF1E4245B60078BFF7 /* UserNotifications.framework */; };
978C9DC21E4245B60078BFF7 /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 978C9DC11E4245B60078BFF7 /* UserNotificationsUI.framework */; };
978C9DCC1E4245B60078BFF7 /* ArticlePreview.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 978C9DBE1E4245B60078BFF7 /* ArticlePreview.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
978C9DD61E4245FD0078BFF7 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 978C9DD21E4245FD0078BFF7 /* MainInterface.storyboard */; };
978C9DD81E4245FD0078BFF7 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C9DD51E4245FD0078BFF7 /* NotificationViewController.swift */; };
97A08C151DD263B90070D0E4 /* Book.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D681341D6F711A00E5FA99 /* Book.swift */; };
97A127C91D777CF100FB204D /* RecentSearchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A127C51D777CF100FB204D /* RecentSearchController.swift */; };
97A127CC1D777CF100FB204D /* SearchResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A127C81D777CF100FB204D /* SearchResultController.swift */; };
@ -125,6 +130,13 @@
remoteGlobalIDString = 9779C3121D4575AD0064CC8E;
remoteInfo = Bookmarks;
};
978C9DCA1E4245B60078BFF7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97A2AB801C1B80FF00052E74 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 978C9DBD1E4245B60078BFF7;
remoteInfo = ArticlePreview;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@ -134,6 +146,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
978C9DCC1E4245B60078BFF7 /* ArticlePreview.appex in Embed App Extensions */,
9779C31E1D4575AE0064CC8E /* Bookmarks.appex in Embed App Extensions */,
);
name = "Embed App Extensions";
@ -217,6 +230,12 @@
977A458B1E14EA140089C596 /* Cloud.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cloud.swift; sourceTree = "<group>"; };
977B121B1E3A5E8D00981890 /* LibraryCells.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LibraryCells.swift; sourceTree = "<group>"; };
9788419C1DA2FF2A00D22D3C /* MainInterface.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainInterface.storyboard; sourceTree = "<group>"; };
978C9DBE1E4245B60078BFF7 /* ArticlePreview.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ArticlePreview.appex; sourceTree = BUILT_PRODUCTS_DIR; };
978C9DBF1E4245B60078BFF7 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
978C9DC11E4245B60078BFF7 /* UserNotificationsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotificationsUI.framework; path = System/Library/Frameworks/UserNotificationsUI.framework; sourceTree = SDKROOT; };
978C9DD31E4245FD0078BFF7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
978C9DD41E4245FD0078BFF7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
978C9DD51E4245FD0078BFF7 /* NotificationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = "<group>"; };
97A127C51D777CF100FB204D /* RecentSearchController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecentSearchController.swift; sourceTree = "<group>"; };
97A127C61D777CF100FB204D /* SearchScopeAndHistoryController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchScopeAndHistoryController.swift; sourceTree = "<group>"; };
97A127C81D777CF100FB204D /* SearchResultController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResultController.swift; sourceTree = "<group>"; };
@ -283,6 +302,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
978C9DBB1E4245B60078BFF7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
978C9DC21E4245B60078BFF7 /* UserNotificationsUI.framework in Frameworks */,
978C9DC01E4245B60078BFF7 /* UserNotifications.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97A2AB851C1B80FF00052E74 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -327,6 +355,8 @@
97E609F01D103DED00EBCB9D /* NotificationCenter.framework */,
198ECFA618CDD6B29CD462A0 /* Pods_Kiwix_OSX.framework */,
EC884ACBBA260AF741C4C4FE /* Pods_Kiwix_iOS.framework */,
978C9DBF1E4245B60078BFF7 /* UserNotifications.framework */,
978C9DC11E4245B60078BFF7 /* UserNotificationsUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -599,6 +629,24 @@
name = Properties;
sourceTree = "<group>";
};
978C9DD01E4245FD0078BFF7 /* iOSExtension */ = {
isa = PBXGroup;
children = (
978C9DD11E4245FD0078BFF7 /* ArticlePreview */,
);
path = iOSExtension;
sourceTree = "<group>";
};
978C9DD11E4245FD0078BFF7 /* ArticlePreview */ = {
isa = PBXGroup;
children = (
978C9DD21E4245FD0078BFF7 /* MainInterface.storyboard */,
978C9DD41E4245FD0078BFF7 /* Info.plist */,
978C9DD51E4245FD0078BFF7 /* NotificationViewController.swift */,
);
path = ArticlePreview;
sourceTree = "<group>";
};
97A1FD3C1D6F728200A80EE2 /* Tools */ = {
isa = PBXGroup;
children = (
@ -614,6 +662,7 @@
97A2AB7F1C1B80FF00052E74 = {
isa = PBXGroup;
children = (
978C9DD01E4245FD0078BFF7 /* iOSExtension */,
973BCD1F1CEB412E00F10B44 /* Shared */,
973BCCE41CEB3EDE00F10B44 /* iOS */,
97E609F21D103DED00EBCB9D /* iOSWidgets */,
@ -705,6 +754,7 @@
9C1D0054BEA442431151A95D /* Products */ = {
isa = PBXGroup;
children = (
978C9DBE1E4245B60078BFF7 /* ArticlePreview.appex */,
);
name = Products;
sourceTree = "<group>";
@ -740,6 +790,23 @@
productReference = 9779C3131D4575AD0064CC8E /* Bookmarks.appex */;
productType = "com.apple.product-type.app-extension";
};
978C9DBD1E4245B60078BFF7 /* ArticlePreview */ = {
isa = PBXNativeTarget;
buildConfigurationList = 978C9DCD1E4245B60078BFF7 /* Build configuration list for PBXNativeTarget "ArticlePreview" */;
buildPhases = (
978C9DBA1E4245B60078BFF7 /* Sources */,
978C9DBB1E4245B60078BFF7 /* Frameworks */,
978C9DBC1E4245B60078BFF7 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ArticlePreview;
productName = ArticlePreview;
productReference = 978C9DBE1E4245B60078BFF7 /* ArticlePreview.appex */;
productType = "com.apple.product-type.app-extension";
};
97A2AB871C1B80FF00052E74 /* Kiwix-iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97A2ABB31C1B810000052E74 /* Build configuration list for PBXNativeTarget "Kiwix-iOS" */;
@ -756,6 +823,7 @@
);
dependencies = (
9779C31D1D4575AE0064CC8E /* PBXTargetDependency */,
978C9DCB1E4245B60078BFF7 /* PBXTargetDependency */,
);
name = "Kiwix-iOS";
productName = Kiwix;
@ -768,7 +836,7 @@
97A2AB801C1B80FF00052E74 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = "Chris Li";
TargetAttributes = {
@ -782,6 +850,11 @@
};
};
};
978C9DBD1E4245B60078BFF7 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = L7HWM3SP3L;
ProvisioningStyle = Automatic;
};
97A2AB871C1B80FF00052E74 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = L7HWM3SP3L;
@ -812,6 +885,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97A2AB7F1C1B80FF00052E74;
productRefGroup = 9C1D0054BEA442431151A95D /* Products */;
@ -820,6 +894,7 @@
targets = (
97A2AB871C1B80FF00052E74 /* Kiwix-iOS */,
9779C3121D4575AD0064CC8E /* Bookmarks */,
978C9DBD1E4245B60078BFF7 /* ArticlePreview */,
);
};
/* End PBXProject section */
@ -833,6 +908,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
978C9DBC1E4245B60078BFF7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978C9DD61E4245FD0078BFF7 /* MainInterface.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97A2AB861C1B80FF00052E74 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -914,6 +997,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
978C9DBA1E4245B60078BFF7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978C9DD81E4245FD0078BFF7 /* NotificationViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97A2AB841C1B80FF00052E74 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -1003,8 +1094,24 @@
target = 9779C3121D4575AD0064CC8E /* Bookmarks */;
targetProxy = 9779C31C1D4575AE0064CC8E /* PBXContainerItemProxy */;
};
978C9DCB1E4245B60078BFF7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 978C9DBD1E4245B60078BFF7 /* ArticlePreview */;
targetProxy = 978C9DCA1E4245B60078BFF7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
978C9DD21E4245FD0078BFF7 /* MainInterface.storyboard */ = {
isa = PBXVariantGroup;
children = (
978C9DD31E4245FD0078BFF7 /* Base */,
);
name = MainInterface.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
9779C3201D4575AE0064CC8E /* Debug */ = {
isa = XCBuildConfiguration;
@ -1040,6 +1147,45 @@
};
name = Release;
};
978C9DCE1E4245B60078BFF7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = L7HWM3SP3L;
INFOPLIST_FILE = "$(SRCROOT)/iOSExtension/ArticlePreview/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix.ArticlePreview;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
978C9DCF1E4245B60078BFF7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = L7HWM3SP3L;
INFOPLIST_FILE = "$(SRCROOT)/iOSExtension/ArticlePreview/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix.ArticlePreview;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
97A2ABB11C1B810000052E74 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1216,6 +1362,14 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
978C9DCD1E4245B60078BFF7 /* Build configuration list for PBXNativeTarget "ArticlePreview" */ = {
isa = XCConfigurationList;
buildConfigurations = (
978C9DCE1E4245B60078BFF7 /* Debug */,
978C9DCF1E4245B60078BFF7 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
97A2AB831C1B80FF00052E74 /* Build configuration list for PBXProject "Kiwix" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -4,6 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>ArticlePreview.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>Bookmarks.xcscheme</key>
<dict>
<key>orderHint</key>
@ -20,57 +25,62 @@
<key>9722121A1D3ECCFE00C0DCF2</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>973BCCE81CEB3FA400F10B44</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>973BCCFB1CEB3FA400F10B44</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>973BCD061CEB3FA500F10B44</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>9779C2FD1D4574280064CC8E</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>9779C3121D4575AD0064CC8E</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>978C9DBD1E4245B60078BFF7</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>97A2AB871C1B80FF00052E74</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>97A2AB9E1C1B80FF00052E74</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>97A2ABA91C1B810000052E74</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>97CF3EEA1D428F9600AE82FE</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>97E609EE1D103DED00EBCB9D</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
</dict>
</dict>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="M4Y-Lb-cyx">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Notification View Controller-->
<scene sceneID="cwh-vc-ff4">
<objects>
<viewController id="M4Y-Lb-cyx" userLabel="Notification View Controller" customClass="NotificationViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ft6-oW-KC0"/>
<viewControllerLayoutGuide type="bottom" id="FKl-LY-JtV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" simulatedAppContext="notificationCenter" id="S3S-Oj-5AN">
<rect key="frame" x="0.0" y="0.0" width="320" height="37"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="top" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hello World" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="GcN-lo-r42">
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.45882353186607361" green="0.74901962280273438" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="FKl-LY-JtV" firstAttribute="top" secondItem="GcN-lo-r42" secondAttribute="bottom" constant="8" symbolic="YES" id="0Q0-KW-PJ6"/>
<constraint firstItem="GcN-lo-r42" firstAttribute="leading" secondItem="S3S-Oj-5AN" secondAttribute="leading" constant="20" symbolic="YES" id="6Vq-gs-PHe"/>
<constraint firstAttribute="trailing" secondItem="GcN-lo-r42" secondAttribute="trailing" constant="20" symbolic="YES" id="L8K-9R-egU"/>
<constraint firstItem="GcN-lo-r42" firstAttribute="top" secondItem="Ft6-oW-KC0" secondAttribute="bottom" constant="8" symbolic="YES" id="mYS-Cv-VNx"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout"/>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="320" height="37"/>
<connections>
<outlet property="label" destination="GcN-lo-r42" id="lpW-cU-7IG"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="vXp-U4-Rya" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ArticlePreview</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>UNNotificationExtensionCategory</key>
<string>myNotificationCategory</string>
<key>UNNotificationExtensionInitialContentSizeRatio</key>
<real>1</real>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.content-extension</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
//
// NotificationViewController.swift
// ArticlePreview
//
// Created by Chris Li on 2/1/17.
// Copyright © 2017 Chris Li. All rights reserved.
//
import UIKit
import UserNotifications
import UserNotificationsUI
class NotificationViewController: UIViewController, UNNotificationContentExtension {
@IBOutlet var label: UILabel?
override func viewDidLoad() {
super.viewDidLoad()
// Do any required interface initialization here.
}
func didReceive(_ notification: UNNotification) {
self.label?.text = notification.request.content.body
}
}