Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from morizotter/rename-pod
Browse files Browse the repository at this point in the history
Rename pod
  • Loading branch information
morizotter committed Apr 12, 2015
2 parents 128a128 + 110827e commit 82f0866
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 51 deletions.
18 changes: 9 additions & 9 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import UIKit
import MZRPresentationKit
import TouchVisualizer

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -17,14 +17,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

// Initialization with default values
MZRPresentation.start()

// // Initialize with config
// var config = MZRPresentationConfig()
// config.color = UIColor.redColor()
// config.showsTimer = true
// MZRPresentation.start(config)
// // Initialization with default values
// TouchVisualizer.start()

// Initialize with config
var config = TouchVisualizerConfig()
config.color = UIColor.redColor()
config.showsTimer = true
TouchVisualizer.start(config)

return true
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'Example', :exclusive => true do
pod "MZRPresentationKit", :path => "../"
pod "TouchVisualizer", :path => "../"
end

target 'ExampleTests', :exclusive => true do
pod "MZRPresentationKit", :path => "../"
pod "TouchVisualizer", :path => "../"
end
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PODS:
- MZRPresentationKit (1.0.3)
- TouchVisualizer (1.1.0)

DEPENDENCIES:
- MZRPresentationKit (from `../`)
- TouchVisualizer (from `../`)

EXTERNAL SOURCES:
MZRPresentationKit:
TouchVisualizer:
:path: "../"

SPEC CHECKSUMS:
MZRPresentationKit: 4bd6bad8bd8ea1c371753294865ee1c8d89cc6a7
TouchVisualizer: c9087ec9a7207a28e63934c3f423ac98bde97bb9

COCOAPODS: 0.36.3
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import UIKit

