Skip to content

Commit

Permalink
add macOS 10.10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev1an committed Dec 29, 2016
1 parent 447be43 commit f2c3ec2
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 29 deletions.
4 changes: 2 additions & 2 deletions eidReader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -419,7 +419,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
7 changes: 0 additions & 7 deletions eidReader/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"unassigned" : true,
"scale" : "2x"
}
],
"info" : {
Expand Down
Binary file not shown.
5 changes: 5 additions & 0 deletions eidReader/BEIDCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,9 @@ extension DateFormatter {
self.init()
self.dateFormat = format
}

convenience init(style: DateFormatter.Style) {
self.init()
self.dateStyle = style
}
}
51 changes: 36 additions & 15 deletions eidReader/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<plugIn identifier="com.apple.MapKitIBPlugin" version="11762"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="cells containing NSDateIntervalFormatter" minSystemVersion="10.11"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<capability name="stacking Non-gravity area distributions on NSStackView" minToolsVersion="7.0" minSystemVersion="10.11"/>
</dependencies>
Expand Down Expand Up @@ -658,7 +657,7 @@
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="cardreader" customModuleProvider="target"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="eidReader" customModuleProvider="target"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
Expand All @@ -684,37 +683,37 @@
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="cardreader" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="eidReader" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="621" height="433"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<progressIndicator wantsLayer="YES" maxValue="11" displayedWhenStopped="NO" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="LYm-lH-Cvb">
<rect key="frame" x="56" y="322" width="32" height="32"/>
<rect key="frame" x="56" y="322.5" width="32" height="32"/>
</progressIndicator>
<imageView wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gjR-aj-CdO">
<rect key="frame" x="20" y="262" width="105" height="151"/>
<rect key="frame" x="20" y="262.5" width="104.5" height="150.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="gjR-aj-CdO" secondAttribute="height" multiplier="7:10" id="tWr-9I-dkO"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="dA3-61-187"/>
</imageView>
<mapView mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="acT-Ao-SIC">
<rect key="frame" x="20" y="20" width="581" height="209"/>
<rect key="frame" x="20" y="20" width="581" height="209.5"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="150" id="PNQ-am-3WJ"/>
</constraints>
</mapView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tdp-mB-Lhz">
<rect key="frame" x="18" y="237" width="76" height="17"/>
<rect key="frame" x="18" y="237.5" width="76" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Woonplaats" id="WQG-9c-flS">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="16" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h1t-iY-yBT">
<rect key="frame" x="146" y="262" width="249" height="150"/>
<rect key="frame" x="144" y="262.5" width="340" height="150"/>
<subviews>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14x-IE-kut">
<rect key="frame" x="0.0" y="83" width="249" height="67"/>
Expand Down Expand Up @@ -840,7 +839,7 @@
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="s3j-Z6-vlH">
<rect key="frame" x="0.0" y="0.0" width="238" height="67"/>
<rect key="frame" x="0.0" y="0.0" width="340" height="67"/>
<subviews>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7FK-1z-xQ1">
<rect key="frame" x="0.0" y="50" width="135" height="17"/>
Expand Down Expand Up @@ -872,20 +871,37 @@
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0zl-DO-aLg">
<rect key="frame" x="0.0" y="25" width="238" height="17"/>
<rect key="frame" x="0.0" y="25" width="340" height="17"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ndE-1D-oat">
<rect key="frame" x="-2" y="0.0" width="122" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Geldigheidsperiode" id="n2z-o1-IxF">
<rect key="frame" x="-2" y="0.0" width="80" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Geldig vanaf" id="n2z-o1-IxF">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Agz-HH-rck">
<rect key="frame" x="124" y="0.0" width="116" height="17"/>
<rect key="frame" x="82" y="0.0" width="116" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="10 november 2012" id="mdB-j1-6a6">
<dateIntervalFormatter key="formatter" dateStyle="long" id="dww-iR-mwu"/>
<dateFormatter key="formatter" dateStyle="long" doesRelativeDateFormatting="YES" id="X2W-Qt-u2M"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vBv-7p-db3">
<rect key="frame" x="202" y="0.0" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="tot" id="PgG-UZ-LHC">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zhZ-1V-wOs">
<rect key="frame" x="227" y="0.0" width="115" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="10 november 2017" id="v6e-9A-SKh">
<dateFormatter key="formatter" dateStyle="long" doesRelativeDateFormatting="YES" id="Iqa-cQ-Fcx"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -895,10 +911,14 @@
<visibilityPriorities>
<integer value="1000"/>
<integer value="1000"/>
<integer value="1000"/>
<integer value="1000"/>
</visibilityPriorities>
<customSpacing>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tK7-LN-fxz">
Expand Down Expand Up @@ -981,7 +1001,8 @@
<outlet property="nationalityField" destination="rpO-KH-l0u" id="oC5-iU-eyB"/>
<outlet property="profileImage" destination="gjR-aj-CdO" id="smC-iN-OTe"/>
<outlet property="releasePlaceField" destination="eCF-F4-jCe" id="eer-8g-JtB"/>
<outlet property="validityIntervalField" destination="Agz-HH-rck" id="yea-vp-WVY"/>
<outlet property="validEndField" destination="zhZ-1V-wOs" id="F5z-mu-nlH"/>
<outlet property="validStartField" destination="Agz-HH-rck" id="FKz-FC-tw2"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
Expand Down
2 changes: 1 addition & 1 deletion eidReader/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.4</string>
<key>CFBundleVersion</key>
<string>3</string>
<key>LSApplicationCategoryType</key>
Expand Down
10 changes: 6 additions & 4 deletions eidReader/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ViewController: NSViewController {
@IBOutlet weak var birthdayField: NSTextField!
@IBOutlet weak var nationalIDField: NSTextField!
@IBOutlet weak var cardNumberField: NSTextField!
@IBOutlet weak var validityIntervalField: NSTextField!
@IBOutlet weak var validStartField: NSTextField!
@IBOutlet weak var validEndField: NSTextField!
@IBOutlet weak var releasePlaceField: NSTextField!
@IBOutlet weak var map: MKMapView!

Expand Down Expand Up @@ -77,7 +78,8 @@ class ViewController: NSViewController {
self.birthdayField.stringValue = ""
self.nationalIDField.stringValue = ""
self.cardNumberField.stringValue = ""
self.validityIntervalField.stringValue = ""
self.validStartField.stringValue = ""
self.validEndField.stringValue = ""
self.releasePlaceField.stringValue = ""
if let address = self.currentAddress {self.map.removeAnnotation(address)}
}
Expand Down Expand Up @@ -122,7 +124,8 @@ class ViewController: NSViewController {
self.nationalIDField.stringValue = basicInfo.nationalIDNumber

self.cardNumberField.stringValue = basicInfo.cardNumber
self.validityIntervalField.objectValue = DateInterval(start: basicInfo.validityStart, end: basicInfo.validityEnd)
self.validStartField.objectValue = basicInfo.validityStart
self.validEndField.objectValue = basicInfo.validityEnd
self.releasePlaceField.stringValue = basicInfo.releasePlace
}
}
Expand Down Expand Up @@ -153,4 +156,3 @@ class ViewController: NSViewController {


}

0 comments on commit f2c3ec2

Please sign in to comment.