Skip to content

Commit 7f10065

Browse files
committedNov 19, 2017
TouchCanvas: Version 2.1, 2017-11-16
Modernize Swift. Signed-off-by: Liu Lantao <liulantao@gmail.com>
1 parent 8404288 commit 7f10065

File tree

13 files changed

+1729
-0
lines changed

13 files changed

+1729
-0
lines changed
 

‎TouchCanvas/.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.DS_Store
2+
3+
# Xcode
4+
build/*
5+
*/build/*
6+
*/**/build/*
7+
*.mode1
8+
*.pbxuser
9+
*.perspective
10+
!default.perspectivev3
11+
!default.pbxuser
12+
*.mode1v3
13+
!default.mode1v3
14+
*.mode2v3
15+
!default.mode2v3
16+
*.perspectivev3
17+
!default.perspectivev3
18+
*.xcworkspace
19+
!default.xcworkspace
20+
xcuserdata
21+
profile
22+
*.moved-aside
23+
24+
# Generated files
25+
VersionX-revision.h
26+
27+
# build products
28+
build/
29+
*.[oa]
30+
31+
# version control files
32+
.hg
33+
.svn
34+
CVS
35+
36+
# automatic backup files
37+
*~.nib
38+
*.swp
39+
*~
40+
*(Autosaved).rtfd/
41+
Backup[ ]of[ ]*.pages/
42+
Backup[ ]of[ ]*.key/
43+
Backup[ ]of[ ]*.numbers/

‎TouchCanvas/LICENSE.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Sample code project: TouchCanvas: Using UITouch efficiently and effectively
2+
Version: 2.1
3+
4+
IMPORTANT: This Apple software is supplied to you by Apple
5+
Inc. ("Apple") in consideration of your agreement to the following
6+
terms, and your use, installation, modification or redistribution of
7+
this Apple software constitutes acceptance of these terms. If you do
8+
not agree with these terms, please do not use, install, modify or
9+
redistribute this Apple software.
10+
11+
In consideration of your agreement to abide by the following terms, and
12+
subject to these terms, Apple grants you a personal, non-exclusive
13+
license, under Apple's copyrights in this original Apple software (the
14+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
15+
Software, with or without modifications, in source and/or binary forms;
16+
provided that if you redistribute the Apple Software in its entirety and
17+
without modifications, you must retain this notice and the following
18+
text and disclaimers in all such redistributions of the Apple Software.
19+
Neither the name, trademarks, service marks or logos of Apple Inc. may
20+
be used to endorse or promote products derived from the Apple Software
21+
without specific prior written permission from Apple. Except as
22+
expressly stated in this notice, no other rights or licenses, express or
23+
implied, are granted by Apple herein, including but not limited to any
24+
patent rights that may be infringed by your derivative works or by other
25+
works in which the Apple Software may be incorporated.
26+
27+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
28+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
29+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
30+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
31+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32+
33+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
34+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
37+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
38+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
39+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
40+
POSSIBILITY OF SUCH DAMAGE.
41+
42+
Copyright (C) 2017 Apple Inc. All Rights Reserved.

‎TouchCanvas/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# TouchCanvas: Using UITouch efficiently and effectively
2+
3+
TouchCanvas illustrates responsive touch handling using coalesced and predictive touches (when available) via a simple drawing app. The sample uses force information (when available) to change line thickness. Apple Pencil and finger touches are distinguished via different colors. In addition, Apple Pencil only data is demonstrated through the use of estimated properties and updates providing the actual property data including the azimuth and altitude of the Apple Pencil while in use.
4+
5+
The sample includes a debug and precise options as follows:
6+
7+
* precise will force the use of UITouch's preciseLocation method over UITouch's location method for retrieving more precise screen coordinates.
8+
* debug will draw the lines displayed in different colors depending on properties gathered from the UITouch APIs. See the enclosed LinePoint class in Line.swift.
9+
10+
## Requirements
11+
12+
### Build
13+
14+
Xcode 9.0 or later, iOS 10.0 SDK or later
15+
16+
### Runtime
17+
18+
iOS 9.1
19+
20+
### Changes
21+
22+
version 2.1 - updated to Swift 4.0
23+
version 2.0 - first release
24+
25+
Copyright (C) 2017 Apple Inc. All rights reserved.
26+

0 commit comments

Comments
 (0)