morizotter / touchvisualizer Goto Github PK
View Code? Open in Web Editor NEWLightweight touch visualization library in Swift. A single line of code and visualize your touches!
License: MIT License
Lightweight touch visualization library in Swift. A single line of code and visualize your touches!
License: MIT License
2015-11-23 01:21:39.759 DebugApp[57811:1002771] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DebugApp.IAdView swizzledDescription]: unrecognized selector sent to instance 0x7fa33c2f8ae0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102c4ff65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001055d1deb objc_exception_throw + 48
2 CoreFoundation 0x0000000102c5858d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000102ba5f7a ___forwarding___ + 970
4 CoreFoundation 0x0000000102ba5b28 _CF_forwarding_prep_0 + 120
5 TouchVisualizer 0x0000000101775492 _TToFE15TouchVisualizerCSo8UIWindow19swizzledDescriptionfS0_FT_SS + 50
6 iAd 0x0000000101793e89 -[ADBannerView setDelegate:] + 134
7 DebugApp 0x00000001013a3538 _TFC13DebugApp7IAdView5startfS0_FT_T_ + 248
8 DebugApp 0x0000000101316f44 _TFC13DebugApp21ArticleViewController13viewDidAppearfS0_FSbT_ + 132
9 DebugApp 0x0000000101316f81 _TToFC13DebugApp21ArticleViewController13viewDidAppearfS0_FSbT_ + 49
10 UIKit 0x0000000103cbb31d -[UIViewController _setViewAppearState:isAnimating:] + 830
11 UIKit 0x0000000103cbbca0 -[UIViewController _endAppearanceTransition:] + 262
12 UIKit 0x000000010424ebc8 -[UIPageViewController _childEndAppearanceTransition:] + 58
13 UIKit 0x000000010424eccb -[UIPageViewController _child:endAppearanceTransitionIfPossible:] + 134
14 UIKit 0x0000000104258c16 -[UIPageViewController queuingScrollView:didEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:] + 469
15 UIKit 0x0000000104329c55 -[_UIQueuingScrollView _notifyDelegateDidEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:] + 143
16 UIKit 0x000000010432a030 -[_UIQueuingScrollView setView:direction:animated:completion:] + 755
17 UIKit 0x0000000104255658 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 712
18 UIKit 0x00000001042557f5 -[UIPageViewController setViewControllers:direction:animated:completion:] + 166
19 DebugApp 0x00000001012e945a _TFC13DebugApp22ArticlesViewController11viewDidLoadfS0_FT_T_ + 3194
20 DebugApp 0x00000001012ea692 _TToFC13DebugApp22ArticlesViewController11viewDidLoadfS0_FT_T_ + 34
21 UIKit 0x0000000103cb5931 -[UIViewController loadViewIfRequired] + 1344
22 UIKit 0x0000000103cbb923 -[UIViewController __viewWillAppear:] + 120
23 UIKit 0x0000000103ceb18a -[UINavigationController _startCustomTransition:] + 1177
24 UIKit 0x0000000103cfa7c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
25 UIKit 0x0000000103cfb67d -[UINavigationController __viewWillLayoutSubviews] + 57
26 UIKit 0x0000000103e9363d -[UILayoutContainerView layoutSubviews] + 248
27 UIKit 0x0000000103bdb11c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
28 QuartzCore 0x000000010392536a -[CALayer layoutSublayers] + 146
29 QuartzCore 0x0000000103919bd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
30 QuartzCore 0x0000000103919a4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
31 QuartzCore 0x000000010390e1d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
32 QuartzCore 0x000000010393b9f0 _ZN2CA11Transaction6commitEv + 508
33 UIKit 0x0000000103b5453a _afterCACommitHandler + 174
34 CoreFoundation 0x0000000102b7b9d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
35 CoreFoundation 0x0000000102b7b947 __CFRunLoopDoObservers + 391
36 CoreFoundation 0x0000000102b7159b __CFRunLoopRun + 1147
37 CoreFoundation 0x0000000102b70e98 CFRunLoopRunSpecific + 488
38 GraphicsServices 0x0000000108046ad2 GSEventRunModal + 161
39 UIKit 0x0000000103b2a676 UIApplicationMain + 171
40 DebugApp 0x000000010125d9ed main + 109
41 libdyld.dylib 0x00000001061e692d start + 1
42 ??? 0x0000000000000007 0x0 + 7
)
libc++abi.dylib: terminating with uncaught exception of type NSException
The cause is only called from applicationDidBecomeActiveNotification:
.
How about calling in the start()
method?
Hi,
I've included the TouchVisualizer Lib in my app project. It works fine on my local system but on the build server I get this error:
Compiling Configuration.swift ❌ /Users/vagrant/git/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:189:13: unexpected platform condition (expected 'os', 'arch', or 'swift') #if targetEnvironment(simulator) ^ ▸ Compiling TouchView.swift ❌ /Users/vagrant/git/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:189:13: unexpected platform condition (expected 'os', 'arch', or 'swift') #if targetEnvironment(simulator) ^
Best regards
Marko
The new version has a preblem,use of unresoled identifier "warnIfSimulator",and UIWindow does not hav e a member named swizle,anyone konw why?and I can not find TouchVisualizer.swift?
XCText?
Hello! Can we get a quick update for xcode9/swift4 support?
It looks like all the library needs is 3 auto-correct fixes. I can PR them if you like, but they should be super fast either way.
This is a bug. Currently the touch view is sometimes under keyWindow.
Hi, could you please update this library to support swift 5? :)
In our project we are using a custom keyboard and were having difficult showing touches over it. The issue is that Visualizer always adds the TouchView to the keyWindow, but sometimes other windows are over the keyWindow.
We can fix this for our own purposes to use the topmost (as determined by windowLevel
) visible window but were wondering if there was any interest in adding that functionality to the main repo. Happy to submit a PR.
How can I get touch positions(x and y) from Visualizer?
Add this macro to radius parts not only example, but also library.
#if (arch(i386) || arch(x86_64)) && os(iOS)
#end
To display circle's border.
This is what I've done in PR #51:
Visualizer
extensions into own classes.💃
It's former TouchVisualizer. Currently I don't know how to remove it. Anyone knows how to remove it from cocoapods?
I have a triple/triple click easter egg I use to toggle this on/off. It's great for making instructional videos. I find that the first time it gets turned on, it won't take until I switch away and back to my app to start seeing this visualization. After that initial swap, it toggles on and off just fine. It's just the first activation that doesn't take without an additional application reactivation.
It is useful to show touch logs.
here's the stack
UICollectionView swizzledDescription]: unrecognized selector sent to instance 0x7f993b87b200
2016-07-25 00:19:29.932 <>[5159:3383980] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionView swizzledDescription]: unrecognized selector sent to instance 0x7f993b87b200'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107d88d85 exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001077fcdeb objc_exception_throw + 48
2 CoreFoundation 0x0000000107d91d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107cd7cfa __forwarding + 970
4 CoreFoundation 0x0000000107cd78a8 _CF_forwarding_prep_0 + 120
5 TouchVisualizer 0x00000001060cf5dc _TFE15TouchVisualizerCSo8UIWindow19swizzledDescriptionfT_SS + 28
6 TouchVisualizer 0x00000001060cf6c2 _TToFE15TouchVisualizerCSo8UIWindow19swizzledDescriptionfT_SS + 34
7 UIKit 0x00000001061e3792 -[UIScrollView description] + 49
8 UIKit 0x00000001069831ee -[UICollectionView description] + 45
9 Foundation 0x0000000105676617 _NSDescriptionWithLocaleFunc + 91
10 CoreFoundation 0x0000000107c74bdc __CFStringAppendFormatCore + 9708
11 CoreFoundation 0x0000000107d64a03 _CFStringCreateWithFormatAndArgumentsAux2 + 259
12 CoreFoundation 0x0000000107d7593a _CFLogvEx2 + 154
13 CoreFoundation 0x0000000107d75a9b _CFLogvEx3 + 171
14 Foundation 0x000000010574db1e _NSLogv + 117
15 Foundation 0x000000010569c822 NSLog + 152
16 UIKit 0x0000000106a1cd0d -[_UIFlowLayoutSection logInvalidSizesForHorizontalDirection:warnAboutDelegateValues:] + 191
17 UIKit 0x0000000106a1afe4 -[_UIFlowLayoutSection computeLayout] + 951
18 UIKit 0x00000001069c892a __56-[UICollectionViewFlowLayout _updateItemsLayoutForRect:]_block_invoke + 107
19 CoreFoundation 0x0000000107cb0d32 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
20 CoreFoundation 0x0000000107cb0422 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 194
21 UIKit 0x00000001069c87ed -[UICollectionViewFlowLayout _updateItemsLayoutForRect:] + 575
22 UIKit 0x00000001069c8c80 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 175
23 UIKit 0x00000001069c23fd -[UICollectionViewFlowLayout prepareLayout] + 273
24 UIKit 0x00000001069e2c3d -[UICollectionViewData _prepareToLoadData] + 67
25 UIKit 0x00000001069e3411 -[UICollectionViewData validateLayoutInRect:] + 53
26 UIKit 0x000000010699053a -[UICollectionView layoutSubviews] + 199
27 UIKit 0x00000001061cb980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
28 QuartzCore 0x0000000105d4dc00 -[CALayer layoutSublayers] + 146
29 QuartzCore 0x0000000105d4208e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
30 QuartzCore 0x0000000105d41f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
31 QuartzCore 0x0000000105d363c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
32 QuartzCore 0x0000000105d64086 _ZN2CA11Transaction6commitEv + 486
33 QuartzCore 0x0000000105d647f8 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
34 CoreFoundation 0x0000000107cadc37 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
35 CoreFoundation 0x0000000107cadba7 __CFRunLoopDoObservers + 391
36 CoreFoundation 0x0000000107ca37fb __CFRunLoopRun + 1147
37 CoreFoundation 0x0000000107ca30f8 CFRunLoopRunSpecific + 488
38 GraphicsServices 0x000000010a279ad2 GSEventRunModal + 161
39 UIKit 0x0000000106110f09 UIApplicationMain + 171
40 <> 0x000000010393c2c2 main + 114
41 libdyld.dylib 0x00000001087e592d start + 1
42 ??? 0x0000000000000001 0x0 + 1
)
Release version 1.2.1
(cocoapods) doesn't problem right now as far as I check. Only master branch have problem.
I'll fix it in a few days. So please watch when forked.
I feel dumb for asking this, since the instructions are so easy.
I copied the Pod folder to my project (wanted to do a manual installation). Went to the AppDelegate.swift and added Visualizer.start()
just before return true
, but i get nothing when I run the app on my device. Am i missing something obvious?
It would be great to differentiate between finger touch and Apple Pencil touch.
New xcode 11.4 update produces these errors (using latest TouchVisualizer 3.1.0 cocoapod):
<...>/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:153:13: Switch must be exhaustive
<...>/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:153:13: Do you want to add missing cases?
<...>/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:209:13: Switch must be exhaustive
<...>/Pods/TouchVisualizer/TouchVisualizer/Visualizer.swift:209:13: Do you want to add missing cases?
Changes that fix build errors, but may not be correct:
@@ -179,6 +179,10 @@
}
log(touch)
+ case .regionEntered, .regionMoved, .regionExited:
+ log(touch)
+ @unknown default:
+ log(touch)
}
}
}
@@ -212,6 +216,8 @@
case .stationary: phase = "S"
case .ended: phase = "E"
case .cancelled: phase = "C"
+ case .regionEntered, .regionMoved, .regionExited: phase = ""
+ @unknown default: phase = ""
}
let x = String(format: "%.02f", view.center.x)
I have been working on to show the touch visualizer on the video I recorded with ReplayKit but it is not showing any touch at all. What could be the problem?
Hi, how can I display touches in a SFSafariViewController that is presented programmatically from another view controller? Here is my current code:
let svc = SFSafariViewController(url: NSURL(string: self.urlString)! as URL)
svc.delegate = self
present(svc, animated: true, completion: {
Visualizer.start()
})
I also tried to start the Visualizer within a SFSafariViewControllerDelegate event handler:
func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) {
Visualizer.start()
}
… But in any case, touches aren't displayed. Any idea why? Thanks!
new tag is v1.1.2
shouldn't it be 1.1.2
earlier today and was using ~> 1.1 in my podfile and got an error when installing or updating
I enabled the TouchVisualizer directly inside the AppDelegate and nothing happens.
I am using it on an iPhone X iOS 12.
import UIKit
import TouchVisualizer
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
var config = Configuration()
config.color = UIColor.red
config.showsTimer = true
config.showsTouchRadius = true
config.showsLog = true
Visualizer.start(config)
return true
}
}
Currently, timer doesn't stop when finger leaves.
A more indepth tutorial on manual installs would be appreciated. What files am I supposed to import into my project?
Convert MZRPresentationView to pure swift object
It changes sometimes after a while to the right shape.
Hello and thanks for this framework,
Is there a Swift 3 branch on its way?
I can't use it with Xcode 8 and Swift 3 beta and Cocoapods... Or couldn't find how to.
Thanks!
I added TouchVisualizer to my app, but it crashes in some situations.
Unfortunately, XCode does not tell much about any reasons (libc++abi.dylib: terminating with uncaught exception of type NSException
).
The line where I catch the exception is the call to swizzledSendEvent
:
extension UIWindow {
@objc public func swizzledSendEvent(_ event: UIEvent) {
Visualizer.sharedInstance.handleEvent(event)
swizzledSendEvent(event)
}
}
The crash happens when tapping somewhere on the end of a table, or outside the table.
Do you have any idea what's happening here?
Best regards,
Hardy
More catchy.
tag 3.0.1 works fine.
Mmm.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.