68 Commits

Author SHA1 Message Date
Ramotion 0ee6532f9d Update README.md 2020-04-06 09:55:24 +03:00
igor.k 074e5746a6 add SPM config 2019-11-12 16:27:11 +03:00
Ramotion 96f767841b Update README.md 2019-10-12 21:12:01 +03:00
Alex K b6482d0154 bump version 2019-04-03 15:35:18 +03:00
Alex K 400db74caa converted to swift 5 2019-04-03 15:31:30 +03:00
Ramotion e5874511b8 Update README.md 2018-12-29 15:45:27 +03:00
Ramotion ec14608847 Update README.md 2018-12-10 12:11:50 +03:00
Alex K 644d652ae7 swift 4.2 2018-09-27 09:13:51 +03:00
Ramotion c6fd46ce2e Update README.md 2018-06-29 14:26:25 +03:00
Ramotion e1317b3203 Update README.md 2018-06-26 11:13:18 +03:00
Ramotion cac730d7df Update README.md 2018-05-29 11:51:53 +03:00
Ramotion afb8443639 Update README.md 2018-04-26 18:08:44 +03:00
Ramotion 772ead7101 Add files via upload 2018-04-26 08:07:20 -07:00
Ramotion 39ed4afbe3 Update README.md 2018-04-24 09:18:59 +03:00
Ramotion 412de61727 Update README.md 2018-03-12 11:00:06 +03:00
Alex Mikhnev be0361f045 Update README.md 2018-02-21 14:55:37 +03:00
i.kolpachkov 2cac5d0664 remove .DS_Store from index 2018-01-18 13:29:18 +03:00
i.kolpachkov dd0e87e3a1 update .gitignore file 2018-01-18 13:27:00 +03:00
Alex K 4647af5d87 update readme 2017-10-27 09:52:35 +03:00
Alex 8ba2eb261e Merge pull request #22 from hammadzz/swift_4
Swift 4 Support
2017-10-27 09:42:28 +03:00
Hammad 8c14dc8c10 Changed podspec version to 2.1.0 2017-10-26 20:28:25 -04:00
Hammad 762fde2a93 Fixes for Swift 4.0 2017-10-26 20:14:02 -04:00
Travis CI 8de3e7832e reorganize readme 2017-07-28 12:10:43 +03:00
Alex 2257016544 Update README.md 2017-06-27 11:52:16 +03:00
Alex K d6166c1c4e Fixes #19 2017-05-02 14:13:21 +03:00
Juri Vasylenko 388baf9a63 Update README.md 2017-04-05 19:57:37 +03:00
Juri Vasylenko d064819ec0 Update README.md 2017-04-05 19:57:05 +03:00
Juri Vasylenko db38ad1687 Update README.md 2017-04-05 19:56:52 +03:00
Alex Mikhnev 8440de329b Update README.md 2017-03-10 19:55:58 +03:00
Juri Vasylenko ac50a115ae Update README.md 2017-02-17 17:58:41 +03:00
Juri Vasylenko 40afc937cd Update README.md 2017-01-20 16:11:29 +03:00
aleksei1000000 1aaaa3769f Update README.md 2017-01-10 17:13:11 +03:00
Alex.k 791238e402 updated readme 2016-12-14 10:45:49 +03:00
Alex.k ef52d5a09e podspec updated 2016-12-14 10:45:03 +03:00
Alex.k 9c78c75046 fixed bug with position 2016-12-14 10:43:41 +03:00
Alex.k 6d2380f065 updated podspec and readme 2016-12-14 09:48:45 +03:00
Alex.k 2c039420a0 made parentView open 2016-12-14 09:45:43 +03:00
aleksei1000000 9f42265ce4 Update README.md 2016-10-17 10:01:13 +03:00
aleksei1000000 75f7b8b8a6 Update README.md 2016-10-14 14:41:00 +03:00
aleksei1000000 1aca7f9b00 Update README.md 2016-10-14 14:06:39 +03:00
Alex.k 27189bd7e2 updated readme 2016-10-13 14:49:39 +03:00
Alex.k 269a4a0036 updated settings 2016-10-13 14:45:52 +03:00
Alex.k 779c80b2f5 Merge branch 'master' of https://github.com/Ramotion/paper-switch 2016-10-13 14:29:03 +03:00
Alex.k 9bd7a42e2f update settings 2016-10-13 14:28:58 +03:00
aleksei1000000 db7ba38c71 Update README.md 2016-09-29 17:10:37 +03:00
Alex.k 937322b2b6 update readme 2016-09-23 10:13:42 +03:00
Alex 49f20d102e Merge pull request #18 from devladinci/swift3
Swift 3
2016-09-23 10:05:09 +03:00
DeVladinci 14706d4c63 Update travis to use xcode 8 2016-09-15 12:55:02 +03:00
DeVladinci 0edb81cb04 Swift3 2016-09-15 12:49:04 +03:00
Juri Vasylenko 3d6e2725ca Update README.md 2016-08-05 12:11:42 +04:00
Juri Vasylenko 1c3e087757 Update README.md 2016-07-29 16:13:56 +04:00
Juri Vasylenko 39611a59d6 Merge pull request #17 from aleksei1000000/patch-1
Update README.md
2016-07-21 15:41:46 +04:00
aleksei1000000 472f71fa70 Update README.md 2016-07-21 14:30:44 +03:00
aleksei1000000 e087ecc7c5 Update README.md 2016-07-21 12:19:14 +03:00
Alex.k a422ef87f9 update docs 2016-06-10 11:17:35 +03:00
Alex.k b668082bf1 remove docs 2016-06-10 11:16:43 +03:00
Alex.k 8de1c4c77c update docs 2016-06-10 11:10:06 +03:00
Alex.k 78f2d7077d update docs 2016-06-10 11:06:06 +03:00
Alex.k dc804d1f2a update readme 2016-06-07 12:15:11 +03:00
Alex.k 690315178b update readme 2016-06-07 12:10:32 +03:00
Alex.k b521e21851 added docs 2016-06-07 12:06:37 +03:00
Alex 72c3ed1e37 Update README.md 2016-06-02 16:36:31 +03:00
Alex.k 4dd0ef0342 update readme 2016-06-01 17:19:09 +03:00
Alex.k 693e5d0645 update readme 2016-06-01 17:16:32 +03:00
Alex.k d97f564422 update podspec 2016-06-01 16:58:04 +03:00
Alex.k 58e2424f91 fixed crash 2016-06-01 16:55:54 +03:00
Alex.k c4602436d1 shared scheme 2016-06-01 14:59:25 +03:00
Alex.k 3c736ff8c0 update pods 2016-05-31 12:52:03 +03:00
44 changed files with 2848 additions and 473 deletions
+46 -5
View File
@@ -1,6 +1,12 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
@@ -9,18 +15,53 @@ build/
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
xcuserdata/
## Other
*.moved-aside
DerivedData
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.xcuserstate
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
+2 -2
View File
@@ -1,6 +1,6 @@
osx_image: xcode7.2
osx_image: xcode8
language: objective-c
xcode_project: PaperSwitchDemo/PaperSwitchDemo.xcodeproj
xcode_scheme: PaperSwitchDemo
xcode_scheme: PaperSwitch
xcode_sdk: iphonesimulator
+43
View File
@@ -0,0 +1,43 @@
// swift-tools-version:5.1
//
// Package.swift
//
// Copyright (c) Ramotion (https://www.ramotion.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import PackageDescription
let package = Package(
name: "PaperSwitch",
platforms: [
.iOS(.v9)
],
products: [
.library(name: "PaperSwitch",
targets: ["PaperSwitch"]),
],
targets: [
.target(name: "PaperSwitch",
path: "PaperSwitch")
],
swiftLanguageVersions: [.v5]
)
+172 -169
View File
@@ -22,179 +22,182 @@
import UIKit
public class RAMPaperSwitch: UISwitch {
struct Constants {
static let scale = "transform.scale"
static let up = "scaleUp"
static let down = "scaleDown"
}
@IBInspectable var duration: Double = 0.35
var animationDidStartClosure = {(onAnimation: Bool) -> Void in }
var animationDidStopClosure = {(onAnimation: Bool, finished: Bool) -> Void in }
private var shape: CAShapeLayer! = CAShapeLayer()
private var radius: CGFloat = 0.0
private var oldState = false
/// Swift subclass of the UISwitch which paints over the parent view with the onTintColor when the switch is turned on.
open class RAMPaperSwitch: UISwitch, CAAnimationDelegate {
private var defaultTintColor: UIColor?
private var parentView: UIView?
override public var on: Bool {
didSet(oldValue) {
oldState = on
struct Constants {
static let scale = "transform.scale"
static let up = "scaleUp"
static let down = "scaleDown"
}
/// The total duration of the animations, measured in seconds. Default 0.35
@IBInspectable open var duration: Double = 0.35
/// Closuer call when animation start
open var animationDidStartClosure = {(onAnimation: Bool) -> Void in }
/// Closuer call when animation finish
open var animationDidStopClosure = {(onAnimation: Bool, finished: Bool) -> Void in }
fileprivate var shape: CAShapeLayer! = CAShapeLayer()
fileprivate var radius: CGFloat = 0.0
fileprivate var oldState = false
fileprivate var defaultTintColor: UIColor?
@IBOutlet open var parentView: UIView? {
didSet {
defaultTintColor = parentView?.backgroundColor
}
}
// MARK: - Initialization
/**
Returns an initialized switch object.
- parameter view: animatable view
- parameter color: The color which fill view.
- returns: An initialized UISwitch object.
*/
public required init(view: UIView?, color: UIColor?) {
super.init(frame: CGRect.zero)
onTintColor = color
self.commonInit(view)
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override open func awakeFromNib() {
self.commonInit(parentView ?? superview)
super.awakeFromNib()
}
// MARK: Helpers
fileprivate func commonInit(_ parentView: UIView?) {
guard let onTintColor = self.onTintColor else {
fatalError("set tint color")
}
self.parentView = parentView
defaultTintColor = parentView?.backgroundColor
layer.borderWidth = 0.5
layer.borderColor = UIColor.white.cgColor
layer.cornerRadius = frame.size.height / 2
shape.fillColor = onTintColor.cgColor
shape.masksToBounds = true
parentView?.layer.insertSublayer(shape, at: 0)
parentView?.layer.masksToBounds = true
showShapeIfNeed()
addTarget(self, action: #selector(RAMPaperSwitch.switchChanged), for: UIControl.Event.valueChanged)
}
override open func layoutSubviews() {
if let parentView = self.parentView {
let x:CGFloat = max(center.x, parentView.frame.size.width - frame.midX)
let y:CGFloat = max(center.y, parentView.frame.size.height - frame.midY)
radius = sqrt(x*x + y*y)
}
let additional = parentView == superview ? CGPoint.zero : (superview?.frame.origin ?? CGPoint.zero)
shape.frame = CGRect(x: center.x - radius + additional.x - 2, y: center.y - radius + additional.y, width: radius * 2, height: radius * 2)
shape.anchorPoint = CGPoint(x: 0.5, y: 0.5)
shape.path = UIBezierPath(ovalIn: CGRect(x: 0, y: 0, width: radius * 2, height: radius * 2)).cgPath
}
// MARK: - Public
open override func setOn(_ on: Bool, animated: Bool) {
let changed:Bool = on != self.isOn
super.setOn(on, animated: animated)
if changed {
switchChangeWithAnimation(animated)
}
}
// MARK: - Private
fileprivate func showShapeIfNeed() {
shape.transform = isOn ? CATransform3DMakeScale(1.0, 1.0, 1.0) : CATransform3DMakeScale(0.0001, 0.0001, 0.0001)
}
@objc internal func switchChanged() {
switchChangeWithAnimation(true)
}
// MARK: - Animations
fileprivate func animateKeyPath(_ keyPath: String, fromValue from: CGFloat?, toValue to: CGFloat, timing timingFunction: String) -> CABasicAnimation {
let animation:CABasicAnimation = CABasicAnimation(keyPath: keyPath)
animation.fromValue = from
animation.toValue = to
animation.repeatCount = 1
animation.timingFunction = CAMediaTimingFunction(name: convertToCAMediaTimingFunctionName(timingFunction))
animation.isRemovedOnCompletion = false
animation.fillMode = CAMediaTimingFillMode.forwards
animation.duration = duration
animation.delegate = self
return animation
}
fileprivate func switchChangeWithAnimation(_ animation: Bool) {
guard let onTintColor = self.onTintColor else {
return
}
shape.fillColor = onTintColor.cgColor
if isOn {
let scaleAnimation:CABasicAnimation = animateKeyPath(Constants.scale,
fromValue: 0.01,
toValue: 1.0,
timing:convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn));
if animation == false { scaleAnimation.duration = 0.0001 }
shape.add(scaleAnimation, forKey: Constants.up)
} else {
let scaleAnimation:CABasicAnimation = animateKeyPath(Constants.scale,
fromValue: 1.0,
toValue: 0.01,
timing:convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeOut));
if animation == false { scaleAnimation.duration = 0.0001 }
shape.add(scaleAnimation, forKey: Constants.down)
}
}
//MARK: - CAAnimation Delegate
open func animationDidStart(_ anim: CAAnimation) {
parentView?.backgroundColor = defaultTintColor
animationDidStartClosure(isOn)
}
open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
if flag == true {
parentView?.backgroundColor = isOn == true ? onTintColor : defaultTintColor
}
animationDidStopClosure(isOn, flag)
}
}
// MARK: - Initialization
public required init(view: UIView?, color: UIColor?) {
super.init(frame: CGRectZero)
onTintColor = color
self.commonInit(view)
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override public func awakeFromNib() {
self.commonInit(superview)
super.awakeFromNib()
}
}
// MARK: public
public extension RAMPaperSwitch {
override public func setOn(on: Bool, animated: Bool) {
let changed:Bool = on != self.on
super.setOn(on, animated: animated)
if changed {
switchChangeWithAniatiom(animated)
}
}
// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertToCAMediaTimingFunctionName(_ input: String) -> CAMediaTimingFunctionName {
return CAMediaTimingFunctionName(rawValue: input)
}
// MARK: Helpers
extension RAMPaperSwitch {
private func commonInit(parentView: UIView?) {
guard let onTintColor = self.onTintColor else {
fatalError("set tint color")
}
self.parentView = parentView
self.defaultTintColor = parentView?.backgroundColor
layer.borderWidth = 0.5
layer.borderColor = UIColor.whiteColor().CGColor;
layer.cornerRadius = frame.size.height / 2;
shape.fillColor = onTintColor.CGColor
shape.masksToBounds = true
parentView?.layer.insertSublayer(shape, atIndex: 0)
parentView?.layer.masksToBounds = true
showShapeIfNeed()
addTarget(self, action: #selector(RAMPaperSwitch.switchChanged), forControlEvents: UIControlEvents.ValueChanged)
}
override public func layoutSubviews() {
let x:CGFloat = max(frame.midX, superview!.frame.size.width - frame.midX);
let y:CGFloat = max(frame.midY, superview!.frame.size.height - frame.midY);
radius = sqrt(x*x + y*y);
shape.frame = CGRectMake(frame.midX - radius, frame.midY - radius, radius * 2, radius * 2)
shape.anchorPoint = CGPointMake(0.5, 0.5);
shape.path = UIBezierPath(ovalInRect: CGRectMake(0, 0, radius * 2, radius * 2)).CGPath
}
// MARK: - Private
private func showShapeIfNeed() {
shape.transform = on ? CATransform3DMakeScale(1.0, 1.0, 1.0) : CATransform3DMakeScale(0.0001, 0.0001, 0.0001)
}
internal func switchChanged() {
switchChangeWithAniatiom(true)
}
}
// MARK: animations
extension RAMPaperSwitch {
private func animateKeyPath(keyPath: String, fromValue from: CGFloat?, toValue to: CGFloat, timing timingFunction: String) -> CABasicAnimation {
let animation:CABasicAnimation = CABasicAnimation(keyPath: keyPath)
animation.fromValue = from
animation.toValue = to
animation.repeatCount = 1
animation.timingFunction = CAMediaTimingFunction(name: timingFunction)
animation.removedOnCompletion = false
animation.fillMode = kCAFillModeForwards
animation.duration = duration;
animation.delegate = self
return animation;
}
private func switchChangeWithAniatiom(animation: Bool) {
guard let onTintColor = self.onTintColor else {
fatalError("set tint color")
}
if on == oldState {
return;
}
oldState = on
shape.fillColor = onTintColor.CGColor
if on {
let scaleAnimation:CABasicAnimation = animateKeyPath(Constants.scale,
fromValue: 0.01,
toValue: 1.0,
timing:kCAMediaTimingFunctionEaseIn);
if animation == false { scaleAnimation.duration = 0.0001 }
shape.addAnimation(scaleAnimation, forKey: Constants.up)
}
else {
let scaleAnimation:CABasicAnimation = animateKeyPath(Constants.scale,
fromValue: 1.0,
toValue: 0.01,
timing:kCAMediaTimingFunctionEaseOut);
if animation == false { scaleAnimation.duration = 0.0001 }
shape.addAnimation(scaleAnimation, forKey: Constants.down)
}
}
//MARK: - CAAnimation Delegate
override public func animationDidStart(anim: CAAnimation){
parentView?.backgroundColor = defaultTintColor
animationDidStartClosure(on)
}
override public func animationDidStop(anim: CAAnimation, finished flag: Bool){
print(flag)
if flag == true {
parentView?.backgroundColor = on == true ? onTintColor : defaultTintColor
}
animationDidStopClosure(on, flag)
}
// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertFromCAMediaTimingFunctionName(_ input: CAMediaTimingFunctionName) -> String {
return input.rawValue
}
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+19
View File
@@ -0,0 +1,19 @@
//
// PaperSwitch.h
// PaperSwitch
//
// Created by Alex K. on 01/06/16.
// Copyright © 2016 Ramotion. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for PaperSwitch.
FOUNDATION_EXPORT double PaperSwitchVersionNumber;
//! Project version string for PaperSwitch.
FOUNDATION_EXPORT const unsigned char PaperSwitchVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <PaperSwitch/PublicHeader.h>
@@ -7,16 +7,27 @@
objects = {
/* Begin PBXBuildFile section */
154E67C21D8AA47900E85781 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 154E67C11D8AA47900E85781 /* Main.storyboard */; };
846E0ED31C464B5C0052CDD8 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 846E0ED21C464B5C0052CDD8 /* Launch.storyboard */; };
84BE57D51CFF03ED0073C92B /* PaperSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BE57D41CFF03ED0073C92B /* PaperSwitch.h */; settings = {ATTRIBUTES = (Public, ); }; };
84BE57D91CFF03ED0073C92B /* PaperSwitch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84BE57D21CFF03ED0073C92B /* PaperSwitch.framework */; };
84BE57DA1CFF03ED0073C92B /* PaperSwitch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 84BE57D21CFF03ED0073C92B /* PaperSwitch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
84BE57DF1CFF04000073C92B /* RAMPaperSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C688A221A274A39008BFF1E /* RAMPaperSwitch.swift */; };
9C688A001A274993008BFF1E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C6889FF1A274993008BFF1E /* AppDelegate.swift */; };
9C688A021A274993008BFF1E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C688A011A274993008BFF1E /* ViewController.swift */; };
9C688A071A274993008BFF1E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C688A061A274993008BFF1E /* Images.xcassets */; };
9C688A161A274993008BFF1E /* PaperSwitchDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C688A151A274993008BFF1E /* PaperSwitchDemoTests.swift */; };
9C688A201A274A25008BFF1E /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C688A1F1A274A25008BFF1E /* ViewController.xib */; };
9C688A231A274A39008BFF1E /* RAMPaperSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C688A221A274A39008BFF1E /* RAMPaperSwitch.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
84BE57D71CFF03ED0073C92B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9C6889F21A274993008BFF1E /* Project object */;
proxyType = 1;
remoteGlobalIDString = 84BE57D11CFF03ED0073C92B;
remoteInfo = PaperSwitch;
};
9C688A101A274993008BFF1E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9C6889F21A274993008BFF1E /* Project object */;
@@ -26,8 +37,28 @@
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
84BE57DE1CFF03ED0073C92B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
84BE57DA1CFF03ED0073C92B /* PaperSwitch.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
154E67C11D8AA47900E85781 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
158583FB1D8A9C4E00175A4D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
158583FD1D8A9C9700175A4D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
846E0ED21C464B5C0052CDD8 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
84BE57D21CFF03ED0073C92B /* PaperSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PaperSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; };
84BE57D41CFF03ED0073C92B /* PaperSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaperSwitch.h; sourceTree = "<group>"; };
84BE57D61CFF03ED0073C92B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9C6889FA1A274993008BFF1E /* PaperSwitchDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PaperSwitchDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
9C6889FE1A274993008BFF1E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9C6889FF1A274993008BFF1E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -36,15 +67,22 @@
9C688A0F1A274993008BFF1E /* PaperSwitchDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PaperSwitchDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9C688A141A274993008BFF1E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9C688A151A274993008BFF1E /* PaperSwitchDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaperSwitchDemoTests.swift; sourceTree = "<group>"; };
9C688A1F1A274A25008BFF1E /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = "<group>"; };
9C688A221A274A39008BFF1E /* RAMPaperSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RAMPaperSwitch.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
84BE57CE1CFF03ED0073C92B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9C6889F71A274993008BFF1E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
84BE57D91CFF03ED0073C92B /* PaperSwitch.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -58,12 +96,32 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
158583FA1D8A9C4E00175A4D /* Frameworks */ = {
isa = PBXGroup;
children = (
158583FD1D8A9C9700175A4D /* QuartzCore.framework */,
158583FB1D8A9C4E00175A4D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
84BE57D31CFF03ED0073C92B /* PaperSwitch */ = {
isa = PBXGroup;
children = (
84BE57D41CFF03ED0073C92B /* PaperSwitch.h */,
84BE57D61CFF03ED0073C92B /* Info.plist */,
);
path = PaperSwitch;
sourceTree = "<group>";
};
9C6889F11A274993008BFF1E = {
isa = PBXGroup;
children = (
9C6889FC1A274993008BFF1E /* PaperSwitchDemo */,
9C688A121A274993008BFF1E /* PaperSwitchDemoTests */,
84BE57D31CFF03ED0073C92B /* PaperSwitch */,
9C6889FB1A274993008BFF1E /* Products */,
158583FA1D8A9C4E00175A4D /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -72,6 +130,7 @@
children = (
9C6889FA1A274993008BFF1E /* PaperSwitchDemo.app */,
9C688A0F1A274993008BFF1E /* PaperSwitchDemoTests.xctest */,
84BE57D21CFF03ED0073C92B /* PaperSwitch.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -82,10 +141,10 @@
9C688A211A274A39008BFF1E /* PaperSwitch */,
9C6889FF1A274993008BFF1E /* AppDelegate.swift */,
9C688A011A274993008BFF1E /* ViewController.swift */,
9C688A1F1A274A25008BFF1E /* ViewController.xib */,
9C688A061A274993008BFF1E /* Images.xcassets */,
9C6889FD1A274993008BFF1E /* Supporting Files */,
846E0ED21C464B5C0052CDD8 /* Launch.storyboard */,
154E67C11D8AA47900E85781 /* Main.storyboard */,
);
path = PaperSwitchDemo;
sourceTree = "<group>";
@@ -126,7 +185,36 @@
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
84BE57CF1CFF03ED0073C92B /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
84BE57D51CFF03ED0073C92B /* PaperSwitch.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
84BE57D11CFF03ED0073C92B /* PaperSwitch */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84BE57DD1CFF03ED0073C92B /* Build configuration list for PBXNativeTarget "PaperSwitch" */;
buildPhases = (
84BE57CD1CFF03ED0073C92B /* Sources */,
84BE57CE1CFF03ED0073C92B /* Frameworks */,
84BE57CF1CFF03ED0073C92B /* Headers */,
84BE57D01CFF03ED0073C92B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PaperSwitch;
productName = PaperSwitch;
productReference = 84BE57D21CFF03ED0073C92B /* PaperSwitch.framework */;
productType = "com.apple.product-type.framework";
};
9C6889F91A274993008BFF1E /* PaperSwitchDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9C688A191A274993008BFF1E /* Build configuration list for PBXNativeTarget "PaperSwitchDemo" */;
@@ -134,10 +222,12 @@
9C6889F61A274993008BFF1E /* Sources */,
9C6889F71A274993008BFF1E /* Frameworks */,
9C6889F81A274993008BFF1E /* Resources */,
84BE57DE1CFF03ED0073C92B /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
84BE57D81CFF03ED0073C92B /* PBXTargetDependency */,
);
name = PaperSwitchDemo;
productName = PaperSwitchDemo;
@@ -170,21 +260,29 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Ramotion;
TargetAttributes = {
84BE57D11CFF03ED0073C92B = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 34MUF9YXTA;
LastSwiftMigration = 1020;
};
9C6889F91A274993008BFF1E = {
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9C688A0E1A274993008BFF1E = {
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 1020;
TestTargetID = 9C6889F91A274993008BFF1E;
};
};
};
buildConfigurationList = 9C6889F51A274993008BFF1E /* Build configuration list for PBXProject "PaperSwitchDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -197,18 +295,26 @@
targets = (
9C6889F91A274993008BFF1E /* PaperSwitchDemo */,
9C688A0E1A274993008BFF1E /* PaperSwitchDemoTests */,
84BE57D11CFF03ED0073C92B /* PaperSwitch */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
84BE57D01CFF03ED0073C92B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9C6889F81A274993008BFF1E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9C688A201A274A25008BFF1E /* ViewController.xib in Resources */,
9C688A071A274993008BFF1E /* Images.xcassets in Resources */,
846E0ED31C464B5C0052CDD8 /* Launch.storyboard in Resources */,
154E67C21D8AA47900E85781 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -222,6 +328,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
84BE57CD1CFF03ED0073C92B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
84BE57DF1CFF04000073C92B /* RAMPaperSwitch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9C6889F61A274993008BFF1E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -243,6 +357,11 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
84BE57D81CFF03ED0073C92B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84BE57D11CFF03ED0073C92B /* PaperSwitch */;
targetProxy = 84BE57D71CFF03ED0073C92B /* PBXContainerItemProxy */;
};
9C688A111A274993008BFF1E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9C6889F91A274993008BFF1E /* PaperSwitchDemo */;
@@ -251,6 +370,58 @@
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
84BE57DB1CFF03ED0073C92B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 34MUF9YXTA;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PaperSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PaperSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
84BE57DC1CFF03ED0073C92B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PaperSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PaperSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
9C688A171A274993008BFF1E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -259,13 +430,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -274,6 +455,7 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -286,11 +468,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -303,13 +486,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -317,15 +510,18 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -334,24 +530,30 @@
9C688A1A1A274993008BFF1E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PaperSwitchDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ramotion.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
9C688A1B1A274993008BFF1E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PaperSwitchDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ramotion.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -371,6 +573,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ramotion.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PaperSwitchDemo.app/PaperSwitchDemo";
};
name = Debug;
@@ -387,6 +590,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "ramotion.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PaperSwitchDemo.app/PaperSwitchDemo";
};
name = Release;
@@ -394,6 +598,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
84BE57DD1CFF03ED0073C92B /* Build configuration list for PBXNativeTarget "PaperSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
84BE57DB1CFF03ED0073C92B /* Debug */,
84BE57DC1CFF03ED0073C92B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9C6889F51A274993008BFF1E /* Build configuration list for PBXProject "PaperSwitchDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9C6889F91A274993008BFF1E"
BuildableName = "PaperSwitchDemo.app"
BlueprintName = "PaperSwitchDemo"
BlueprintIdentifier = "84BE57D11CFF03ED0073C92B"
BuildableName = "PaperSwitch.framework"
BlueprintName = "PaperSwitch"
ReferencedContainer = "container:PaperSwitchDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -28,26 +28,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9C688A0E1A274993008BFF1E"
BuildableName = "PaperSwitchDemoTests.xctest"
BlueprintName = "PaperSwitchDemoTests"
ReferencedContainer = "container:PaperSwitchDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9C6889F91A274993008BFF1E"
BuildableName = "PaperSwitchDemo.app"
BlueprintName = "PaperSwitchDemo"
ReferencedContainer = "container:PaperSwitchDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@@ -61,16 +42,15 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9C6889F91A274993008BFF1E"
BuildableName = "PaperSwitchDemo.app"
BlueprintName = "PaperSwitchDemo"
BlueprintIdentifier = "84BE57D11CFF03ED0073C92B"
BuildableName = "PaperSwitch.framework"
BlueprintName = "PaperSwitch"
ReferencedContainer = "container:PaperSwitchDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@@ -80,16 +60,15 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9C6889F91A274993008BFF1E"
BuildableName = "PaperSwitchDemo.app"
BlueprintName = "PaperSwitchDemo"
BlueprintIdentifier = "84BE57D11CFF03ED0073C92B"
BuildableName = "PaperSwitch.framework"
BlueprintName = "PaperSwitch"
ReferencedContainer = "container:PaperSwitchDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
@@ -24,17 +24,10 @@ import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController(nibName:"ViewController", bundle:nil)
window!.makeKeyAndVisible()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
@@ -24,6 +24,8 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>Launch</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="iOC-I4-Jct">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="iOC-I4-Jct">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -14,9 +15,9 @@
<viewControllerLayoutGuide type="bottom" id="sfv-Ni-ktc"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="c6b-Av-8Zn">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kXj-Wm-DPf" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="NRp-Cu-V2v">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="HPA-N1-w9E">
<objects>
<viewController id="NRp-Cu-V2v" customClass="ViewController" customModule="PaperSwitchDemo" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="3n8-cZ-ueH"/>
<viewControllerLayoutGuide type="bottom" id="fUY-wu-dhE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Hl9-Pn-zOa">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lf3-kC-Qqn">
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Contact Sync" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eWh-nK-Uc3">
<constraints>
<constraint firstAttribute="height" constant="21" id="jbe-bR-eRr"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="16"/>
<color key="textColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ND1-fx-f9Z" userLabel="Blue View">
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Connect Contacts" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KiO-j0-5YO">
<constraints>
<constraint firstAttribute="height" constant="21" id="koD-YB-PAs"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="19"/>
<color key="textColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gBL-Aw-3DB" userLabel="Description">
<string key="text">All your phone Contacts will be automatically
added to your friends list.</string>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="12"/>
<color key="textColor" red="0.18039215689999999" green="0.18039215689999999" blue="0.18039215689999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_users1" translatesAutoresizingMaskIntoConstraints="NO" id="sI5-HK-IVa">
<constraints>
<constraint firstAttribute="height" constant="56" id="rYz-Af-fXC"/>
<constraint firstAttribute="width" constant="39" id="y7V-7z-hGY"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_phone_off" translatesAutoresizingMaskIntoConstraints="NO" id="VO2-9J-2EO">
<constraints>
<constraint firstAttribute="width" constant="23" id="fMx-6c-o7Q"/>
<constraint firstAttribute="height" constant="36" id="k4p-R8-fuj"/>
</constraints>
</imageView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="bF6-0b-kUx" customClass="RAMPaperSwitch" customModule="PaperSwitchDemo" customModuleProvider="target">
<constraints>
<constraint firstAttribute="height" constant="31" id="j9U-SC-XRv"/>
</constraints>
<color key="onTintColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="VO2-9J-2EO" firstAttribute="top" secondItem="gBL-Aw-3DB" secondAttribute="bottom" constant="30" id="0CY-FA-wzb"/>
<constraint firstAttribute="centerX" secondItem="VO2-9J-2EO" secondAttribute="centerX" constant="31" id="1Cr-Ur-CPz"/>
<constraint firstItem="KiO-j0-5YO" firstAttribute="top" secondItem="ND1-fx-f9Z" secondAttribute="top" constant="56" id="2uT-ho-94r"/>
<constraint firstAttribute="centerX" secondItem="KiO-j0-5YO" secondAttribute="centerX" id="7H8-l2-4pX"/>
<constraint firstItem="gBL-Aw-3DB" firstAttribute="top" secondItem="KiO-j0-5YO" secondAttribute="bottom" constant="14" id="Sl7-4J-zXZ"/>
<constraint firstItem="bF6-0b-kUx" firstAttribute="top" secondItem="gBL-Aw-3DB" secondAttribute="bottom" constant="32" id="UHC-x6-a0E"/>
<constraint firstAttribute="height" constant="252" id="b2w-QW-g16"/>
<constraint firstItem="gBL-Aw-3DB" firstAttribute="centerX" secondItem="ND1-fx-f9Z" secondAttribute="centerX" id="c0U-OL-iE3"/>
<constraint firstItem="VO2-9J-2EO" firstAttribute="leading" secondItem="sI5-HK-IVa" secondAttribute="trailing" constant="8" symbolic="YES" id="ozX-9c-ZD1"/>
<constraint firstItem="sI5-HK-IVa" firstAttribute="top" secondItem="gBL-Aw-3DB" secondAttribute="bottom" constant="20" id="peX-YQ-KHA"/>
<constraint firstAttribute="centerX" secondItem="bF6-0b-kUx" secondAttribute="centerX" constant="-65" id="zpn-EM-OJl"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JaN-y1-Vdz" userLabel="Green View">
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Allow Discovery" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mIS-5N-XDP">
<constraints>
<constraint firstAttribute="height" constant="21" id="MZW-W8-2Qw"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="19"/>
<color key="textColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Turn on to allow your phone number to be dis-played in your friends Contacts." textAlignment="center" lineBreakMode="characterWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0mW-XF-csy" userLabel="Description">
<constraints>
<constraint firstAttribute="width" constant="240" id="igB-D9-P5l"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="12"/>
<color key="textColor" red="0.18039215689999999" green="0.18039215689999999" blue="0.18039215689999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_phone_off" translatesAutoresizingMaskIntoConstraints="NO" id="YWq-PD-Ghd">
<constraints>
<constraint firstAttribute="height" constant="36" id="XvT-Gh-ls1"/>
<constraint firstAttribute="width" constant="23" id="heh-Ns-e8S"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_users2" translatesAutoresizingMaskIntoConstraints="NO" id="NOm-Wg-Eg4">
<constraints>
<constraint firstAttribute="width" constant="39" id="vPe-sF-jld"/>
<constraint firstAttribute="height" constant="56" id="xKC-fQ-qwH"/>
</constraints>
</imageView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Q3s-3p-PRX" customClass="RAMPaperSwitch" customModule="PaperSwitchDemo" customModuleProvider="target">
<constraints>
<constraint firstAttribute="height" constant="31" id="llv-4a-OXa"/>
</constraints>
<color key="onTintColor" red="0.5568627451" green="0.77647058820000003" blue="0.2470588235" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="NOm-Wg-Eg4" firstAttribute="leading" secondItem="YWq-PD-Ghd" secondAttribute="trailing" constant="8" symbolic="YES" id="3wI-X0-Xjo"/>
<constraint firstItem="0mW-XF-csy" firstAttribute="top" secondItem="mIS-5N-XDP" secondAttribute="bottom" constant="14" id="F2Q-o4-Ghj"/>
<constraint firstAttribute="centerX" secondItem="mIS-5N-XDP" secondAttribute="centerX" id="Ioa-7y-3xm"/>
<constraint firstItem="NOm-Wg-Eg4" firstAttribute="top" secondItem="0mW-XF-csy" secondAttribute="bottom" constant="20" id="JDA-CE-g9M"/>
<constraint firstAttribute="centerX" secondItem="Q3s-3p-PRX" secondAttribute="centerX" constant="-65" id="KpK-VA-ah3"/>
<constraint firstItem="YWq-PD-Ghd" firstAttribute="top" secondItem="0mW-XF-csy" secondAttribute="bottom" constant="30" id="L77-bu-MOh"/>
<constraint firstItem="mIS-5N-XDP" firstAttribute="top" secondItem="JaN-y1-Vdz" secondAttribute="top" constant="56" id="RG7-gF-nDk"/>
<constraint firstItem="0mW-XF-csy" firstAttribute="centerX" secondItem="JaN-y1-Vdz" secondAttribute="centerX" id="lml-sU-PV7"/>
<constraint firstAttribute="centerX" secondItem="NOm-Wg-Eg4" secondAttribute="centerX" constant="40" id="nw0-At-jEM"/>
<constraint firstAttribute="height" constant="252" id="tIc-Xt-smv"/>
<constraint firstItem="Q3s-3p-PRX" firstAttribute="top" secondItem="0mW-XF-csy" secondAttribute="bottom" constant="32" id="yWO-sp-S5A"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="eWh-nK-Uc3" firstAttribute="centerX" secondItem="Lf3-kC-Qqn" secondAttribute="centerX" id="2Vc-vz-zLk"/>
<constraint firstItem="ND1-fx-f9Z" firstAttribute="leading" secondItem="Lf3-kC-Qqn" secondAttribute="leading" id="A8B-KG-FuL"/>
<constraint firstAttribute="centerX" secondItem="ND1-fx-f9Z" secondAttribute="centerX" id="E2g-iL-pUD"/>
<constraint firstAttribute="bottom" secondItem="JaN-y1-Vdz" secondAttribute="bottom" id="Oqe-lQ-vV9"/>
<constraint firstItem="JaN-y1-Vdz" firstAttribute="top" secondItem="ND1-fx-f9Z" secondAttribute="bottom" id="Rsv-IV-aR4"/>
<constraint firstItem="JaN-y1-Vdz" firstAttribute="leading" secondItem="Lf3-kC-Qqn" secondAttribute="leading" id="UJ6-rK-Dne"/>
<constraint firstAttribute="trailing" secondItem="ND1-fx-f9Z" secondAttribute="trailing" id="W1Q-ZJ-1IF"/>
<constraint firstItem="eWh-nK-Uc3" firstAttribute="top" secondItem="Lf3-kC-Qqn" secondAttribute="top" constant="35" id="YWt-c6-LYD"/>
<constraint firstAttribute="centerX" secondItem="JaN-y1-Vdz" secondAttribute="centerX" id="YcC-ew-c8H"/>
<constraint firstItem="ND1-fx-f9Z" firstAttribute="top" secondItem="eWh-nK-Uc3" secondAttribute="bottom" constant="8" symbolic="YES" id="dlp-ks-lSa"/>
<constraint firstAttribute="trailing" secondItem="JaN-y1-Vdz" secondAttribute="trailing" id="obH-uq-EOT"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Lf3-kC-Qqn" firstAttribute="top" secondItem="3n8-cZ-ueH" secondAttribute="bottom" id="6Ew-Wr-K51"/>
<constraint firstItem="fUY-wu-dhE" firstAttribute="top" secondItem="Lf3-kC-Qqn" secondAttribute="bottom" id="Gkw-UD-Rmd"/>
<constraint firstItem="Lf3-kC-Qqn" firstAttribute="leading" secondItem="Hl9-Pn-zOa" secondAttribute="leading" id="d6U-8s-p8t"/>
<constraint firstAttribute="trailing" secondItem="Lf3-kC-Qqn" secondAttribute="trailing" id="ka6-aL-pYl"/>
</constraints>
</view>
<connections>
<outlet property="allowDiscoveryLabel" destination="mIS-5N-XDP" id="xEu-RN-crs"/>
<outlet property="connectContactsLabel" destination="KiO-j0-5YO" id="YMS-28-d07"/>
<outlet property="paperSwitch1" destination="bF6-0b-kUx" id="SDB-51-2x4"/>
<outlet property="paperSwitch2" destination="Q3s-3p-PRX" id="u7b-gI-E6p"/>
<outlet property="phone1ImageView" destination="VO2-9J-2EO" id="nJb-av-eD7"/>
<outlet property="phone2ImageView" destination="YWq-PD-Ghd" id="aV3-8d-ax4"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kdt-RC-xLh" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="92" y="131"/>
</scene>
</scenes>
<resources>
<image name="img_phone_off" width="45" height="71"/>
<image name="img_users1" width="77" height="111"/>
<image name="img_users2" width="77" height="111"/>
</resources>
</document>
@@ -24,25 +24,23 @@ import UIKit
class ViewController: UIViewController {
@IBOutlet weak private var connectContactsLabel: UILabel!
@IBOutlet weak private var phone1ImageView: UIImageView!
@IBOutlet weak private var paperSwitch1: RAMPaperSwitch!
@IBOutlet weak private var allowDiscoveryLabel: UILabel!
@IBOutlet weak private var phone2ImageView: UIImageView!
@IBOutlet weak private var paperSwitch2: RAMPaperSwitch!
@IBOutlet weak var connectContactsLabel: UILabel!
@IBOutlet weak var phone1ImageView: UIImageView!
@IBOutlet weak var paperSwitch1: RAMPaperSwitch!
@IBOutlet weak var allowDiscoveryLabel: UILabel!
@IBOutlet weak var phone2ImageView: UIImageView!
@IBOutlet weak var paperSwitch2: RAMPaperSwitch!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.setupPaperSwitch()
self.navigationController?.navigationBarHidden = true
self.navigationController?.isNavigationBarHidden = true
}
private func setupPaperSwitch() {
fileprivate func setupPaperSwitch() {
self.paperSwitch1.animationDidStartClosure = {(onAnimation: Bool) in
@@ -57,20 +55,17 @@ class ViewController: UIViewController {
self.animateImageView(self.phone2ImageView, onAnimation: onAnimation, duration: self.paperSwitch2.duration)
}
}
private func animateLabel(label: UILabel, onAnimation: Bool, duration: NSTimeInterval) {
UIView.transitionWithView(label, duration: duration, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: {
label.textColor = onAnimation ? UIColor.whiteColor() : UIColor(red: 31/255.0, green: 183/255.0, blue: 252/255.0, alpha: 1)
fileprivate func animateLabel(_ label: UILabel, onAnimation: Bool, duration: TimeInterval) {
UIView.transition(with: label, duration: duration, options: UIView.AnimationOptions.transitionCrossDissolve, animations: {
label.textColor = onAnimation ? UIColor.white : UIColor(red: 31/255.0, green: 183/255.0, blue: 252/255.0, alpha: 1)
}, completion:nil)
}
private func animateImageView(imageView: UIImageView, onAnimation: Bool, duration: NSTimeInterval) {
UIView.transitionWithView(imageView, duration: duration, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: {
fileprivate func animateImageView(_ imageView: UIImageView, onAnimation: Bool, duration: TimeInterval) {
UIView.transition(with: imageView, duration: duration, options: UIView.AnimationOptions.transitionCrossDissolve, animations: {
imageView.image = UIImage(named: onAnimation ? "img_phone_on" : "img_phone_off")
}, completion:nil)
}
}
@@ -1,186 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ViewController" customModule="PaperSwitchDemo" customModuleProvider="target">
<connections>
<outlet property="allowDiscoveryLabel" destination="N9e-6s-9lQ" id="O8T-MM-aeX"/>
<outlet property="connectContactsLabel" destination="ko7-ML-TsC" id="7uf-dW-cN2"/>
<outlet property="paperSwitch1" destination="r8u-XF-soy" id="vp3-X5-Jn0"/>
<outlet property="paperSwitch2" destination="Lkc-kV-pLw" id="pof-LU-udu"/>
<outlet property="phone1ImageView" destination="RW3-kM-1XM" id="63b-nr-nm3"/>
<outlet property="phone2ImageView" destination="FUW-Xh-bau" id="c5F-0v-mIC"/>
<outlet property="view" destination="iN0-l3-epB" id="eq6-G2-aIK"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KlQ-2X-Iif">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Contact Sync" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QLU-hy-5Qd">
<rect key="frame" x="113" y="35" width="94" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="hST-86-Rid"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="16"/>
<color key="textColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ure-2X-J08" userLabel="Blue View">
<rect key="frame" x="0.0" y="64" width="320" height="252"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Connect Contacts" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ko7-ML-TsC">
<rect key="frame" x="85" y="56" width="150" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="2ST-Yg-k58"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="19"/>
<color key="textColor" red="0.1215686275" green="0.71764705880000002" blue="0.98823529409999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PN6-JF-GrS" userLabel="Description">
<rect key="frame" x="43" y="91" width="234" height="29"/>
<string key="text">All your phone Contacts will be automatically
added to your friends list.</string>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="12"/>
<color key="textColor" red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_users1" translatesAutoresizingMaskIntoConstraints="NO" id="3Rh-Hd-zis">
<rect key="frame" x="70" y="140" width="39" height="56"/>
<constraints>
<constraint firstAttribute="width" constant="39" id="Ujx-mH-V2L"/>
<constraint firstAttribute="height" constant="56" id="ptp-eb-U9g"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_phone_off" translatesAutoresizingMaskIntoConstraints="NO" id="RW3-kM-1XM">
<rect key="frame" x="117" y="150" width="23" height="36"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="2T7-G1-kMN"/>
<constraint firstAttribute="width" constant="23" id="TxM-0R-JP4"/>
</constraints>
</imageView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="r8u-XF-soy" customClass="RAMPaperSwitch" customModule="PaperSwitchDemo" customModuleProvider="target">
<rect key="frame" x="200" y="152" width="51" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="B6j-At-6lo"/>
</constraints>
<color key="onTintColor" red="0.12156862745098039" green="0.71764705882352942" blue="0.9882352941176471" alpha="1" colorSpace="calibratedRGB"/>
</switch>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="PN6-JF-GrS" firstAttribute="centerX" secondItem="Ure-2X-J08" secondAttribute="centerX" id="3DN-m9-ccs"/>
<constraint firstItem="RW3-kM-1XM" firstAttribute="leading" secondItem="3Rh-Hd-zis" secondAttribute="trailing" constant="8" symbolic="YES" id="8FE-XJ-KZY"/>
<constraint firstAttribute="height" constant="252" id="GHf-Up-UBB"/>
<constraint firstAttribute="centerX" secondItem="RW3-kM-1XM" secondAttribute="centerX" constant="31" id="HXF-Wx-ZXR"/>
<constraint firstItem="r8u-XF-soy" firstAttribute="top" secondItem="PN6-JF-GrS" secondAttribute="bottom" constant="32" id="KPA-B3-2bv"/>
<constraint firstItem="RW3-kM-1XM" firstAttribute="top" secondItem="PN6-JF-GrS" secondAttribute="bottom" constant="30" id="Ksc-HM-OHf"/>
<constraint firstItem="ko7-ML-TsC" firstAttribute="top" secondItem="Ure-2X-J08" secondAttribute="top" constant="56" id="VM3-Gq-EL7"/>
<constraint firstAttribute="centerX" secondItem="r8u-XF-soy" secondAttribute="centerX" constant="-65" id="YS0-xR-G7s"/>
<constraint firstItem="PN6-JF-GrS" firstAttribute="top" secondItem="ko7-ML-TsC" secondAttribute="bottom" constant="14" id="Ztv-Xk-fvO"/>
<constraint firstAttribute="centerX" secondItem="ko7-ML-TsC" secondAttribute="centerX" id="efa-rb-hOa"/>
<constraint firstItem="3Rh-Hd-zis" firstAttribute="top" secondItem="PN6-JF-GrS" secondAttribute="bottom" constant="20" id="gE6-Rz-yrd"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bsB-yu-qMV" userLabel="Green View">
<rect key="frame" x="0.0" y="316" width="320" height="252"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Allow Discovery" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N9e-6s-9lQ">
<rect key="frame" x="96" y="56" width="129" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="r82-QP-Nke"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="19"/>
<color key="textColor" red="0.12156862745098039" green="0.71764705882352942" blue="0.9882352941176471" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Turn on to allow your phone number to be dis-played in your friends Contacts." textAlignment="center" lineBreakMode="characterWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VG8-M8-B66" userLabel="Description">
<rect key="frame" x="40" y="91" width="240" height="29"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="TAX-jG-Pfu"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="12"/>
<color key="textColor" red="0.18039215689999999" green="0.18039215689999999" blue="0.18039215689999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_phone_off" translatesAutoresizingMaskIntoConstraints="NO" id="FUW-Xh-bau">
<rect key="frame" x="70" y="150" width="23" height="36"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="YcD-Mp-Ids"/>
<constraint firstAttribute="width" constant="23" id="cRW-3d-UTv"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_users2" translatesAutoresizingMaskIntoConstraints="NO" id="VJR-8x-Xe5">
<rect key="frame" x="101" y="140" width="39" height="56"/>
<constraints>
<constraint firstAttribute="height" constant="56" id="1hw-ej-SMC"/>
<constraint firstAttribute="width" constant="39" id="vUL-Ad-yFb"/>
</constraints>
</imageView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Lkc-kV-pLw" customClass="RAMPaperSwitch" customModule="PaperSwitchDemo" customModuleProvider="target">
<rect key="frame" x="200" y="152" width="51" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="m5s-RP-HIQ"/>
</constraints>
<color key="onTintColor" red="0.55686274509803924" green="0.77647058823529413" blue="0.24705882352941178" alpha="1" colorSpace="calibratedRGB"/>
</switch>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Lkc-kV-pLw" firstAttribute="top" secondItem="VG8-M8-B66" secondAttribute="bottom" constant="32" id="711-Gy-tMQ"/>
<constraint firstItem="VJR-8x-Xe5" firstAttribute="leading" secondItem="FUW-Xh-bau" secondAttribute="trailing" constant="8" symbolic="YES" id="ATm-rE-i5R"/>
<constraint firstAttribute="centerX" secondItem="N9e-6s-9lQ" secondAttribute="centerX" id="DS2-K7-5cH"/>
<constraint firstAttribute="centerX" secondItem="Lkc-kV-pLw" secondAttribute="centerX" constant="-65" id="KbE-Zs-7Uo"/>
<constraint firstAttribute="centerX" secondItem="VJR-8x-Xe5" secondAttribute="centerX" constant="40" id="Vhz-bo-LyH"/>
<constraint firstItem="VG8-M8-B66" firstAttribute="top" secondItem="N9e-6s-9lQ" secondAttribute="bottom" constant="14" id="j0f-tA-zb6"/>
<constraint firstItem="VJR-8x-Xe5" firstAttribute="top" secondItem="VG8-M8-B66" secondAttribute="bottom" constant="20" id="jhl-eZ-vJ9"/>
<constraint firstAttribute="height" constant="252" id="oPT-Tr-yAJ"/>
<constraint firstItem="FUW-Xh-bau" firstAttribute="top" secondItem="VG8-M8-B66" secondAttribute="bottom" constant="30" id="t8Z-5s-j3s"/>
<constraint firstItem="N9e-6s-9lQ" firstAttribute="top" secondItem="bsB-yu-qMV" secondAttribute="top" constant="56" id="wn4-qY-rxP"/>
<constraint firstItem="VG8-M8-B66" firstAttribute="centerX" secondItem="bsB-yu-qMV" secondAttribute="centerX" id="zgi-7X-hYt"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="bsB-yu-qMV" firstAttribute="leading" secondItem="KlQ-2X-Iif" secondAttribute="leading" id="5Fm-pK-X3W"/>
<constraint firstAttribute="trailing" secondItem="Ure-2X-J08" secondAttribute="trailing" id="8aL-QD-jSu"/>
<constraint firstItem="QLU-hy-5Qd" firstAttribute="top" secondItem="KlQ-2X-Iif" secondAttribute="top" constant="35" id="AF1-j6-sWe"/>
<constraint firstAttribute="trailing" secondItem="bsB-yu-qMV" secondAttribute="trailing" id="H0B-7W-9GM"/>
<constraint firstAttribute="bottom" secondItem="bsB-yu-qMV" secondAttribute="bottom" id="JfA-yq-s2O"/>
<constraint firstItem="Ure-2X-J08" firstAttribute="top" secondItem="QLU-hy-5Qd" secondAttribute="bottom" constant="8" symbolic="YES" id="M53-Pk-aLh"/>
<constraint firstAttribute="centerX" secondItem="Ure-2X-J08" secondAttribute="centerX" id="SgT-Y9-lTR"/>
<constraint firstItem="QLU-hy-5Qd" firstAttribute="centerX" secondItem="KlQ-2X-Iif" secondAttribute="centerX" id="YFy-HE-Tnw"/>
<constraint firstAttribute="centerX" secondItem="bsB-yu-qMV" secondAttribute="centerX" id="asn-zP-o1s"/>
<constraint firstItem="Ure-2X-J08" firstAttribute="leading" secondItem="KlQ-2X-Iif" secondAttribute="leading" id="mNY-fb-c0H"/>
<constraint firstItem="bsB-yu-qMV" firstAttribute="top" secondItem="Ure-2X-J08" secondAttribute="bottom" id="rC5-oc-XIr"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="KlQ-2X-Iif" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="1dl-kD-U9L"/>
<constraint firstAttribute="bottom" secondItem="KlQ-2X-Iif" secondAttribute="bottom" id="TJU-yb-bGU"/>
<constraint firstItem="KlQ-2X-Iif" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="p4C-Jy-QYc"/>
<constraint firstAttribute="trailing" secondItem="KlQ-2X-Iif" secondAttribute="trailing" id="zqz-Dx-7AY"/>
</constraints>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="441" y="457"/>
</view>
</objects>
<resources>
<image name="img_phone_off" width="45" height="71"/>
<image name="img_users1" width="77" height="111"/>
<image name="img_users2" width="77" height="111"/>
</resources>
</document>
@@ -28,7 +28,7 @@ class PaperSwitchDemoTests: XCTestCase {
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
self.measure() {
// Put the code you want to measure the time of here.
}
}
+2 -3
View File
@@ -1,13 +1,12 @@
Pod::Spec.new do |s|
s.name = 'RAMPaperSwitch'
s.version = '1.0.0'
s.version = '3.1.0'
s.summary = 'Swift subclass of the UISwitch which paints over the parent view'
s.homepage = 'https://github.com/Ramotion/paper-switch'
s.license = 'MIT'
s.author = { 'juri.v' => 'juri.v@ramotion.com' }
s.source = { :git => 'https://github.com/Ramotion/paper-switch.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'
s.source_files = 'PaperSwitch/*.swift'
s.requires_arc = true
end
+54 -24
View File
@@ -1,37 +1,55 @@
![header](./header.png)
#RAMPaperSwitch
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=folding-cell"><img src="https://github.com/Ramotion/folding-cell/blob/master/header.png"></a>
<a href="https://github.com/Ramotion/folding-cell">
<img align="left" src="https://github.com/Ramotion/paper-switch/blob/master/paper-switch.gif" width="480" height="360" /></a>
<p><h1 align="left">PAPER SWITCH</h1></p>
<h4>A Swift material design UI module which paints over the parent view when the switch is on.</h4>
___
<p><h6>We specialize in the designing and coding of custom UI for Mobile Apps and Websites.</h6>
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=paper-switch">
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
</p>
<p><h6>Stay tuned for the latest updates:</h6>
<a href="https://goo.gl/rPFpid" >
<img src="https://i.imgur.com/ziSqeSo.png/" width="156" height="28"></a></p>
</br>
[![CocoaPods](https://img.shields.io/cocoapods/p/RAMPaperSwitch.svg)](https://cocoapods.org/pods/RAMPaperSwitch)
[![CocoaPods](https://img.shields.io/cocoapods/v/RAMPaperSwitch.svg)](http://cocoapods.org/pods/RAMPaperSwitch)
[![Swift 2.1](https://img.shields.io/badge/Swift-2.1-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![CocoaPods](https://img.shields.io/cocoapods/metrics/doc-percent/RAMPaperSwitch.svg)](https://cdn.rawgit.com/Ramotion/paper-switch/master/docs/index.html)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Ramotion/paper-switch)
[![Twitter](https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat)](http://twitter.com/Ramotion)
[![Travis](https://img.shields.io/travis/Ramotion/paper-switch.svg)](https://travis-ci.org/Ramotion/paper-switch)
Swift subclass of the UISwitch which paints over the parent view with the `onTintColor` when the switch is turned on. Implemented concept from [this Dribbble](https://dribbble.com/shots/1749645-Contact-Sync) shot by [Ramotion](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch).
#Screenshot
![PaperSwitch](screenshot.gif)
The [iPhone mockup](https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch) available [here](https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch).
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/Ramotion)
## Requirements
- iOS 8.0+
- Xcode 6.1
- Xcode 9.0+
#Installation
# Installation
Just add the `RAMPaperSwitch` folder to your project.
or use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'RAMPaperSwitch', '~> 0.0.3'
pod 'RAMPaperSwitch'
```
or [Carthage](https://github.com/Carthage/Carthage) users can simply add to their `Cartfile`:
```
github "Ramotion/paper-switch"
```
#Usage
# Usage
RAMPaperSwitch is a drop-in replacement of UISwitch. You just need to set the `onTintColor` property of the switch, and it will automatically _paint over_ its superview with the selected color.
You have ability to set duration of animation instead of default value.
@@ -46,7 +64,7 @@ You have ability to set duration of animation instead of default value.
5. Add animation for other views near the switch if need.
#Animate views
# Animate views
You can animate other views near the switch. For example, you can change color to views or labels that are inside the same superview. Duration of animation can be gotten from the RAMPaperSwitch's property `duration`. You can animate CoreAnimation properties like this:
``` swift
@@ -57,12 +75,24 @@ self.paperSwitch.animationDidStartClosure = {(onAnimation: Bool) in
}
```
## About
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch) [Ramotion Inc.](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch)
See our other [open-source projects](https://github.com/ramotion) or [hire](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=paper-switch) us to design, develop, and grow your product.
<br>
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/ramotion/paper-switch)
[![Twitter Follow](https://img.shields.io/twitter/follow/ramotion.svg?style=social)](https://twitter.com/ramotion)
## 📄 License
Paper Switch is released under the MIT license.
See [LICENSE](./LICENSE) for details.
This library is a part of a <a href="https://github.com/Ramotion/swift-ui-animation-components-and-libraries"><b>selection of our best UI open-source projects.</b></a>
If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com
## 📱 Get the Showroom App for iOS to give it a try
Try this UI component and more like this in our iOS app. Contact us if interested.
<a href="https://itunes.apple.com/app/apple-store/id1182360240?pt=550053&ct=folding-cell&mt=8" >
<img src="https://github.com/ramotion/gliding-collection/raw/master/app_store@2x.png" width="117" height="34"></a>
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=folding-cell">
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
<br>
<br>
+89
View File
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C15PaperSwitchDemo14RAMPaperSwitch"></a>
<a name="//apple_ref/swift/Class/RAMPaperSwitch" class="dashAnchor"></a>
<a class="token" href="#/s:C15PaperSwitchDemo14RAMPaperSwitch">RAMPaperSwitch</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Swift subclass of the UISwitch which paints over the parent view with the onTintColor when the switch is turned on.</p>
<a href="Classes/RAMPaperSwitch.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RAMPaperSwitch</span><span class="p">:</span> <span class="kt">UISwitch</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
+225
View File
@@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>RAMPaperSwitch Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/RAMPaperSwitch" class="dashAnchor"></a>
<a title="RAMPaperSwitch Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="../img/carat.png" />
RAMPaperSwitch Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>RAMPaperSwitch</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RAMPaperSwitch</span><span class="p">:</span> <span class="kt">UISwitch</span></code></pre>
</div>
</div>
<p>Swift subclass of the UISwitch which paints over the parent view with the onTintColor when the switch is turned on.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch8durationSd"></a>
<a name="//apple_ref/swift/Property/duration" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch8durationSd">duration</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The total duration of the animations, measured in seconds. Default 0.35</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mf">0.35</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch24animationDidStartClosureFSbT_"></a>
<a name="//apple_ref/swift/Property/animationDidStartClosure" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch24animationDidStartClosureFSbT_">animationDidStartClosure</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Closuer call when animation start</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">animationDidStartClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">in</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch23animationDidStopClosureFTSbSb_T_"></a>
<a name="//apple_ref/swift/Property/animationDidStopClosure" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch23animationDidStopClosureFTSbSb_T_">animationDidStopClosure</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Closuer call when animation finish</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">animationDidStopClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">finished</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">in</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Initialization"></a>
<a name="//apple_ref/swift/Section/Initialization" class="dashAnchor"></a>
<a href="#/Initialization">
<h3 class="section-name">Initialization</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC15PaperSwitchDemo14RAMPaperSwitchcFT4viewGSqCSo6UIView_5colorGSqCSo7UIColor__S0_"></a>
<a name="//apple_ref/swift/Method/init(view:color:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC15PaperSwitchDemo14RAMPaperSwitchcFT4viewGSqCSo6UIView_5colorGSqCSo7UIColor__S0_">init(view:color:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns an initialized switch object.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">required</span> <span class="nf">init</span><span class="p">(</span><span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">?,</span> <span class="nv">color</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">?)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>view</em>
</code>
</td>
<td>
<div>
<p>animatable view</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>color</em>
</code>
</td>
<td>
<div>
<p>The color which fill view.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized UISwitch object.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
+200
View File
@@ -0,0 +1,200 @@
/* Credit to https://gist.github.com/wataru420/2048287 */
.highlight {
/* Comment */
/* Error */
/* Keyword */
/* Operator */
/* Comment.Multiline */
/* Comment.Preproc */
/* Comment.Single */
/* Comment.Special */
/* Generic.Deleted */
/* Generic.Deleted.Specific */
/* Generic.Emph */
/* Generic.Error */
/* Generic.Heading */
/* Generic.Inserted */
/* Generic.Inserted.Specific */
/* Generic.Output */
/* Generic.Prompt */
/* Generic.Strong */
/* Generic.Subheading */
/* Generic.Traceback */
/* Keyword.Constant */
/* Keyword.Declaration */
/* Keyword.Pseudo */
/* Keyword.Reserved */
/* Keyword.Type */
/* Literal.Number */
/* Literal.String */
/* Name.Attribute */
/* Name.Builtin */
/* Name.Class */
/* Name.Constant */
/* Name.Entity */
/* Name.Exception */
/* Name.Function */
/* Name.Namespace */
/* Name.Tag */
/* Name.Variable */
/* Operator.Word */
/* Text.Whitespace */
/* Literal.Number.Float */
/* Literal.Number.Hex */
/* Literal.Number.Integer */
/* Literal.Number.Oct */
/* Literal.String.Backtick */
/* Literal.String.Char */
/* Literal.String.Doc */
/* Literal.String.Double */
/* Literal.String.Escape */
/* Literal.String.Heredoc */
/* Literal.String.Interpol */
/* Literal.String.Other */
/* Literal.String.Regex */
/* Literal.String.Single */
/* Literal.String.Symbol */
/* Name.Builtin.Pseudo */
/* Name.Variable.Class */
/* Name.Variable.Global */
/* Name.Variable.Instance */
/* Literal.Number.Integer.Long */ }
.highlight .c {
color: #999988;
font-style: italic; }
.highlight .err {
color: #a61717;
background-color: #e3d2d2; }
.highlight .k {
color: #000000;
font-weight: bold; }
.highlight .o {
color: #000000;
font-weight: bold; }
.highlight .cm {
color: #999988;
font-style: italic; }
.highlight .cp {
color: #999999;
font-weight: bold; }
.highlight .c1 {
color: #999988;
font-style: italic; }
.highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic; }
.highlight .gd {
color: #000000;
background-color: #ffdddd; }
.highlight .gd .x {
color: #000000;
background-color: #ffaaaa; }
.highlight .ge {
color: #000000;
font-style: italic; }
.highlight .gr {
color: #aa0000; }
.highlight .gh {
color: #999999; }
.highlight .gi {
color: #000000;
background-color: #ddffdd; }
.highlight .gi .x {
color: #000000;
background-color: #aaffaa; }
.highlight .go {
color: #888888; }
.highlight .gp {
color: #555555; }
.highlight .gs {
font-weight: bold; }
.highlight .gu {
color: #aaaaaa; }
.highlight .gt {
color: #aa0000; }
.highlight .kc {
color: #000000;
font-weight: bold; }
.highlight .kd {
color: #000000;
font-weight: bold; }
.highlight .kp {
color: #000000;
font-weight: bold; }
.highlight .kr {
color: #000000;
font-weight: bold; }
.highlight .kt {
color: #445588; }
.highlight .m {
color: #009999; }
.highlight .s {
color: #d14; }
.highlight .na {
color: #008080; }
.highlight .nb {
color: #0086B3; }
.highlight .nc {
color: #445588;
font-weight: bold; }
.highlight .no {
color: #008080; }
.highlight .ni {
color: #800080; }
.highlight .ne {
color: #990000;
font-weight: bold; }
.highlight .nf {
color: #990000; }
.highlight .nn {
color: #555555; }
.highlight .nt {
color: #000080; }
.highlight .nv {
color: #008080; }
.highlight .ow {
color: #000000;
font-weight: bold; }
.highlight .w {
color: #bbbbbb; }
.highlight .mf {
color: #009999; }
.highlight .mh {
color: #009999; }
.highlight .mi {
color: #009999; }
.highlight .mo {
color: #009999; }
.highlight .sb {
color: #d14; }
.highlight .sc {
color: #d14; }
.highlight .sd {
color: #d14; }
.highlight .s2 {
color: #d14; }
.highlight .se {
color: #d14; }
.highlight .sh {
color: #d14; }
.highlight .si {
color: #d14; }
.highlight .sx {
color: #d14; }
.highlight .sr {
color: #009926; }
.highlight .s1 {
color: #d14; }
.highlight .ss {
color: #990073; }
.highlight .bp {
color: #999999; }
.highlight .vc {
color: #008080; }
.highlight .vg {
color: #008080; }
.highlight .vi {
color: #008080; }
.highlight .il {
color: #009999; }
+331
View File
@@ -0,0 +1,331 @@
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
background: transparent;
border: 0;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline; }
body {
background-color: #f2f2f2;
font-family: Helvetica, freesans, Arial, sans-serif;
font-size: 14px;
-webkit-font-smoothing: subpixel-antialiased;
word-wrap: break-word; }
h1, h2, h3 {
margin-top: 0.8em;
margin-bottom: 0.3em;
font-weight: 100;
color: black; }
h1 {
font-size: 2.5em; }
h2 {
font-size: 2em;
border-bottom: 1px solid #e2e2e2; }
h4 {
font-size: 13px;
line-height: 1.5;
margin-top: 21px; }
h5 {
font-size: 1.1em; }
h6 {
font-size: 1.1em;
color: #777; }
.section-name {
color: gray;
display: block;
font-family: Helvetica;
font-size: 22px;
font-weight: 100;
margin-bottom: 15px; }
pre, code {
font: 0.95em Menlo, monospace;
color: #777;
word-wrap: normal; }
p code, li code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px; }
a {
color: #0088cc;
text-decoration: none; }
ul {
padding-left: 15px; }
li {
line-height: 1.8em; }
img {
max-width: 100%; }
blockquote {
margin-left: 0;
padding: 0 10px;
border-left: 4px solid #ccc; }
.content-wrapper {
margin: 0 auto;
width: 980px; }
header {
font-size: 0.85em;
line-height: 26px;
background-color: #414141;
position: fixed;
width: 100%;
z-index: 1; }
header img {
padding-right: 6px;
vertical-align: -4px;
height: 16px; }
header a {
color: #fff; }
header p {
float: left;
color: #999; }
header .header-right {
float: right;
margin-left: 16px; }
#breadcrumbs {
background-color: #f2f2f2;
height: 27px;
padding-top: 17px;
position: fixed;
width: 100%;
z-index: 1;
margin-top: 26px; }
#breadcrumbs #carat {
height: 10px;
margin: 0 5px; }
.sidebar {
background-color: #f9f9f9;
border: 1px solid #e2e2e2;
overflow-y: auto;
overflow-x: hidden;
position: fixed;
top: 70px;
bottom: 0;
width: 230px;
word-wrap: normal; }
.nav-groups {
list-style-type: none;
background: #fff;
padding-left: 0; }
.nav-group-name {
border-bottom: 1px solid #e2e2e2;
font-size: 1.1em;
font-weight: 100;
padding: 15px 0 15px 20px; }
.nav-group-name > a {
color: #333; }
.nav-group-tasks {
margin-top: 5px; }
.nav-group-task {
font-size: 0.9em;
list-style-type: none; }
.nav-group-task a {
color: #888; }
.main-content {
background-color: #fff;
border: 1px solid #e2e2e2;
margin-left: 246px;
position: absolute;
overflow: hidden;
padding-bottom: 60px;
top: 70px;
width: 734px; }
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
margin-bottom: 1em; }
.main-content p {
line-height: 1.8em; }
.main-content section .section:first-child {
margin-top: 0;
padding-top: 0; }
.main-content section .task-group-section .task-group:first-of-type {
padding-top: 10px; }
.main-content section .task-group-section .task-group:first-of-type .section-name {
padding-top: 15px; }
.section {
padding: 0 25px; }
.highlight {
background-color: #eee;
padding: 10px 12px;
border: 1px solid #e2e2e2;
border-radius: 4px;
overflow-x: auto; }
.declaration .highlight {
overflow-x: initial;
padding: 0 40px 40px 0;
margin-bottom: -25px;
background-color: transparent;
border: none; }
.section-name {
margin: 0;
margin-left: 18px; }
.task-group-section {
padding-left: 6px;
border-top: 1px solid #e2e2e2; }
.task-group {
padding-top: 0px; }
.task-name-container a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item {
padding-top: 8px;
width: 100%;
list-style-type: none; }
.item a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item code {
background-color: transparent;
padding: 0; }
.item .token {
padding-left: 3px;
margin-left: 15px;
font-size: 11.9px; }
.item .declaration-note {
font-size: .85em;
color: gray;
font-style: italic; }
.pointer-container {
border-bottom: 1px solid #e2e2e2;
left: -23px;
padding-bottom: 13px;
position: relative;
width: 110%; }
.pointer {
background: #f9f9f9;
border-left: 1px solid #e2e2e2;
border-top: 1px solid #e2e2e2;
height: 12px;
left: 21px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px; }
.height-container {
display: none;
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
overflow: hidden; }
.height-container .section {
background: #f9f9f9;
border-bottom: 1px solid #e2e2e2;
left: -25px;
position: relative;
width: 100%;
padding-top: 10px;
padding-bottom: 5px; }
.aside, .language {
padding: 6px 12px;
margin: 12px 0;
border-left: 5px solid #dddddd;
overflow-y: hidden; }
.aside .aside-title, .language .aside-title {
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
padding-bottom: 0;
margin: 0;
color: #aaa;
-webkit-user-select: none; }
.aside p:last-child, .language p:last-child {
margin-bottom: 0; }
.language {
border-left: 5px solid #cde9f4; }
.language .aside-title {
color: #4b8afb; }
.aside-warning {
border-left: 5px solid #ff6666; }
.aside-warning .aside-title {
color: #ff0000; }
.graybox {
border-collapse: collapse;
width: 100%; }
.graybox p {
margin: 0;
word-break: break-word;
min-width: 50px; }
.graybox td {
border: 1px solid #e2e2e2;
padding: 5px 25px 5px 10px;
vertical-align: middle; }
.graybox tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px; }
.slightly-smaller {
font-size: 0.9em; }
#footer {
position: absolute;
bottom: 10px;
margin-left: 25px; }
#footer p {
margin: 0;
color: #aaa;
font-size: 0.8em; }
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
display: none; }
html.dash .main-content {
width: 980px;
margin-left: 0;
border: none;
width: 100%;
top: 0;
padding-bottom: 0; }
html.dash .height-container {
display: block; }
html.dash .item .token {
margin-left: 0; }
html.dash .content-wrapper {
width: auto; }
html.dash #footer {
position: static; }
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.jazzy.paperswitchdemo</string>
<key>CFBundleName</key>
<string>PaperSwitchDemo</string>
<key>DocSetPlatformFamily</key>
<string>jazzy</string>
<key>isDashDocset</key>
<true/>
<key>dashIndexFilePath</key>
<string>index.html</string>
<key>isJavaScriptEnabled</key>
<true/>
<key>DashDocSetFamily</key>
<string>dashtoc</string>
</dict>
</plist>
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C15PaperSwitchDemo14RAMPaperSwitch"></a>
<a name="//apple_ref/swift/Class/RAMPaperSwitch" class="dashAnchor"></a>
<a class="token" href="#/s:C15PaperSwitchDemo14RAMPaperSwitch">RAMPaperSwitch</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Swift subclass of the UISwitch which paints over the parent view with the onTintColor when the switch is turned on.</p>
<a href="Classes/RAMPaperSwitch.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RAMPaperSwitch</span><span class="p">:</span> <span class="kt">UISwitch</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
@@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>RAMPaperSwitch Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/RAMPaperSwitch" class="dashAnchor"></a>
<a title="RAMPaperSwitch Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="../img/carat.png" />
RAMPaperSwitch Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>RAMPaperSwitch</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RAMPaperSwitch</span><span class="p">:</span> <span class="kt">UISwitch</span></code></pre>
</div>
</div>
<p>Swift subclass of the UISwitch which paints over the parent view with the onTintColor when the switch is turned on.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch8durationSd"></a>
<a name="//apple_ref/swift/Property/duration" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch8durationSd">duration</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The total duration of the animations, measured in seconds. Default 0.35</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mf">0.35</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch24animationDidStartClosureFSbT_"></a>
<a name="//apple_ref/swift/Property/animationDidStartClosure" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch24animationDidStartClosureFSbT_">animationDidStartClosure</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Closuer call when animation start</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">animationDidStartClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">in</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC15PaperSwitchDemo14RAMPaperSwitch23animationDidStopClosureFTSbSb_T_"></a>
<a name="//apple_ref/swift/Property/animationDidStopClosure" class="dashAnchor"></a>
<a class="token" href="#/s:vC15PaperSwitchDemo14RAMPaperSwitch23animationDidStopClosureFTSbSb_T_">animationDidStopClosure</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Closuer call when animation finish</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">animationDidStopClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">finished</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="k">in</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Initialization"></a>
<a name="//apple_ref/swift/Section/Initialization" class="dashAnchor"></a>
<a href="#/Initialization">
<h3 class="section-name">Initialization</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC15PaperSwitchDemo14RAMPaperSwitchcFT4viewGSqCSo6UIView_5colorGSqCSo7UIColor__S0_"></a>
<a name="//apple_ref/swift/Method/init(view:color:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC15PaperSwitchDemo14RAMPaperSwitchcFT4viewGSqCSo6UIView_5colorGSqCSo7UIColor__S0_">init(view:color:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns an initialized switch object.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">required</span> <span class="nf">init</span><span class="p">(</span><span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">?,</span> <span class="nv">color</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">?)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>view</em>
</code>
</td>
<td>
<div>
<p>animatable view</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>color</em>
</code>
</td>
<td>
<div>
<p>The color which fill view.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized UISwitch object.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
@@ -0,0 +1,200 @@
/* Credit to https://gist.github.com/wataru420/2048287 */
.highlight {
/* Comment */
/* Error */
/* Keyword */
/* Operator */
/* Comment.Multiline */
/* Comment.Preproc */
/* Comment.Single */
/* Comment.Special */
/* Generic.Deleted */
/* Generic.Deleted.Specific */
/* Generic.Emph */
/* Generic.Error */
/* Generic.Heading */
/* Generic.Inserted */
/* Generic.Inserted.Specific */
/* Generic.Output */
/* Generic.Prompt */
/* Generic.Strong */
/* Generic.Subheading */
/* Generic.Traceback */
/* Keyword.Constant */
/* Keyword.Declaration */
/* Keyword.Pseudo */
/* Keyword.Reserved */
/* Keyword.Type */
/* Literal.Number */
/* Literal.String */
/* Name.Attribute */
/* Name.Builtin */
/* Name.Class */
/* Name.Constant */
/* Name.Entity */
/* Name.Exception */
/* Name.Function */
/* Name.Namespace */
/* Name.Tag */
/* Name.Variable */
/* Operator.Word */
/* Text.Whitespace */
/* Literal.Number.Float */
/* Literal.Number.Hex */
/* Literal.Number.Integer */
/* Literal.Number.Oct */
/* Literal.String.Backtick */
/* Literal.String.Char */
/* Literal.String.Doc */
/* Literal.String.Double */
/* Literal.String.Escape */
/* Literal.String.Heredoc */
/* Literal.String.Interpol */
/* Literal.String.Other */
/* Literal.String.Regex */
/* Literal.String.Single */
/* Literal.String.Symbol */
/* Name.Builtin.Pseudo */
/* Name.Variable.Class */
/* Name.Variable.Global */
/* Name.Variable.Instance */
/* Literal.Number.Integer.Long */ }
.highlight .c {
color: #999988;
font-style: italic; }
.highlight .err {
color: #a61717;
background-color: #e3d2d2; }
.highlight .k {
color: #000000;
font-weight: bold; }
.highlight .o {
color: #000000;
font-weight: bold; }
.highlight .cm {
color: #999988;
font-style: italic; }
.highlight .cp {
color: #999999;
font-weight: bold; }
.highlight .c1 {
color: #999988;
font-style: italic; }
.highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic; }
.highlight .gd {
color: #000000;
background-color: #ffdddd; }
.highlight .gd .x {
color: #000000;
background-color: #ffaaaa; }
.highlight .ge {
color: #000000;
font-style: italic; }
.highlight .gr {
color: #aa0000; }
.highlight .gh {
color: #999999; }
.highlight .gi {
color: #000000;
background-color: #ddffdd; }
.highlight .gi .x {
color: #000000;
background-color: #aaffaa; }
.highlight .go {
color: #888888; }
.highlight .gp {
color: #555555; }
.highlight .gs {
font-weight: bold; }
.highlight .gu {
color: #aaaaaa; }
.highlight .gt {
color: #aa0000; }
.highlight .kc {
color: #000000;
font-weight: bold; }
.highlight .kd {
color: #000000;
font-weight: bold; }
.highlight .kp {
color: #000000;
font-weight: bold; }
.highlight .kr {
color: #000000;
font-weight: bold; }
.highlight .kt {
color: #445588; }
.highlight .m {
color: #009999; }
.highlight .s {
color: #d14; }
.highlight .na {
color: #008080; }
.highlight .nb {
color: #0086B3; }
.highlight .nc {
color: #445588;
font-weight: bold; }
.highlight .no {
color: #008080; }
.highlight .ni {
color: #800080; }
.highlight .ne {
color: #990000;
font-weight: bold; }
.highlight .nf {
color: #990000; }
.highlight .nn {
color: #555555; }
.highlight .nt {
color: #000080; }
.highlight .nv {
color: #008080; }
.highlight .ow {
color: #000000;
font-weight: bold; }
.highlight .w {
color: #bbbbbb; }
.highlight .mf {
color: #009999; }
.highlight .mh {
color: #009999; }
.highlight .mi {
color: #009999; }
.highlight .mo {
color: #009999; }
.highlight .sb {
color: #d14; }
.highlight .sc {
color: #d14; }
.highlight .sd {
color: #d14; }
.highlight .s2 {
color: #d14; }
.highlight .se {
color: #d14; }
.highlight .sh {
color: #d14; }
.highlight .si {
color: #d14; }
.highlight .sx {
color: #d14; }
.highlight .sr {
color: #009926; }
.highlight .s1 {
color: #d14; }
.highlight .ss {
color: #990073; }
.highlight .bp {
color: #999999; }
.highlight .vc {
color: #008080; }
.highlight .vg {
color: #008080; }
.highlight .vi {
color: #008080; }
.highlight .il {
color: #009999; }
@@ -0,0 +1,331 @@
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
background: transparent;
border: 0;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline; }
body {
background-color: #f2f2f2;
font-family: Helvetica, freesans, Arial, sans-serif;
font-size: 14px;
-webkit-font-smoothing: subpixel-antialiased;
word-wrap: break-word; }
h1, h2, h3 {
margin-top: 0.8em;
margin-bottom: 0.3em;
font-weight: 100;
color: black; }
h1 {
font-size: 2.5em; }
h2 {
font-size: 2em;
border-bottom: 1px solid #e2e2e2; }
h4 {
font-size: 13px;
line-height: 1.5;
margin-top: 21px; }
h5 {
font-size: 1.1em; }
h6 {
font-size: 1.1em;
color: #777; }
.section-name {
color: gray;
display: block;
font-family: Helvetica;
font-size: 22px;
font-weight: 100;
margin-bottom: 15px; }
pre, code {
font: 0.95em Menlo, monospace;
color: #777;
word-wrap: normal; }
p code, li code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px; }
a {
color: #0088cc;
text-decoration: none; }
ul {
padding-left: 15px; }
li {
line-height: 1.8em; }
img {
max-width: 100%; }
blockquote {
margin-left: 0;
padding: 0 10px;
border-left: 4px solid #ccc; }
.content-wrapper {
margin: 0 auto;
width: 980px; }
header {
font-size: 0.85em;
line-height: 26px;
background-color: #414141;
position: fixed;
width: 100%;
z-index: 1; }
header img {
padding-right: 6px;
vertical-align: -4px;
height: 16px; }
header a {
color: #fff; }
header p {
float: left;
color: #999; }
header .header-right {
float: right;
margin-left: 16px; }
#breadcrumbs {
background-color: #f2f2f2;
height: 27px;
padding-top: 17px;
position: fixed;
width: 100%;
z-index: 1;
margin-top: 26px; }
#breadcrumbs #carat {
height: 10px;
margin: 0 5px; }
.sidebar {
background-color: #f9f9f9;
border: 1px solid #e2e2e2;
overflow-y: auto;
overflow-x: hidden;
position: fixed;
top: 70px;
bottom: 0;
width: 230px;
word-wrap: normal; }
.nav-groups {
list-style-type: none;
background: #fff;
padding-left: 0; }
.nav-group-name {
border-bottom: 1px solid #e2e2e2;
font-size: 1.1em;
font-weight: 100;
padding: 15px 0 15px 20px; }
.nav-group-name > a {
color: #333; }
.nav-group-tasks {
margin-top: 5px; }
.nav-group-task {
font-size: 0.9em;
list-style-type: none; }
.nav-group-task a {
color: #888; }
.main-content {
background-color: #fff;
border: 1px solid #e2e2e2;
margin-left: 246px;
position: absolute;
overflow: hidden;
padding-bottom: 60px;
top: 70px;
width: 734px; }
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
margin-bottom: 1em; }
.main-content p {
line-height: 1.8em; }
.main-content section .section:first-child {
margin-top: 0;
padding-top: 0; }
.main-content section .task-group-section .task-group:first-of-type {
padding-top: 10px; }
.main-content section .task-group-section .task-group:first-of-type .section-name {
padding-top: 15px; }
.section {
padding: 0 25px; }
.highlight {
background-color: #eee;
padding: 10px 12px;
border: 1px solid #e2e2e2;
border-radius: 4px;
overflow-x: auto; }
.declaration .highlight {
overflow-x: initial;
padding: 0 40px 40px 0;
margin-bottom: -25px;
background-color: transparent;
border: none; }
.section-name {
margin: 0;
margin-left: 18px; }
.task-group-section {
padding-left: 6px;
border-top: 1px solid #e2e2e2; }
.task-group {
padding-top: 0px; }
.task-name-container a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item {
padding-top: 8px;
width: 100%;
list-style-type: none; }
.item a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item code {
background-color: transparent;
padding: 0; }
.item .token {
padding-left: 3px;
margin-left: 15px;
font-size: 11.9px; }
.item .declaration-note {
font-size: .85em;
color: gray;
font-style: italic; }
.pointer-container {
border-bottom: 1px solid #e2e2e2;
left: -23px;
padding-bottom: 13px;
position: relative;
width: 110%; }
.pointer {
background: #f9f9f9;
border-left: 1px solid #e2e2e2;
border-top: 1px solid #e2e2e2;
height: 12px;
left: 21px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px; }
.height-container {
display: none;
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
overflow: hidden; }
.height-container .section {
background: #f9f9f9;
border-bottom: 1px solid #e2e2e2;
left: -25px;
position: relative;
width: 100%;
padding-top: 10px;
padding-bottom: 5px; }
.aside, .language {
padding: 6px 12px;
margin: 12px 0;
border-left: 5px solid #dddddd;
overflow-y: hidden; }
.aside .aside-title, .language .aside-title {
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
padding-bottom: 0;
margin: 0;
color: #aaa;
-webkit-user-select: none; }
.aside p:last-child, .language p:last-child {
margin-bottom: 0; }
.language {
border-left: 5px solid #cde9f4; }
.language .aside-title {
color: #4b8afb; }
.aside-warning {
border-left: 5px solid #ff6666; }
.aside-warning .aside-title {
color: #ff0000; }
.graybox {
border-collapse: collapse;
width: 100%; }
.graybox p {
margin: 0;
word-break: break-word;
min-width: 50px; }
.graybox td {
border: 1px solid #e2e2e2;
padding: 5px 25px 5px 10px;
vertical-align: middle; }
.graybox tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px; }
.slightly-smaller {
font-size: 0.9em; }
#footer {
position: absolute;
bottom: 10px;
margin-left: 25px; }
#footer p {
margin: 0;
color: #aaa;
font-size: 0.8em; }
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
display: none; }
html.dash .main-content {
width: 980px;
margin-left: 0;
border: none;
width: 100%;
top: 0;
padding-bottom: 0; }
html.dash .height-container {
display: block; }
html.dash .item .token {
margin-left: 0; }
html.dash .content-wrapper {
width: auto; }
html.dash #footer {
position: static; }
Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PaperSwitchDemo Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="PaperSwitchDemo Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="img/carat.png" />
PaperSwitchDemo Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<p><img src="https://raw.githubusercontent.com/Ramotion/paper-switch/master/header.png" alt="header"></p>
<a href='#rampaperswitch' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='rampaperswitch'>RAMPaperSwitch</h1>
<p><a href="https://cocoapods.org/pods/RAMPaperSwitch"><img src="https://img.shields.io/cocoapods/p/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="http://cocoapods.org/pods/RAMPaperSwitch"><img src="https://img.shields.io/cocoapods/v/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="https://cdn.rawgit.com/Ramotion/paper-switch/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="https://github.com/Ramotion/paper-switch"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
<a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a>
<a href="https://travis-ci.org/Ramotion/paper-switch"><img src="https://img.shields.io/travis/Ramotion/paper-switch.svg" alt="Travis"></a></p>
<p>Swift subclass of the UISwitch which paints over the parent view with the <code>onTintColor</code> when the switch is turned on. Implemented concept from <a href="https://dribbble.com/shots/1749645-Contact-Sync">this Dribbble</a> shot by <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">Ramotion</a>.</p>
<a href='#screenshot' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='screenshot'>Screenshot</h1>
<p><img src="https://raw.githubusercontent.com/Ramotion/paper-switch/master/screenshot.gif" alt="PaperSwitch"></p>
<p>The <a href="https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">here</a>.</p>
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
<ul>
<li>iOS 8.0+</li>
<li>Xcode 6.1</li>
</ul>
<a href='#installation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='installation'>Installation</h1>
<p>Just add the <code>RAMPaperSwitch</code> folder to your project.</p>
<p>or use <a href="https://cocoapods.org">CocoaPods</a> with Podfile:
<code>ruby
pod &#39;RAMPaperSwitch&#39;
</code>
or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
<code>
github &quot;Ramotion/paper-switch&quot;
</code></p>
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='usage'>Usage</h1>
<p>RAMPaperSwitch is a drop-in replacement of UISwitch. You just need to set the <code>onTintColor</code> property of the switch, and it will automatically <em>paint over</em> its superview with the selected color.
You have ability to set duration of animation instead of default value.</p>
<ol>
<li><p>Create a new UISwitch in your storyboard or nib.</p></li>
<li><p>Set the class of the UISwitch to RAMPaperSwitch in your Storyboard or nib.</p></li>
<li><p>Set <code>onTintColor</code> for the switch</p></li>
<li><p>Set <code>duration</code> property programmatically if You want to change animation duration.</p></li>
<li><p>Add animation for other views near the switch if need.</p></li>
</ol>
<a href='#animate_views' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='animate_views'>Animate views</h1>
<p>You can animate other views near the switch. For example, you can change color to views or labels that are inside the same superview. Duration of animation can be gotten from the RAMPaperSwitch&rsquo;s property <code>duration</code>. You can animate CoreAnimation properties like this:</p>
<pre class="highlight swift"><code><span class="k">self</span><span class="o">.</span><span class="n">paperSwitch</span><span class="o">.</span><span class="n">animationDidStartClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="k">in</span>
<span class="kt">UIView</span><span class="o">.</span><span class="nf">transitionWithView</span><span class="p">(</span><span class="k">self</span><span class="o">.</span><span class="n">label</span><span class="p">,</span> <span class="nv">duration</span><span class="p">:</span> <span class="k">self</span><span class="o">.</span><span class="n">paperSwitch</span><span class="o">.</span><span class="n">duration</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="kt">UIViewAnimationOptions</span><span class="o">.</span><span class="kt">TransitionCrossDissolve</span><span class="p">,</span> <span class="nv">animations</span><span class="p">:</span> <span class="p">{</span>
<span class="k">self</span><span class="o">.</span><span class="n">label</span><span class="o">.</span><span class="n">textColor</span> <span class="o">=</span> <span class="n">onAnimation</span> <span class="p">?</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">whiteColor</span><span class="p">()</span> <span class="p">:</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">blueColor</span><span class="p">()</span>
<span class="p">},</span> <span class="nv">completion</span><span class="p">:</span><span class="kc">nil</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">Ramotion Inc.</a>
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">hire</a> us to design, develop, and grow your product.</p>
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/paper-switch"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
@@ -0,0 +1,40 @@
window.jazzy = {'docset': false}
if (typeof window.dash != 'undefined') {
document.documentElement.className += ' dash'
window.jazzy.docset = true
}
if (navigator.userAgent.match(/xcode/i)) {
document.documentElement.className += ' xcode'
window.jazzy.docset = true
}
// On doc load, toggle the URL hash discussion if present
$(document).ready(function() {
if (!window.jazzy.docset) {
var linkToHash = $('a[href="' + window.location.hash +'"]');
linkToHash.trigger("click");
}
});
// On token click, toggle its discussion and animate token.marginLeft
$(".token").click(function(event) {
if (window.jazzy.docset) {
return;
}
var link = $(this);
var animationDuration = 300;
var tokenOffset = "15px";
var original = link.css('marginLeft') == tokenOffset;
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
$content = link.parent().parent().next();
$content.slideToggle(animationDuration);
// Keeps the document from jumping to the hash.
var href = $(this).attr('href');
if (history.pushState) {
history.pushState({}, '', href);
} else {
location.hash = href;
}
event.preventDefault();
});
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+116
View File
@@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PaperSwitchDemo Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="PaperSwitchDemo Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">PaperSwitchDemo Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">PaperSwitchDemo Reference</a>
<img id="carat" src="img/carat.png" />
PaperSwitchDemo Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/RAMPaperSwitch.html">RAMPaperSwitch</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<p><img src="https://raw.githubusercontent.com/Ramotion/paper-switch/master/header.png" alt="header"></p>
<a href='#rampaperswitch' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='rampaperswitch'>RAMPaperSwitch</h1>
<p><a href="https://cocoapods.org/pods/RAMPaperSwitch"><img src="https://img.shields.io/cocoapods/p/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="http://cocoapods.org/pods/RAMPaperSwitch"><img src="https://img.shields.io/cocoapods/v/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="https://cdn.rawgit.com/Ramotion/paper-switch/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/RAMPaperSwitch.svg" alt="CocoaPods"></a>
<a href="https://github.com/Ramotion/paper-switch"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
<a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a>
<a href="https://travis-ci.org/Ramotion/paper-switch"><img src="https://img.shields.io/travis/Ramotion/paper-switch.svg" alt="Travis"></a></p>
<p>Swift subclass of the UISwitch which paints over the parent view with the <code>onTintColor</code> when the switch is turned on. Implemented concept from <a href="https://dribbble.com/shots/1749645-Contact-Sync">this Dribbble</a> shot by <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">Ramotion</a>.</p>
<a href='#screenshot' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='screenshot'>Screenshot</h1>
<p><img src="https://raw.githubusercontent.com/Ramotion/paper-switch/master/screenshot.gif" alt="PaperSwitch"></p>
<p>The <a href="https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-plus-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">here</a>.</p>
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
<ul>
<li>iOS 8.0+</li>
<li>Xcode 6.1</li>
</ul>
<a href='#installation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='installation'>Installation</h1>
<p>Just add the <code>RAMPaperSwitch</code> folder to your project.</p>
<p>or use <a href="https://cocoapods.org">CocoaPods</a> with Podfile:
<code>ruby
pod &#39;RAMPaperSwitch&#39;
</code>
or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
<code>
github &quot;Ramotion/paper-switch&quot;
</code></p>
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='usage'>Usage</h1>
<p>RAMPaperSwitch is a drop-in replacement of UISwitch. You just need to set the <code>onTintColor</code> property of the switch, and it will automatically <em>paint over</em> its superview with the selected color.
You have ability to set duration of animation instead of default value.</p>
<ol>
<li><p>Create a new UISwitch in your storyboard or nib.</p></li>
<li><p>Set the class of the UISwitch to RAMPaperSwitch in your Storyboard or nib.</p></li>
<li><p>Set <code>onTintColor</code> for the switch</p></li>
<li><p>Set <code>duration</code> property programmatically if You want to change animation duration.</p></li>
<li><p>Add animation for other views near the switch if need.</p></li>
</ol>
<a href='#animate_views' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='animate_views'>Animate views</h1>
<p>You can animate other views near the switch. For example, you can change color to views or labels that are inside the same superview. Duration of animation can be gotten from the RAMPaperSwitch&rsquo;s property <code>duration</code>. You can animate CoreAnimation properties like this:</p>
<pre class="highlight swift"><code><span class="k">self</span><span class="o">.</span><span class="n">paperSwitch</span><span class="o">.</span><span class="n">animationDidStartClosure</span> <span class="o">=</span> <span class="p">{(</span><span class="nv">onAnimation</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="k">in</span>
<span class="kt">UIView</span><span class="o">.</span><span class="nf">transitionWithView</span><span class="p">(</span><span class="k">self</span><span class="o">.</span><span class="n">label</span><span class="p">,</span> <span class="nv">duration</span><span class="p">:</span> <span class="k">self</span><span class="o">.</span><span class="n">paperSwitch</span><span class="o">.</span><span class="n">duration</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="kt">UIViewAnimationOptions</span><span class="o">.</span><span class="kt">TransitionCrossDissolve</span><span class="p">,</span> <span class="nv">animations</span><span class="p">:</span> <span class="p">{</span>
<span class="k">self</span><span class="o">.</span><span class="n">label</span><span class="o">.</span><span class="n">textColor</span> <span class="o">=</span> <span class="n">onAnimation</span> <span class="p">?</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">whiteColor</span><span class="p">()</span> <span class="p">:</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">blueColor</span><span class="p">()</span>
<span class="p">},</span> <span class="nv">completion</span><span class="p">:</span><span class="kc">nil</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">Ramotion Inc.</a>
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=paper-switch">hire</a> us to design, develop, and grow your product.</p>
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/paper-switch"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
+40
View File
@@ -0,0 +1,40 @@
window.jazzy = {'docset': false}
if (typeof window.dash != 'undefined') {
document.documentElement.className += ' dash'
window.jazzy.docset = true
}
if (navigator.userAgent.match(/xcode/i)) {
document.documentElement.className += ' xcode'
window.jazzy.docset = true
}
// On doc load, toggle the URL hash discussion if present
$(document).ready(function() {
if (!window.jazzy.docset) {
var linkToHash = $('a[href="' + window.location.hash +'"]');
linkToHash.trigger("click");
}
});
// On token click, toggle its discussion and animate token.marginLeft
$(".token").click(function(event) {
if (window.jazzy.docset) {
return;
}
var link = $(this);
var animationDuration = 300;
var tokenOffset = "15px";
var original = link.css('marginLeft') == tokenOffset;
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
$content = link.parent().parent().next();
$content.slideToggle(animationDuration);
// Keeps the document from jumping to the hash.
var href = $(this).attr('href');
if (history.pushState) {
history.pushState({}, '', href);
} else {
location.hash = href;
}
event.preventDefault();
});
Vendored Executable
+4
View File
File diff suppressed because one or more lines are too long
View File
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB