Code Monkey home page Code Monkey logo

clip's Introduction

Clip

Clip is a clipboard manager for iOS that can monitor your clipboard indefinitely in the background — no jailbreak required.

Swift Version License: Unlicense PRs Welcome

Clip is a simple clipboard manager for iOS. Unlike other clipboard managers available in the App Store, Clip is able to monitor your clipboard indefinitely in the background. This is accomplished through a combination of hacks and workarounds, none of which would pass App Store review. For that reason, Clip is only available to download through AltStore — my alternative app store for non-jailbroken devices — or by compiling the source code yourself.

Features

  • Runs silently in the background, monitoring your clipboard the whole time.
  • Save text, URLs, and images copied to the clipboard.
  • Copy, delete, and share clippings.
  • Customizable history limit.

Requirements

  • Xcode 11
  • iOS 13
  • Swift 5+

Project Overview

All things considered, Clip is a very simple app. The core app target can be mentally divided up into UI and logic, while each additional target serves a specific role.

App UI

The entire UI is implemented with just two view controllers:

HistoryViewController
The main screen of Clip. A relatively straightforward UITableViewController subclass that fetches recent clippings from Clip’s persistent store and displays them in a table view.

SettingsViewController
The settings screen for Clip. Another UITableViewController subclass that displays all Clip settings in a list, but is presented as a popover due to limited number of settings.

App Logic

The app logic for Clip is relatively straightforward. Most is self-explanatory, but there are two classes that serve particularly important roles:

PasteboardMonitor
As you might have guessed from the name, this class is in charge of listening for changes to the clipboard. Since UIPasteboardChangedNotification is only received when the app is in the foreground, this class uses the private Pasteboard.framework to start sending system-wide Darwin notifications whenever the clipboard’s contents change. Once a change is detected, PasteboardMonitor presents a local notification that can be expanded by the user to save their clipboard to Clip.

ApplicationMonitor
This class manages the lifecycle of Clip. Specifically, it is in charge of playing a silent audio clip on loop so Clip can run indefinitely in the background, as well as presenting a local notification whenever Clip stops running (for whatever reason).

ClipKit

ClipKit is a shared framework that includes common code between Clip, ClipboardReader, and ClipBoard. Notably, it contains all model + Core Data logic, so that Clip and each app extension can access the same persistent store with all clippings.

ClipboardReader

ClipboardReader is a Notification Content app extension used to read the clipboard while Clip is running in the background. When Clip detects a change to the clipboard, it will present a local notification. If this notification is expanded, ClipboardReader will be launched and save the contents of the clipboard to disk before dismissing the now-expanded notification.


ClipboardReader in action.

ClipBoard

ClipBoard is a Custom Keyboard app extension that provides quick access to your recent clippings when editing text. This feature is still being worked on, so it is only available in beta versions of Clip for now.

Roxas

Roxas is my internal framework used across all my iOS projects, developed to simplify a variety of common tasks used in iOS development. For more info, check the Roxas repo.

Compilation Instructions

Clip is very straightforward to compile and run if you're already an iOS developer. To compile Clip:

  1. Clone the repository
    https://github.com/rileytestut/Clip.git
    
  2. Update submodules:
    cd Clip 
    git submodule update --init --recursive
    
  3. Open Clip.xcworkspace and select the Clip project in the project navigator. On the Signing & Capabilities tab, change the team from Yvette Testut to your own account.
  4. Build + run app! 🎉

Licensing

Unlike my other projects, Clip uses no 3rd party dependencies. This gives me complete freedom to choose the license I want, so I’m choosing to release the complete Clip source code into the public domain. You can view the complete “unlicense” here, but the gist is:

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

Contact Me

clip's People

Contributors

rileytestut 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

clip's Issues

Can’t install Clip

AltStore can’t install Clip.
AltStore works just fine with other apps.
Except for Clip

Opening the app pauses audio

Hi @rileytestut

Launching the app for some reason pauses audio. For example if I got something playing on Spotify, launching the app pauses the audio.

App installed via AltStore.
Version: 1.0

Only works on iOS 13.5

Do you plan on keeping this for iOS 13.5+ or will you be making it available for more iOS versions? I’m currently on 13.3. If there is an ipa that I could just side load with AltStore or ReProvision that would work as well.

⸂𝖶𝖩𝖣 .

This script reproduces, in sequence, the results and examples

in the accompannying paper. (Please note that a full run of the

script may take between a few hours and a day to run depending

on the computer.)

Package version information:

A3 0.9.2

e1071 1.6-1

randomForest 4.6-7

xtable 1.7-1

pbapply 1.0-5

R 2.15.2 OS X 64 bit

Due to the usage of stochasticity in the A3 method, minor

differences in results may be obtained if different versions of

packages are used. These differences will be minor and not

affect overall conclusions.

Each block represents an output (either a table or a figure) in

the original paper. Blocks are sequential as the results appear

in the paper.

set.seed(1)
library("A3")
print(a3(formula = rating ~ ., data = attitude, model.fn = lm))