final public class MZRTouchView: UIImageView {
final public class TouchView: UIImageView {

// MARK: - Properties

weak var touch: UITouch?
private var config: MZRPresentationConfig
private var config: TouchVisualizerConfig
private var startDate: NSDate?
private weak var timer: NSTimer?
private var lastTimeString: String!
Expand All @@ -36,7 +36,7 @@ final public class MZRTouchView: UIImageView {

// MARK: - Life cycle

convenience init(config: MZRPresentationConfig) {
convenience init(config: TouchVisualizerConfig) {
self.init(frame: CGRectMake(0.0, 0.0, 60.0, 60.0))
self.config = config
self.image = self.config.image
Expand All @@ -46,7 +46,7 @@ final public class MZRTouchView: UIImageView {
}

override init(frame: CGRect) {
self.config = MZRPresentationConfig()
self.config = TouchVisualizerConfig()
super.init(frame: frame)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

import UIKit

final public class MZRPresentation {
private var config: MZRPresentationConfig!
private var touchViews = [MZRTouchView]()
final public class TouchVisualizer {

class func sharedInstance() -> MZRPresentation {
private var config: TouchVisualizerConfig!
private var touchViews = [TouchView]()

class func sharedInstance() -> TouchVisualizer {
struct Static {
static let instance : MZRPresentation = MZRPresentation()
static let instance : TouchVisualizer = TouchVisualizer()
}
return Static.instance
}
Expand All @@ -34,7 +35,7 @@ final public class MZRPresentation {
}

@objc func orientationDidChangeNotification(notification: NSNotification) {
let instance = MZRPresentation.sharedInstance()
let instance = TouchVisualizer.sharedInstance()
for touch in instance.touchViews {
touch.removeFromSuperview()
}
Expand All @@ -43,15 +44,15 @@ final public class MZRPresentation {
// MARK: - Methods

public class func start() {
self.start(MZRPresentationConfig())
self.start(TouchVisualizerConfig())
}

public class func start(config: MZRPresentationConfig) {
public class func start(config: TouchVisualizerConfig) {
let instance = self.sharedInstance()
instance.config = config
if let window = UIApplication.sharedApplication().keyWindow {
for subview in window.subviews {
if (subview as? MZRTouchView != nil) {
if (subview as? TouchView != nil) {
subview.removeFromSuperview()
}
}
Expand All @@ -65,8 +66,8 @@ final public class MZRPresentation {
}
}

private func dequeueTouchView() -> MZRTouchView {
var touchView: MZRTouchView?
private func dequeueTouchView() -> TouchView {
var touchView: TouchView?
for view in self.touchViews {
if view.superview == nil {
touchView = view
Expand All @@ -75,14 +76,14 @@ final public class MZRPresentation {
}

if touchView == nil {
touchView = MZRTouchView(config: self.config)
touchView = TouchView(config: self.config)
self.touchViews.append(touchView!)
}

return touchView!
}

private func findTouchView(touch: UITouch) -> MZRTouchView? {
private func findTouchView(touch: UITouch) -> TouchView? {
for view in self.touchViews {
if view.touch == touch {
return view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct MZRPresentationConfig {
public struct TouchVisualizerConfig {
public var color: UIColor = {
UIColor(red: 52/255.0, green: 152/255.0, blue: 219/255.0, alpha: 0.8)
}()
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/UIWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension UIWindow {
}

func swizzledSendEvent(event: UIEvent) {
MZRPresentation.sharedInstance().handleEvnet(event)
TouchVisualizer.sharedInstance().handleEvnet(event)
self.swizzledSendEvent(event)
}

Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# MZRPresentationKit
# TouchVisualizer

[![Version](https://img.shields.io/cocoapods/v/MZRPresentationKit.svg?style=flat)](http://cocoadocs.org/docsets/MZRPresentationKit)
[![License](https://img.shields.io/cocoapods/l/MZRPresentationKit.svg?style=flat)](http://cocoadocs.org/docsets/MZRPresentationKit)
[![Platform](https://img.shields.io/cocoapods/p/MZRPresentationKit.svg?style=flat)](http://cocoadocs.org/docsets/MZRPresentationKit)
[![Version](https://img.shields.io/cocoapods/v/TouchVisualizer.svg?style=flat)](http://cocoadocs.org/docsets/TouchVisualizer)
[![License](https://img.shields.io/cocoapods/l/TouchVisualizer.svg?style=flat)](http://cocoadocs.org/docsets/TouchVisualizer)
[![Platform](https://img.shields.io/cocoapods/p/TouchVisualizer.svg?style=flat)](http://cocoadocs.org/docsets/TouchVisualizer)

## Let's give a presentation with finger points easily

![Gif](https://github.com/morizotter/MZRPresentationKit/blob/master/presentation.gif)
![Gif](https://github.com/morizotter/TouchVisualizer/blob/master/presentation.gif)

When you give a presentation, your finger points are visible on screen.
- Multiple fingers supported.
Expand All @@ -16,7 +16,7 @@ When you give a presentation, your finger points are visible on screen.
## Installation

> Embedded frameworks require a minimum deployment target of iOS 8.1
> To use MZRPresentationKit with a project targeting iOS 8.0 or lower, you must include the MZRPresentationKit.swift source file directly in your project.
> To use TouchVisualizer with a project targeting iOS 8.0 or lower, you must include the TouchVisualizer.swift source file directly in your project.
[CocoaPods](http://cocoapods.org) 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

Expand All @@ -33,27 +33,31 @@ platform :ios, '8.1'
use_frameworks!
pod "MZRPresentationKit", '~>1.0.3'
pod "TouchVisualizer", '~>1.0.3'
```

## Usage

`import MZRPresentationKit` and just write the following line in the `application(application:didFinishLaunchingWithOptions:)` in `AppDelegate`.
`import TouchVisualizer` and just write the following line in the `application(application:didFinishLaunchingWithOptions:)` in `AppDelegate`.

```
MZRPresentation.start()
TouchVisualizer.start()
```

You can change colors and images like this. You can set only color or image.

```
MZRPresentation.start(UIColor.redColor(), image: UIImage(named: "YOUR-IMAGE"))
var config = TouchVisualizerConfig()
config.color = UIColor.redColor()
config.image = UIImage(named: "YOUR-IMAGE")
config.showsTimer = true
TouchVisualizer.start(config)
```

You can stop presentation from the app like this.

```
MZRPresentation.stop()
TouchVisualizer.stop()
```

## Requirements
Expand All @@ -67,5 +71,5 @@ Naoki Morita, [email protected], [page](http://moritanaoki.org)

## License

MZRPresentationKit is available under the MIT license. See the LICENSE file for more info.
TouchVisualizer is available under the MIT license. See the LICENSE file for more info.

10 changes: 5 additions & 5 deletions MZRPresentationKit.podspec → TouchVisualizer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
#

Pod::Spec.new do |s|
s.name = "MZRPresentationKit"
s.version = "1.0.3"
s.name = "TouchVisualizer"
s.version = "1.1.0"
s.summary = "When you give a presentation, your finger points are visible on screen."
s.description = <<-DESC
# Give a presentation more impressive with finter points.
When you give a presentation, your finger points are visible on screen.
TouchVisualizer is a new version of MZRPresentationKit
- Multiple fingers supported.
- Multiple UIWindows supported.
- You can change colors and images of finger points.
DESC
s.homepage = "https://github.com/morizotter/MZRPresentationKit"
s.homepage = "https://github.com/morizotter/TouchVisualizer"
s.license = 'MIT'
s.author = { "Naoki Morita" => "[email protected]" }
s.source = { :git => "https://github.com/morizotter/MZRPresentationKit.git", :tag => s.version.to_s }
s.source = { :git => "https://github.com/morizotter/TouchVisualizer.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/morizotter'

s.platform = :ios, '8.1'
Expand Down

0 comments on commit 82f0866

Please sign in to comment.