File tree 7 files changed +122
-0
lines changed
7 files changed +122
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,5 @@ DerivedData/
7
7
.swiftpm /config /registries.json
8
8
.swiftpm /xcode /package.xcworkspace /contents.xcworkspacedata
9
9
.netrc
10
+
11
+ docs
Original file line number Diff line number Diff line change
1
+ .PHONY : docc
2
+ docc :
3
+ bash scripts/docc.sh
4
+
5
+ .PHONY : docc-preview
6
+ docc-preview :
7
+ bash scripts/docc-preview.sh
Original file line number Diff line number Diff line change
1
+ # `` TouchTracker ``
2
+
3
+ 👆Show a mark at the touched point on the View.
4
+
5
+ @Metadata {
6
+ @DocumentationExtension (mergeBehavior: append)
7
+ @Available (iOS, introduced: "13.0")
8
+ }
9
+
10
+ <!-- @START_MENU_TOKEN@--> Summary<!-- @END_MENU_TOKEN@-->
11
+
12
+ ## Overview
13
+
14
+ `` TouchTracker `` allows you to display a mark on a touched point on your app with a simple setup.
15
+ Both UIKit and SwiftUI are supported.
16
+
17
+ ![ Example of TouchTracker] ( TouchTrackerExample.png )
18
+
19
+ In SwiftUI, it can be used as follows
20
+
21
+ ``` swift
22
+ Text (" Hello" )
23
+ .touchTrack ()
24
+ ```
25
+
26
+ In the case of UIKit, this can be set by adding `` TouchTrackingUIView `` to the subview as follows.
27
+
28
+ ``` swift
29
+ let v = TouchTrackingUIView ()
30
+
31
+ self .view .addSubview (v)
32
+
33
+ v.translatesAutoresizingMaskIntoConstraints = false
34
+ NSLayoutConstraint.activate ([
35
+ v.topAnchor .constraint (equalTo : window.topAnchor ),
36
+ v.bottomAnchor .constraint (equalTo : window.bottomAnchor ),
37
+ v.leftAnchor .constraint (equalTo : window.leftAnchor ),
38
+ v.rightAnchor .constraint (equalTo : window.rightAnchor ),
39
+ ])
40
+ ```
41
+
42
+ <!-- @START_MENU_TOKEN@--> Text<!-- @END_MENU_TOKEN@-->
43
+
44
+ ## Topics
45
+
46
+ ### <!-- @START_MENU_TOKEN@--> Group<!-- @END_MENU_TOKEN@-->
47
+
48
+ - <!-- @START_MENU_TOKEN@--> ``Symbol``<!-- @END_MENU_TOKEN@-->
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import UIKit
5
5
#endif
6
6
7
7
@available ( macOS, unavailable)
8
+ @available ( iOS 13 . 0 , * )
8
9
public struct TouchTrackingView < Content: View > : View {
9
10
let content : Content
10
11
@@ -85,6 +86,7 @@ public struct TouchTrackingView<Content: View>: View {
85
86
}
86
87
87
88
@available ( macOS, unavailable)
89
+ @available ( iOS 13 . 0 , * )
88
90
extension TouchTrackingView {
89
91
/// radius of mark on touched point
90
92
public func touchPointRadius( _ radius: CGFloat ) -> Self {
Original file line number Diff line number Diff line change
1
+ TARGET=' TouchTracker'
2
+ SCHEME=' TouchTracker'
3
+
4
+ clean_build () {
5
+ rm -rf ./.build
6
+ }
7
+
8
+ clean_xcbuild () {
9
+ destination=$1
10
+ xcodebuild -scheme " $SCHEME " \
11
+ -destination " generic/platform=${destination} " \
12
+ clean
13
+ }
14
+
15
+ generate_symbol_graphs () {
16
+ destination=$1
17
+
18
+ mkdir -p .build/symbol-graphs
19
+
20
+ xcodebuild -scheme ${SCHEME} \
21
+ -destination " generic/platform=${destination} " \
22
+ OTHER_SWIFT_FLAGS=" -emit-extension-block-symbols -emit-symbol-graph -emit-symbol-graph-dir ./.build/symbol-graphs"
23
+
24
+ mv " ./.build/symbol-graphs/$SCHEME .symbols.json" " ./.build/symbol-graphs/${SCHEME} _${destination} .symbols.json"
25
+ }
26
+
27
+ clean_build
28
+ clean_xcbuild ios
29
+
30
+ generate_symbol_graphs ios
31
+
32
+ $( xcrun --find docc) preview \
33
+ ./Sources/TouchTracker/TouchTracker.docc \
34
+ --additional-symbol-graph-dir .build/symbol-graphs \
35
+ --output-path " docs"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SCHEME=' TouchTracker'
4
+ REPO_NAME=' TouchTracker'
5
+
6
+ build_clean () {
7
+ destination=" $1 "
8
+
9
+ xcodebuild clean \
10
+ -destination " generic/platform=$destination " \
11
+ -scheme " $SCHEME "
12
+ }
13
+
14
+ generate_docc () {
15
+ destination=" $1 "
16
+
17
+ mkdir -p docs
18
+
19
+ xcodebuild docbuild \
20
+ -scheme " $SCHEME " \
21
+ -destination " generic/platform=$destination " \
22
+ OTHER_DOCC_FLAGS=" --transform-for-static-hosting --hosting-base-path {REPO_NAME} --output-path docs" \
23
+ OTHER_SWIFT_FLAGS=" -emit-extension-block-symbols"
24
+ # OTHER_SWIFT_FLAGS -symbol-graph-minimum-access-level private
25
+ }
26
+
27
+ build_clean ios
28
+ generate_docc ios
You can’t perform that action at this time.
0 commit comments