Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from rosberry/master
Browse files Browse the repository at this point in the history
Fix 13.4 warnings and migrate to Swift 5.0
  • Loading branch information
morizotter authored Dec 9, 2020
2 parents 268ac89 + 5510a40 commit 9482e2d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
13 changes: 8 additions & 5 deletions TouchVisualizer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,22 @@
attributes = {
LastSwiftMigration = 0710;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = molabo;
TargetAttributes = {
FF1A1A9E1AFF6C2200267156 = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0900;
LastSwiftMigration = 1140;
};
};
};
buildConfigurationList = FF1A1A991AFF6C2200267156 /* Build configuration list for PBXProject "TouchVisualizer" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = FF1A1A951AFF6C2200267156;
productRefGroup = FF1A1AA01AFF6C2200267156 /* Products */;
Expand Down Expand Up @@ -167,6 +168,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -226,6 +228,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -291,7 +294,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -311,7 +314,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FF1A1A9E1AFF6C2200267156"
BuildableName = "TouchVisualizer.framework"
BlueprintName = "TouchVisualizer"
ReferencedContainer = "container:TouchVisualizer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FF1A1A9E1AFF6C2200267156"
BuildableName = "TouchVisualizer.framework"
BlueprintName = "TouchVisualizer"
ReferencedContainer = "container:TouchVisualizer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -84,8 +82,6 @@
ReferencedContainer = "container:TouchVisualizer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
16 changes: 9 additions & 7 deletions TouchVisualizer/Visualizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,10 @@ extension Visualizer {
view.beginTouch()
view.center = touch.location(in: topWindow)
topWindow.addSubview(view)
log(touch)
case .moved:
if let view = findTouchView(touch) {
view.center = touch.location(in: topWindow)
}

log(touch)
case .stationary:
log(touch)
case .ended, .cancelled:
if let view = findTouchView(touch) {
UIView.animate(withDuration: 0.2, delay: 0.0, options: .allowUserInteraction, animations: { () -> Void in
Expand All @@ -177,9 +172,12 @@ extension Visualizer {
self.log(touch)
})
}

log(touch)
case .stationary, .regionEntered, .regionMoved, .regionExited:
break
@unknown default:
break
}
log(touch)
}
}
}
Expand Down Expand Up @@ -212,6 +210,10 @@ extension Visualizer {
case .stationary: phase = "S"
case .ended: phase = "E"
case .cancelled: phase = "C"
case .regionEntered: phase = "REN"
case .regionMoved: phase = "RM"
case .regionExited: phase = "REX"
@unknown default: phase = "U"
}

let x = String(format: "%.02f", view.center.x)
Expand Down

0 comments on commit 9482e2d

Please sign in to comment.