Browse Source

Tests + Finetuning!

pull/92/head
Abhishek 5 years ago
parent
commit
c0bb1dbbcc
  1. 7
      Clocker/Clocker.xcodeproj/project.pbxproj
  2. 28
      Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme
  3. 24
      Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme
  4. 24
      Clocker/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/ClockerHelper.xcscheme
  5. 6
      Clocker/Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj/xcshareddata/xcschemes/PTHotKey.framework.xcscheme
  6. 6
      Clocker/Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj/xcshareddata/xcschemes/ShortcutRecorder.framework.xcscheme
  7. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  8. 107
      Clocker/ClockerUITests/OnboardingSearchTests.swift
  9. 87
      Clocker/Onboarding/Onboarding.storyboard
  10. 22
      Clocker/Onboarding/OnboardingSearchController.swift

7
Clocker/Clocker.xcodeproj/project.pbxproj

@ -106,6 +106,7 @@
9A7CDC1B22BEC2170035902D /* StartupManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A7CDC1A22BEC2170035902D /* StartupManager.swift */; };
9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; };
9A8B256A232EFAD300204CAD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A13BAEC1CA88A76007C6CBE /* Localizable.strings */; };
9A97419B2455442100087B0D /* OnboardingSearchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A97419A2455442100087B0D /* OnboardingSearchTests.swift */; };
9A9E87621C1FEDB500A7A2DF /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A9E87611C1FEDB500A7A2DF /* CFNetwork.framework */; };
9A9E876A1C1FEDDB00A7A2DF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A9E87691C1FEDDB00A7A2DF /* SystemConfiguration.framework */; };
9AA522C023415BDD00C9E005 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9AA522BE23415BDD00C9E005 /* InfoPlist.strings */; };
@ -335,6 +336,7 @@
9A8605C31BEC155B00A810A4 /* Clocker-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Clocker-Info.plist"; path = "Clocker/Clocker-Info.plist"; sourceTree = "<group>"; };
9A8605CC1BEC155B00A810A4 /* Clocker-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Clocker-Prefix.pch"; path = "Clocker/Clocker-Prefix.pch"; sourceTree = "<group>"; };
9A86E2B51CE04F1600547EE7 /* ShortcutRecorder.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ShortcutRecorder.xcodeproj; path = "Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj"; sourceTree = "<group>"; };
9A97419A2455442100087B0D /* OnboardingSearchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingSearchTests.swift; sourceTree = "<group>"; };
9A9E87611C1FEDB500A7A2DF /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
9A9E87631C1FEDBD00A7A2DF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
9A9E87651C1FEDC500A7A2DF /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
@ -806,6 +808,7 @@
C2D30A8C21025106000BFAEE /* NetworkDisconnectionTests.swift */,
C22F3D7F2107778A0001D5E1 /* ShortcutTests.swift */,
C2AB022321AEED590014A401 /* OnboardingTests.swift */,
9A97419A2455442100087B0D /* OnboardingSearchTests.swift */,
);
path = ClockerUITests;
sourceTree = "<group>";
@ -963,7 +966,7 @@
CLASSPREFIX = "";
DefaultBuildSystemTypeForWorkspace = Latest;
LastSwiftUpdateCheck = 1000;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1140;
TargetAttributes = {
9A7547CF1F184DC3004705EF = {
CreatedOnToolsVersion = 8.3.2;
@ -1177,6 +1180,7 @@
C213713420B4FD920024D5A4 /* FloatingWindowTests.swift in Sources */,
C22F3D802107778A0001D5E1 /* ShortcutTests.swift in Sources */,
C2D30A8A210245C6000BFAEE /* ReviewTests.swift in Sources */,
9A97419B2455442100087B0D /* OnboardingSearchTests.swift in Sources */,
C2D30A8D21025106000BFAEE /* NetworkDisconnectionTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1931,6 +1935,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",

28
Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1140"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD4F7C0313C30F9F00825C6E"
BuildableName = "Clocker.app"
BlueprintName = "Clocker"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@ -50,17 +59,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD4F7C0313C30F9F00825C6E"
BuildableName = "Clocker.app"
BlueprintName = "Clocker"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -95,8 +93,6 @@
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">

24
Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD4F7C0313C30F9F00825C6E"
BuildableName = "Clocker.app"
BlueprintName = "Clocker"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD4F7C0313C30F9F00825C6E"
BuildableName = "Clocker.app"
BlueprintName = "Clocker"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -71,8 +69,6 @@
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

24
Clocker/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcschemes/ClockerHelper.xcscheme

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9A7547CF1F184DC3004705EF"
BuildableName = "ClockerHelper.app"
BlueprintName = "ClockerHelper"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9A7547CF1F184DC3004705EF"
BuildableName = "ClockerHelper.app"
BlueprintName = "ClockerHelper"
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -71,8 +69,6 @@
ReferencedContainer = "container:Clocker.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

6
Clocker/Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj/xcshareddata/xcschemes/PTHotKey.framework.xcscheme

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -51,8 +49,6 @@
ReferencedContainer = "container:ShortcutRecorder.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

6
Clocker/Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj/xcshareddata/xcschemes/ShortcutRecorder.framework.xcscheme

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -51,8 +49,6 @@
ReferencedContainer = "container:ShortcutRecorder.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

2
Clocker/ClockerUITests/AboutUsTests.swift

@ -33,7 +33,7 @@ class AboutUsTests: XCTestCase {
tapAboutTab()
let appDisplayName = "CFBundleDisplayName".localizedString()
let expectedVersion = "\(appDisplayName) 1.6.19 (74)"
let expectedVersion = "\(appDisplayName) 1.6.20 (75)"
guard let presentVersion = app.windows["Clocker"].staticTexts["ClockerVersion"].value as? String else {
XCTFail("Present version not present")
return

107
Clocker/ClockerUITests/OnboardingSearchTests.swift

@ -0,0 +1,107 @@
// Copyright © 2015 Abhishek Banthia
import XCTest
class OnboardingSearchTests: XCTestCase {
var app: XCUIApplication!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launchArguments.append(CLOnboaringTestsLaunchArgument)
app.launch()
// Let's go to the Search View
moveForward()
moveForward()
moveForward()
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testRegularSearch() throws {
let searchField = app.searchFields["MainSearchField"]
searchField.reset(text: "Paris")
searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags())
sleep(2) // Wait for the query to return
let results = app.tables["ResultsTableView"]
let firstResult = results.cells.firstMatch
XCTAssertTrue(results.cells.count > 0)
let resultsPredicate = NSPredicate(format: "value CONTAINS 'Paris'", "")
XCTAssertTrue(firstResult.staticTexts.matching(resultsPredicate).count > 0)
// Let's retrieve the tap and add it!
firstResult.doubleClick()
sleep(2) // Wait for the Undo button to appear
// Ensure Added Text is shown properly!
let predicate = NSPredicate(format: "value BEGINSWITH 'Added'", "")
let successTextShown = app.staticTexts.containing(predicate)
XCTAssertTrue(successTextShown.count > 0)
}
func testUndoSearch() throws {
let searchField = app.searchFields["MainSearchField"]
searchField.reset(text: "Seoul")
searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags())
sleep(2) // Wait for the query to return
let results = app.tables["ResultsTableView"]
let firstResult = results.cells.firstMatch
XCTAssertTrue(results.cells.count > 0)
let resultsPredicate = NSPredicate(format: "value CONTAINS 'Seoul'", "")
XCTAssertTrue(firstResult.staticTexts.containing(resultsPredicate).count > 0)
// Let's retrieve the tap and add it!
firstResult.doubleClick()
sleep(2) // Wait for the Undo button to appear
// Ensure Added Text is shown properly!
let predicate = NSPredicate(format: "value BEGINSWITH 'Added'", "")
let successTextShown = app.staticTexts.containing(predicate)
XCTAssertTrue(successTextShown.count > 0)
let undoButton = app.buttons.matching(identifier: "UndoButton").firstMatch
undoButton.click()
// Ensure Removed Text is shown!
let removedPredicate = NSPredicate(format: "value BEGINSWITH 'Removed.'", "")
let removedText = app.staticTexts.containing(removedPredicate)
XCTAssertTrue(removedText.count > 0)
}
func testMispelledCityNameSearch() throws {
let searchField = app.searchFields["MainSearchField"]
searchField.reset(text: "ajsdkjasdkjhasdkashkjda")
searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags())
sleep(2) // Wait for the query to return
let results = app.tables["ResultsTableView"]
let firstResult = results.cells.firstMatch
XCTAssertTrue(results.cells.count == 0)
XCTAssertFalse(firstResult.staticTexts["Paris, France"].exists)
sleep(2) // Wait for the Undo button to appear
// Ensure Added Text is shown properly!
let noErrorTextPredicate = NSPredicate(format: "value CONTAINS 'No results! 😔 Try entering the exact name.'", "")
let noErrorText = app.staticTexts.containing(noErrorTextPredicate)
XCTAssertTrue(noErrorText.count > 0)
}
private func moveForward() {
let onboardingWindow = app.windows["OnboardingWindow"]
onboardingWindow.buttons["Forward"].click()
sleep(1)
}
}

87
Clocker/Onboarding/Onboarding.storyboard

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="fde-UX-327">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="fde-UX-327">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16096"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@ -119,7 +119,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="R28-eL-ofd"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Dc6-Gx-aw1">
<rect key="frame" x="8" y="101" width="420" height="31"/>
<rect key="frame" x="8" y="116" width="420" height="25"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" placeholderString="Accessory Label" id="IZg-bl-Xko">
<font key="font" size="18" name="Avenir-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -127,7 +127,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3qt-6h-o21">
<rect key="frame" x="3" y="149" width="430" height="47"/>
<rect key="frame" x="3" y="158" width="430" height="38"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" placeholderString="App Name" id="vvz-nI-aO6">
<font key="font" size="28" name="Avenir-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -164,7 +164,7 @@ DQ
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="N6Z-mh-pET">
<rect key="frame" x="18" y="-18" width="400" height="23"/>
<rect key="frame" x="18" y="1" width="400" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="lMj-6p-4uB">
<font key="font" size="13" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -172,10 +172,10 @@ DQ
</textFieldCell>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="mF9-1w-sxR">
<rect key="frame" x="20" y="165" width="396" height="100"/>
<rect key="frame" x="20" y="179" width="396" height="100"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="Lef-GT-zuM">
<rect key="frame" x="8" y="67" width="157" height="23"/>
<rect key="frame" x="8" y="72" width="157" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Reminders Access Header" id="QiB-Um-yjg">
<font key="font" size="13" name="Avenir-Roman"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -183,7 +183,7 @@ DQ
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="O0s-Bu-IPq">
<rect key="frame" x="303" y="59" width="79" height="32"/>
<rect key="frame" x="303" y="62" width="79" height="32"/>
<buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BW3-qu-NiR">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -193,7 +193,7 @@ DQ
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="gHR-Pd-9pP">
<rect key="frame" x="8" y="5" width="370" height="47"/>
<rect key="frame" x="8" y="5" width="370" height="52"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Reminder Access Detail" id="zbc-CH-UBI">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -201,7 +201,7 @@ DQ
</textFieldCell>
</textField>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Zhi-9z-C2u">
<rect key="frame" x="253" y="69" width="16" height="16"/>
<rect key="frame" x="253" y="71" width="16" height="16"/>
</progressIndicator>
</subviews>
<constraints>
@ -219,10 +219,10 @@ DQ
</constraints>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4eB-eD-0jK">
<rect key="frame" x="20" y="25" width="396" height="100"/>
<rect key="frame" x="20" y="39" width="396" height="100"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="noJ-fx-c1b">
<rect key="frame" x="8" y="53" width="148" height="37"/>
<rect key="frame" x="8" y="48" width="148" height="42"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Header" id="cXW-N9-WyD">
<font key="font" size="13" name="Avenir-Roman"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -230,7 +230,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="749" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="wcB-cI-R4k">
<rect key="frame" x="8" y="20" width="370" height="23"/>
<rect key="frame" x="8" y="20" width="370" height="18"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="leO-6q-mRB">
<font key="font" size="13" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -238,7 +238,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="DgE-EN-bNM">
<rect key="frame" x="8" y="10" width="380" height="33"/>
<rect key="frame" x="8" y="10" width="380" height="28"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Detail" id="RpL-I6-iJq">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -246,7 +246,7 @@ DQ
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dI2-oA-MBA">
<rect key="frame" x="303" y="54" width="79" height="32"/>
<rect key="frame" x="303" y="52" width="79" height="32"/>
<buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="i5r-db-Pnw">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -256,7 +256,7 @@ DQ
</connections>
</button>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="0GH-vY-2Du">
<rect key="frame" x="253" y="64" width="16" height="16"/>
<rect key="frame" x="253" y="61" width="16" height="16"/>
</progressIndicator>
</subviews>
<constraints>
@ -286,7 +286,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="Ykz-ej-1Nf"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iMf-Uy-zAf">
<rect key="frame" x="120" y="310" width="308" height="20"/>
<rect key="frame" x="120" y="324" width="308" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Onboarding Info" id="MOO-BA-qzM">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -294,7 +294,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pC3-D3-DSa">
<rect key="frame" x="118" y="325" width="203" height="55"/>
<rect key="frame" x="118" y="335" width="203" height="45"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Screen Name" id="o72-Yp-qjT">
<font key="font" size="33" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -358,7 +358,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="p3m-Oi-4D1"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OpV-ID-Ygr">
<rect key="frame" x="120" y="310" width="94" height="20"/>
<rect key="frame" x="120" y="324" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Onboarding Info" id="Y20-SO-sAO">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -366,7 +366,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="70Q-lk-Lwh">
<rect key="frame" x="118" y="325" width="203" height="55"/>
<rect key="frame" x="118" y="335" width="203" height="45"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Screen Name" id="L5w-Cd-KTt">
<font key="font" size="33" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -374,7 +374,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hLN-Aq-g8b">
<rect key="frame" x="120" y="247" width="298" height="23"/>
<rect key="frame" x="120" y="266" width="298" height="18"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Accessory Label" id="N7I-qA-txi">
<font key="font" size="13" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -382,7 +382,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mDt-zc-oSU">
<rect key="frame" x="120" y="34" width="298" height="20"/>
<rect key="frame" x="120" y="34" width="298" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Alternate Way Description" id="TQL-aE-8L2">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -433,7 +433,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="bjq-tD-CZ4"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2ra-RP-SYR">
<rect key="frame" x="120" y="297" width="94" height="20"/>
<rect key="frame" x="120" y="311" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Onboarding Info" id="SIV-aM-Wjg">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -441,7 +441,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hqW-RG-UOt">
<rect key="frame" x="118" y="312" width="203" height="55"/>
<rect key="frame" x="118" y="322" width="203" height="45"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Screen Name" id="QDu-mo-gtb">
<font key="font" size="33" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -458,26 +458,23 @@ DQ
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
<connections>
<action selector="search:" target="bMm-q2-fpd" id="oHC-re-vql"/>
</connections>
<accessibility identifier="searchField"/>
</searchField>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="35" horizontalPageScroll="10" verticalLineScroll="35" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RGd-Ev-FdZ">
<rect key="frame" x="20" y="49" width="396" height="160"/>
<clipView key="contentView" id="XpR-1t-AQy">
<clipView key="contentView" ambiguous="YES" id="XpR-1t-AQy">
<rect key="frame" x="0.0" y="0.0" width="396" height="160"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="33" rowSizeStyle="automatic" viewBased="YES" id="30y-X6-i7I">
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="33" rowSizeStyle="automatic" viewBased="YES" id="30y-X6-i7I">
<rect key="frame" x="0.0" y="0.0" width="396" height="160"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="393" minWidth="40" maxWidth="1000" id="2gZ-a7-gsB">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
@ -488,12 +485,12 @@ DQ
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView identifier="resultHeaderCellView" id="58e-cL-Nln" customClass="ResultSectionHeaderTableViewCell" customModule="Clocker" customModuleProvider="target">
<tableCellView identifier="resultHeaderCellView" misplaced="YES" id="58e-cL-Nln" customClass="ResultSectionHeaderTableViewCell" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="1" y="1" width="393" height="23"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="ceH-HF-rVw">
<rect key="frame" x="-2" y="0.0" width="87" height="23"/>
<rect key="frame" x="-2" y="0.0" width="87" height="18"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="Section Name" placeholderString="Section Name" id="zKt-LI-GWL">
<font key="font" size="13" name="Avenir-Medium"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -511,12 +508,12 @@ DQ
<outlet property="headerLabel" destination="ceH-HF-rVw" id="ngR-Ih-1lh"/>
</connections>
</tableCellView>
<tableCellView identifier="resultCellView" id="Et0-Ex-6mu" customClass="ResultTableViewCell" customModule="Clocker" customModuleProvider="target">
<tableCellView identifier="resultCellView" misplaced="YES" id="Et0-Ex-6mu" customClass="ResultTableViewCell" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="1" y="26" width="393" height="33"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="73t-th-Wh0">
<rect key="frame" x="-2" y="0.0" width="392" height="33"/>
<rect key="frame" x="-2" y="0.0" width="392" height="27"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="Search Result Name" placeholderString="Search Result Name" id="gDs-r6-Az3">
<font key="font" size="20" name="Avenir-Light"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -552,16 +549,16 @@ DQ
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wDx-nO-z0M">
<rect key="frame" x="20" y="24" width="4" height="23"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wDx-nO-z0M">
<rect key="frame" x="20" y="29" width="4" height="18"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" id="c1w-j2-JT6">
<font key="font" size="13" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="51r-DX-fZU">
<rect key="frame" x="22" y="26" width="394" height="20"/>
<button verticalHuggingPriority="750" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="51r-DX-fZU">
<rect key="frame" x="22" y="30" width="394" height="16"/>
<buttonCell key="cell" type="bevel" title="UNDO" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="h5W-mQ-yIP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="12" name="Avenir-Medium"/>
@ -621,7 +618,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="5ri-Dg-fqE"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fEE-QM-0Pi">
<rect key="frame" x="120" y="297" width="94" height="20"/>
<rect key="frame" x="120" y="311" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Onboarding Info" id="2qy-EI-Vw9">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -629,7 +626,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rQQ-Iw-KIs">
<rect key="frame" x="118" y="312" width="203" height="55"/>
<rect key="frame" x="118" y="322" width="203" height="45"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Screen Name" id="Dg6-xM-fYe">
<font key="font" size="33" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -637,11 +634,11 @@ DQ
</textFieldCell>
</textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nbC-4o-Xjf">
<rect key="frame" x="122" y="232" width="294" height="23"/>
<rect key="frame" x="122" y="246" width="294" height="23"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="left" imageScaling="proportionallyDown" image="Dark Menubar" id="cZ2-x0-bJ2"/>
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="kMo-BE-OAn">
<rect key="frame" x="120" y="172" width="298" height="20"/>
<rect key="frame" x="120" y="190" width="298" height="16"/>
<textFieldCell key="cell" selectable="YES" title="Multiline Label" id="M4F-nv-Eyo">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -649,7 +646,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6WD-GP-iz1">
<rect key="frame" x="122" y="122" width="288" height="22"/>
<rect key="frame" x="122" y="140" width="288" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="OvB-hh-3zl"/>
</constraints>
@ -660,7 +657,7 @@ DQ
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qLP-tx-m41" customClass="UnderlinedButton" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="117" y="84" width="293" height="15"/>
<rect key="frame" x="117" y="103" width="293" height="14"/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="o87-us-e82">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Avenir-Book"/>

22
Clocker/Onboarding/OnboardingSearchController.swift

@ -26,6 +26,7 @@ class OnboardingSearchController: NSViewController {
view.wantsLayer = true
resultsTableView.delegate = self
resultsTableView.setAccessibility("ResultsTableView")
resultsTableView.dataSource = self
resultsTableView.target = self
resultsTableView.doubleAction = #selector(doubleClickAction(_:))
@ -43,6 +44,7 @@ class OnboardingSearchController: NSViewController {
let attributes = [NSAttributedString.Key.foregroundColor: NSColor.linkColor,
NSAttributedString.Key.font: font]
undoButton.attributedTitle = NSAttributedString(string: "UNDO", attributes: attributes)
undoButton.setAccessibility("UndoButton")
}
setupUndoButton()
@ -213,6 +215,7 @@ class OnboardingSearchController: NSViewController {
setInfoLabel(CLEmptyString)
searchBar.placeholderString = "Press Enter to Search!"
searchBar.delegate = self
searchBar.setAccessibility("MainSearchField")
resultsTableView.backgroundColor = Themer.shared().mainBackgroundColor()
resultsTableView.enclosingScrollView?.backgroundColor = Themer.shared().mainBackgroundColor()
@ -382,7 +385,7 @@ extension OnboardingSearchController: NSTableViewDataSource {
func tableView(_ tableView: NSTableView, viewFor _: NSTableColumn?, row: Int) -> NSView? {
if let result = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "resultCellView"), owner: self) as? ResultTableViewCell, row >= 0, row < results.count {
let currentTimezone = results[row]
result.result.stringValue = currentTimezone.formattedAddress ?? "Place Name"
result.result.stringValue = " \(currentTimezone.formattedAddress ?? "Place Name")"
result.result.textColor = Themer.shared().mainTextColor()
return result
}
@ -403,12 +406,29 @@ extension OnboardingSearchController: NSTableViewDelegate {
func tableView(_: NSTableView, shouldSelectRow row: Int) -> Bool {
return results.isEmpty ? row != 0 : true
}
func tableView(_: NSTableView, rowViewForRow _: Int) -> NSTableRowView? {
return OnboardingSelectionTableRowView()
}
}
class ResultSectionHeaderTableViewCell: NSTableCellView {
@IBOutlet var headerLabel: NSTextField!
}
class OnboardingSelectionTableRowView: NSTableRowView {
override func drawSelection(in _: NSRect) {
if selectionHighlightStyle != .none {
let selectionRect = NSInsetRect(bounds, 1, 1)
NSColor(calibratedWhite: 0.4, alpha: 1).setStroke()
NSColor(calibratedWhite: 0.4, alpha: 1).setFill()
let selectionPath = NSBezierPath(roundedRect: selectionRect, xRadius: 6, yRadius: 6)
selectionPath.fill()
selectionPath.stroke()
}
}
}
class ResultTableViewCell: NSTableCellView {
@IBOutlet var result: NSTextField!
}

Loading…
Cancel
Save