GithubHelp home page GithubHelp logo

mapbox / fingertips Goto Github PK

View Code? Open in Web Editor NEW
819.0 134.0 94.0 3.26 MB

Touch indicators on external displays for iOS applications.

License: BSD 3-Clause "New" or "Revised" License

Ruby 8.66% Swift 91.34%

fingertips's Introduction

Fingertips

FOSSA Status

Presentation mode for your iOS app

Fingertips is a small library (one class) meant for presentations from iOS devices that shows all touches and gestures so that the audience can see them.

This library does not do the mirroring or screen recording for you!

Just drop in our replacement UIWindow subclass and your app will automatically determine when you are in the screen recording or an external screen is available. It will show every touch on-screen with a nice partially-transparent graphic that automatically fades out when the touch ends.

If you are using storyboards, the easiest way to integrate Fingertips is to override the window method of your application delegate like this:

// AppDelegate.m

- (UIWindow *)window {
    if (!_window) {
        _window = [[MBFingerTipWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }
    return _window;
}
// AppDelegate.swift (Swift)

var window: UIWindow? = FingerTipWindow(frame: UIScreen.main.bounds)

For iOS 13+ with UISceneDelegate:

var windows: [UIWindow] = []

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = scene as? UIWindowScene else { return }

    let window = FingerTipWindow(windowScene: windowScene)

    window.rootViewController = // Your root view controller
    window.makeKeyAndVisible()

    windows.append(window)
}

Fingertips require iOS 11.0 or greater and ARC. It uses no private API and is safe for App Store submissions.

demo.mp4

Configuration

You shouldn't need to configure anything, but if you want to tweak some knobs:

  • touchImage: pass a UIImage to use for showing touches
  • touchAlpha: change the visible-touch alpha transparency
  • fadeDuration: change how long lifted touches fade out
  • strokeColor: change default touchImage stroke color (defaults to black)
  • fillColor: change default touchImage fill color (defaults to white)

If you ever need to debug Fingertips, just set the DEBUG_FINGERTIP_WINDOW environment variable to YES in Xcode or set the runtime property alwaysShowTouches to YES.

License

Copyright (c) 2011-2023 Mapbox, Inc.

The Fingertips library should be accompanied by a LICENSE file. This file contains the license relevant to this distribution. If no license exists, please contact Mapbox.

FOSSA Status

fingertips's People

Contributors

0xced avatar 1ec5 avatar airingursb avatar correia avatar datalogics-kam avatar defagos avatar fossabot avatar incanus avatar julianrex avatar junjie avatar koenpunt avatar mdiep avatar odnairy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fingertips's Issues

New warning in Xcode 11.4: Missing switch cases

/Users/xxxx/Projekte/Apps/xxx/Pods/Fingertips/MBFingerTipWindow.m:217:21: Enumeration values 'UITouchPhaseRegionEntered', 'UITouchPhaseRegionMoved', and 'UITouchPhaseRegionExited' not handled in switch

FingerTipWindow is not overridable

Hello,

FingerTipWindow is not overridable, as it is declared as public class, and not as open class.

Please, give us possibility to override FingerTipWindow and add our logics to there.

Best,
Giorgi

Screenshot

A screenshot or animated GIF in the README would be helpful.

Can it work in a swift project?

In the appDelegate's didFinishLaunchingWithOptions, I tried setting the window property but no luck (Executing the code below, my app landed on a black screen after the splash and that was it - not sure where to go from there)

class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  //...
  window = MBFingerTipWindow(frame:UIScreen.mainScreen().bounds)
  //...
}

`v0.6.0` tag is not parsed by Swift Package Manager

When I add the URL https://github.com/mapbox/Fingertips as a dependency in Xcode, I cannot specify version 0.6.0 because the tag is not parsed by Xcode (it doesn't like the "v").

In this attached screenshot, notice how the highest version it shows is 0.4.0, because that's the highest tag it can parse.

Screenshot 2023-11-26 at 8 32 01 PM

Doesn't work with Carthage

We're trying to use this with Carthage and when we execute carthage update nothing gets built. Upon further inspection, it appears that the project file is not brought down. Any ideas?

Support QuickTime recording

Could you please add support for QuickTime recording?

Apparently it's possible to detect if the phone screen is being recorded using the following technique:
link

Not working when connecting to MacBook with lightning cable.

Fingertips works well when I project the phone screen to AppleTV using AirPlay.
But when I connect the phone to Mac with Lightning cable, it doesn't work.
I have to set alwaysShowTouches as true, then I can see the fingertips, but it always shows.

Can you fix this?

And, can you add enable/disable API to turn on/off the fingertips even when connected to AirPlay?

Thanks.

Finger

// AppDelegate.m

  • (UIWindow *)window {
    if (!_window) {
    _window = [[MBFingerTipWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }
    return _window;
    }
    // AppDelegate.swift (Swift 2)

var window: UIWindow? = MBFingerTipWindow(frame: UIScreen.mainScreen().bounds)
// AppDelegate.swift (Swift 3)

var window: UIWindow? = MBFingerTipWindow(frame: UIScreen.main.bounds)

Xcode 8.3.3 warning due to targeting iOS 5.0

Expected behavior

No warnings when building an Xcode project that uses CocoaPods to depend on Fingertips.

Observed behavior

Xcode displays a "Buildtime" warning on Pods.xcodeproj stating "Update to recommended settings". Clicking on the warning displays a view with an issue in Fingertips: "An iOS Deployment Target earlier than 8.0 is not supported by this version of Xcode. This will update the value for Target 'Fingertips' to '8.0'."

Steps to reproduce

Add pod 'Fingertips' to your Podfile
Run pod install
Load your Xcode project and build

Version

Xcode 8.3.3
Fingertips 0.5.0

Add instructions on how to enable the class

In AppDelegate.m import the following class:

import <Fingertips/MBFingerTipWindow.h>

Add the following method:
//Used for showing touches

  • (MBFingerTipWindow *)window
    {
    static MBFingerTipWindow *visualFeedbackWindow = nil;
    if (!visualFeedbackWindow) visualFeedbackWindow = [[MBFingerTipWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    return visualFeedbackWindow;
    }

AlwaysShowFingertips isn't working

setting alwaysShowFingerTips to true doesn't seem to be working. I set it to true immediately after creating the window and never saw any fingertips.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.