Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 27b0219

Browse files
committed
Updating NSNotification to Notification
1 parent 7ed806c commit 27b0219

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

PasscodeLock/PasscodeLockViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ open class PasscodeLockViewController: UIViewController, PasscodeLockTypeDelegat
111111

112112
fileprivate func setupEvents() {
113113

114-
notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appWillEnterForegroundHandler(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil)
115-
notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appDidEnterBackgroundHandler(_:)), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil)
114+
notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appWillEnterForegroundHandler(_:)), name: Notification.Name.UIApplicationWillEnterForeground, object: nil)
115+
notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appDidEnterBackgroundHandler(_:)), name: Notification.Name.UIApplicationDidEnterBackground, object: nil)
116116
}
117117

118118
fileprivate func clearEvents() {

PasscodeLock/Views/PasscodeLockView.xib

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16B2657" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
47
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
69
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
710
</dependencies>
811
<objects>
@@ -27,19 +30,22 @@
2730
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2831
<subviews>
2932
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1wK-Ol-7mm">
33+
<rect key="frame" x="169" y="152.5" width="37" height="23"/>
3034
<fontDescription key="fontDescription" type="system" pointSize="19"/>
3135
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3236
<nil key="highlightedColor"/>
3337
</label>
3438
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Description" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HbT-GO-CPk">
39+
<rect key="frame" x="148" y="179.5" width="79" height="18"/>
3540
<fontDescription key="fontDescription" type="system" pointSize="15"/>
3641
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3742
<nil key="highlightedColor"/>
3843
</label>
3944
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HcN-lo-9Jb" userLabel="Placeholders">
45+
<rect key="frame" x="140.5" y="213.5" width="94" height="16"/>
4046
<subviews>
4147
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="w14-Kb-Jnf" userLabel="Placeholder 1" customClass="PasscodeSignPlaceholderView" customModule="PasscodeLock" customModuleProvider="target">
42-
<frame key="frameInset" width="1000" height="1000"/>
48+
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
4349
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4450
<userDefinedRuntimeAttributes>
4551
<userDefinedRuntimeAttribute type="color" keyPath="errorColor">
@@ -54,7 +60,7 @@
5460
</userDefinedRuntimeAttributes>
5561
</view>
5662
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OSf-H5-f20" userLabel="Placeholder 2" customClass="PasscodeSignPlaceholderView" customModule="PasscodeLock" customModuleProvider="target">
57-
<frame key="frameInset" width="1000" height="1000"/>
63+
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
5864
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
5965
<userDefinedRuntimeAttributes>
6066
<userDefinedRuntimeAttribute type="color" keyPath="errorColor">
@@ -69,7 +75,7 @@
6975
</userDefinedRuntimeAttributes>
7076
</view>
7177
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Tg-dE-gH4" userLabel="Placeholder 3" customClass="PasscodeSignPlaceholderView" customModule="PasscodeLock" customModuleProvider="target">
72-
<frame key="frameInset" width="1000" height="1000"/>
78+
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
7379
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
7480
<userDefinedRuntimeAttributes>
7581
<userDefinedRuntimeAttribute type="color" keyPath="errorColor">
@@ -84,7 +90,7 @@
8490
</userDefinedRuntimeAttributes>
8591
</view>
8692
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Fhs-1e-Ysl" userLabel="Placeholder 4" customClass="PasscodeSignPlaceholderView" customModule="PasscodeLock" customModuleProvider="target">
87-
<frame key="frameInset" width="1000" height="1000"/>
93+
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
8894
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
8995
<userDefinedRuntimeAttributes>
9096
<userDefinedRuntimeAttribute type="color" keyPath="errorColor">
@@ -114,6 +120,7 @@
114120
</constraints>
115121
</view>
116122
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cuq-ue-Jyj" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
123+
<rect key="frame" x="87.5" y="253.5" width="60" height="60"/>
117124
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
118125
<state key="normal" title="1">
119126
<color key="titleColor" red="0.45882352941176469" green="0.60392156862745094" blue="0.89411764705882357" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -138,6 +145,7 @@
138145
</connections>
139146
</button>
140147
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CGh-ph-49t" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
148+
<rect key="frame" x="157.5" y="253.5" width="60" height="60"/>
141149
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
142150
<state key="normal" title="2">
143151
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -162,6 +170,7 @@
162170
</connections>
163171
</button>
164172
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pLy-90-g1a" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
173+
<rect key="frame" x="227.5" y="253.5" width="60" height="60"/>
165174
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
166175
<state key="normal" title="3">
167176
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -186,6 +195,7 @@
186195
</connections>
187196
</button>
188197
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RR4-5o-pli" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
198+
<rect key="frame" x="87.5" y="323.5" width="60" height="60"/>
189199
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
190200
<state key="normal" title="4">
191201
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -210,6 +220,7 @@
210220
</connections>
211221
</button>
212222
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="C9Z-3u-ohd" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
223+
<rect key="frame" x="157.5" y="323.5" width="60" height="60"/>
213224
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
214225
<state key="normal" title="5">
215226
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -234,6 +245,7 @@
234245
</connections>
235246
</button>
236247
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WDx-aD-wJK" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
248+
<rect key="frame" x="227.5" y="323.5" width="60" height="60"/>
237249
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
238250
<state key="normal" title="6">
239251
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -258,6 +270,7 @@
258270
</connections>
259271
</button>
260272
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RA8-jd-dag" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
273+
<rect key="frame" x="87.5" y="393.5" width="60" height="60"/>
261274
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
262275
<state key="normal" title="7">
263276
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -282,6 +295,7 @@
282295
</connections>
283296
</button>
284297
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PbJ-Y8-MMf" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
298+
<rect key="frame" x="157.5" y="393.5" width="60" height="60"/>
285299
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
286300
<state key="normal" title="8">
287301
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -306,6 +320,7 @@
306320
</connections>
307321
</button>
308322
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EUD-XB-0CR" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
323+
<rect key="frame" x="227.5" y="393.5" width="60" height="60"/>
309324
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
310325
<state key="normal" title="9">
311326
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -330,6 +345,7 @@
330345
</connections>
331346
</button>
332347
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0CR-0R-0Nr" customClass="PasscodeSignButton" customModule="PasscodeLock" customModuleProvider="target">
348+
<rect key="frame" x="157.5" y="463.5" width="60" height="60"/>
333349
<fontDescription key="fontDescription" type="system" weight="light" pointSize="21"/>
334350
<state key="normal" title="0">
335351
<color key="titleColor" red="0.45882352939999999" green="0.60392156860000001" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -354,6 +370,7 @@
354370
</connections>
355371
</button>
356372
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="etg-x7-Mx1">
373+
<rect key="frame" x="89.5" y="480.5" width="56" height="26"/>
357374
<inset key="contentEdgeInsets" minX="4" minY="4" maxX="4" maxY="4"/>
358375
<state key="normal" title="Cancel">
359376
<color key="titleColor" red="0.4549019608" green="0.59999999999999998" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -363,6 +380,7 @@
363380
</connections>
364381
</button>
365382
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="H78-kl-y6L">
383+
<rect key="frame" x="231" y="480.5" width="53" height="26"/>
366384
<inset key="contentEdgeInsets" minX="4" minY="4" maxX="4" maxY="4"/>
367385
<state key="normal" title="Delete">
368386
<color key="titleColor" red="0.45490196078431372" green="0.59999999999999998" blue="0.89411764705882357" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -375,6 +393,7 @@
375393
</connections>
376394
</button>
377395
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Ph-dj-v7R" userLabel="TouchID Button">
396+
<rect key="frame" x="139.5" y="625" width="96" height="26"/>
378397
<inset key="contentEdgeInsets" minX="4" minY="4" maxX="4" maxY="4"/>
379398
<state key="normal" title="Use TouchID">
380399
<color key="titleColor" red="0.4549019608" green="0.59999999999999998" blue="0.89411764709999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

0 commit comments

Comments
 (0)