This repository has been archived by the owner on Dec 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from nfls/1.2.5
1.2.5
- Loading branch information
Showing
22 changed files
with
937 additions
and
748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13770" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="M4Y-Lb-cyx"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13770"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<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" customModule="ContentExtension" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" simulatedAppContext="notificationCenter" id="S3S-Oj-5AN"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="200"/> | ||
<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"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="40"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="40" id="9nH-OS-oRw"/> | ||
</constraints> | ||
<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> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AYr-VU-HwV"> | ||
<rect key="frame" x="0.0" y="40" width="320" height="160"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> | ||
<constraints> | ||
<constraint firstItem="GcN-lo-r42" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" symbolic="YES" id="6Vq-gs-PHe"/> | ||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="GcN-lo-r42" secondAttribute="trailing" symbolic="YES" id="L8K-9R-egU"/> | ||
<constraint firstItem="AYr-VU-HwV" firstAttribute="top" secondItem="GcN-lo-r42" secondAttribute="bottom" id="Oha-xG-cUh"/> | ||
<constraint firstItem="AYr-VU-HwV" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" id="SPX-P1-tT9"/> | ||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="AYr-VU-HwV" secondAttribute="trailing" id="bOf-fv-Fs4"/> | ||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="bottom" secondItem="AYr-VU-HwV" secondAttribute="bottom" id="h7X-pY-P81"/> | ||
<constraint firstItem="GcN-lo-r42" firstAttribute="top" secondItem="2BE-c3-nQJ" secondAttribute="top" symbolic="YES" id="mYS-Cv-VNx"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="2BE-c3-nQJ"/> | ||
</view> | ||
<extendedEdge key="edgesForExtendedLayout"/> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<size key="freeformSize" width="320" height="200"/> | ||
<connections> | ||
<outlet property="body" destination="AYr-VU-HwV" id="gFy-jB-pBG"/> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>ContentExtension</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.2.5</string> | ||
<key>CFBundleVersion</key> | ||
<string>7</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionAttributes</key> | ||
<dict> | ||
<key>UNNotificationExtensionCategory</key> | ||
<string>notice</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// NotificationViewController.swift | ||
// ContentExtension | ||
// | ||
// Created by hqy on 2017/11/9. | ||
// Copyright © 2017年 胡清阳. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import UserNotifications | ||
import UserNotificationsUI | ||
|
||
class NotificationViewController: UIViewController, UNNotificationContentExtension { | ||
|
||
@IBOutlet var body: UILabel! | ||
@IBOutlet var label: UILabel! | ||
@IBOutlet weak var image: UIImageView! | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any required interface initialization here. | ||
} | ||
|
||
func didReceive(_ notification: UNNotification) { | ||
label.text = notification.request.content.title | ||
label.sizeToFit() | ||
body.text = notification.request.content.body | ||
body.lineBreakMode = .byWordWrapping | ||
body.numberOfLines = 0 | ||
body.sizeToFit() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.