library("e1071")
print(a3(rating ~ . + 0, attitude, svm))

library("randomForest")
out.rf <- a3(rating ~ . + 0, attitude, randomForest, p.acc = 0.05)
print(out.rf)

print(a3(rating ~ . + 0, attitude, randomForest, p.acc = 0.05, model.args = list(ntree = 1000)))

print(out.rf)

plotPredictions(out.rf)

plotSlopes(out.rf)

data("housing", package = "A3")
reg <- lm(MED.VALUE ~ AGE + ROOMS + NOX + PUPIL.TEACHER + HIGHWAY, housing)
print(summary(reg))

NOTE: this may take 2 hours+; this data is cached in a file in data/ for article generation

housing.lm <- a3.lm(MED.VALUE ~ AGE +ROOMS + NOX + PUPIL.TEACHER + HIGHWAY, housing,
p.acc = 0.01, n.folds = 50)
print(housing.lm)

NOTE: this may take 2 hours+; this data is cached in a file in data/ for article generation

housing.svm <- a3(MED.VALUE ~ AGE +ROOMS + NOX + PUPIL.TEACHER + HIGHWAY+0, housing, svm,
p.acc = 0.01, n.folds = 50)
housing.rf <- a3(MED.VALUE ~ AGE +ROOMS + NOX + PUPIL.TEACHER + HIGHWAY+0, housing, randomForest,
p.acc = 0.01, n.folds = 50)

print(housing.svm)
print(housing.rf)

plotSlopes(housing.rf)

NOTE: this may take 2 hours+; this data is cached in a file in data/ for article generation

data("multifunctionality", package = "A3")
reg <- lm(MUL ~ SR + SLO + SAC + PCA_C1 + PCA_C2 + PCA_C3 + PCA_C4 + LAT + LONG + ELE,
multifunctionality)
print(summary(reg))

NOTE: this may take 2 hours+; this data is cached in a file in data/ for article generation

mult.lm <- a3.lm(MUL ~ SR + SLO + SAC + PCA_C1 + PCA_C2 + PCA_C3 + PCA_C4 + LAT + LONG + ELE,
multifunctionality, p.acc = 0.01, n.folds = 50)
print(mult.lm)

NOTE: this may take 2 hours+; this data is cached in a file in data/ for article generation

mult.rf <- a3(MUL ~ SR + SLO + SAC + PCA_C1 + PCA_C2 + PCA_C3 + PCA_C4 + LAT + LONG + ELE + 0,
multifunctionality, randomForest, p.acc = 0.01, n.folds = 50)
print(mult.rf)

set.seed(1)
createAutoCorrelatedSeries <- function(n, r) {
dat <- rnorm(n, 0, 1)
for(i in 2:n) dat[i] <- dat[i-1]r + dat[i](1-r)
dat
}
sample <- data.frame(x = createAutoCorrelatedSeries(100, 0.95),
y = createAutoCorrelatedSeries(100, 0.95))
reg <- lm(y ~ x, sample)
print(summary(reg))

Keep seeing App Stopped Running notification

Am i the only one having this problem? From time to time i keep seeing this notification

App Stopped Running
Tap this notification to resume monitoring your clipboard

Tap on the notification switches to app but the moment it goes to background the notification pops up again.

Any tips?

Crash on iOS 17

Currently app crashes upon launch. Please update to support iOS 17, thank you.

Copying not working

When you swipe down on the notification you get an option to allow paste or not, and no matter what you select it will fail to clip it. Happens on messages, safari.

Can't get Clip to work

I installed Clip to my iPhone 15 Pro (running iOS 17.5 beta) the other day, and I cannot get it to work correctly. When I copy some text, I get the notification telling me to swipe down to save the text. Swiping down on the notification, however, just brings the notification up on the screen. If I swipe it again, the notification goes away, but the text isn't actually saved. The only way to save the copied text is to tap on the notification to open Clip. Am I doing something wrong, is there some sort of incompatibility with the 17.5 beta, or is it something else entirely?

Document switching from silent audio to background location

I was looking to implement similar funtionality in my app, and was confused because I couldn't find any code for playing audio. I then saw commit 6af8056, which changed it to background location. Could you document this in the README? Specifically, this part:

ApplicationMonitor
This class manages the lifecycle of Clip. Specifically, it is in charge of playing a silent audio clip on loop so Clip can run indefinitely in the background, as well as presenting a local notification whenever Clip stops running (for whatever reason).

Support for files

Could you add support for pasting files in PAL version? Yoink can do it so I guess it should be possible.

Compilation Instructions unclear

I tried compiling this but I'm getting some errors. For one, there is no .xcworkspace file after step 2, only .xcproject. Am I overlooking?

I got the below error also before I changed the bundle identifiers to be uniquely mine.

image

Compilation Errors

After following the instructions, I am getting these errors. Help would be appreciated.

Screen Shot 2022-05-20 at 6 28 37 PM

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.