├── CRRulerControl ├── Classes │ ├── .gitkeep │ ├── CRRulerLayer.h │ ├── CRMark.h │ ├── CRMark.m │ ├── CRRulerLayer.m │ ├── CRRulerControl.h │ └── CRRulerControl.m └── 1.0.0 │ └── CRRulerControl.podspec ├── _Pods.xcodeproj ├── Example ├── Tests │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── Tests-Prefix.pch │ ├── Tests-Info.plist │ └── Tests.m ├── CRRulerControl │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── GSTouchImage.png │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── image.imageset │ │ │ ├── image.png │ │ │ ├── image@2х.png.png │ │ │ ├── image@3x.png.png │ │ │ └── Contents.json │ │ ├── ic_done.imageset │ │ │ ├── ic_done.png │ │ │ ├── ic_done@2x.png.png │ │ │ ├── ic_done@3x.png.png │ │ │ └── Contents.json │ │ ├── ic_settings.imageset │ │ │ ├── ic_settings.png │ │ │ ├── ic_settings@2x.png.png │ │ │ ├── ic_settings@3x.png.png │ │ │ └── Contents.json │ │ ├── pointer.imageset │ │ │ ├── red_line_png_by_juliisweetunicorn-d603lvp-1.png │ │ │ ├── red_line_png_by_juliisweetunicorn-d603lvp-2.png │ │ │ ├── red_line_png_by_juliisweetunicorn-d603lvp-3.png │ │ │ └── Contents.json │ │ ├── triangle.imageset │ │ │ ├── red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart.png │ │ │ ├── red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-1.png │ │ │ ├── red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-2.png │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── GSTouchImage@2x.png │ ├── CRViewController.h │ ├── CRAppDelegate.h │ ├── main.m │ ├── CRRulerControl-Prefix.pch │ ├── CRRulerControl-Info.plist │ ├── CRAppDelegate.m │ ├── LaunchScreen.storyboard │ ├── CRViewController.m │ └── Main.storyboard ├── Pods │ ├── Target Support Files │ │ ├── CRRulerControl │ │ │ ├── CRRulerControl-prefix.pch │ │ │ ├── CRRulerControl.modulemap │ │ │ ├── CRRulerControl-dummy.m │ │ │ ├── CRRulerControl-umbrella.h │ │ │ ├── CRRulerControl.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-CRRulerControl_Tests │ │ │ ├── Pods-CRRulerControl_Tests-acknowledgements.markdown │ │ │ ├── Pods-CRRulerControl_Tests.modulemap │ │ │ ├── Pods-CRRulerControl_Tests-dummy.m │ │ │ ├── Pods-CRRulerControl_Tests-umbrella.h │ │ │ ├── Pods-CRRulerControl_Tests.debug.xcconfig │ │ │ ├── Pods-CRRulerControl_Tests.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-CRRulerControl_Tests-acknowledgements.plist │ │ │ ├── Pods-CRRulerControl_Tests-frameworks.sh │ │ │ └── Pods-CRRulerControl_Tests-resources.sh │ │ └── Pods-CRRulerControl_Example │ │ │ ├── Pods-CRRulerControl_Example.modulemap │ │ │ ├── Pods-CRRulerControl_Example-dummy.m │ │ │ ├── Pods-CRRulerControl_Example-umbrella.h │ │ │ ├── Pods-CRRulerControl_Example.debug.xcconfig │ │ │ ├── Pods-CRRulerControl_Example.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-CRRulerControl_Example-acknowledgements.markdown │ │ │ ├── Pods-CRRulerControl_Example-acknowledgements.plist │ │ │ ├── Pods-CRRulerControl_Example-frameworks.sh │ │ │ └── Pods-CRRulerControl_Example-resources.sh │ ├── Manifest.lock │ ├── Local Podspecs │ │ └── CRRulerControl.podspec.json │ └── Pods.xcodeproj │ │ └── xcuserdata │ │ └── chuchukalo_cr.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ ├── CRRulerControl.xcscheme │ │ ├── Pods-CRRulerControl_Tests.xcscheme │ │ └── Pods-CRRulerControl_Example.xcscheme ├── Podfile ├── CRRulerControl.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── chuchukalo_cr.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcuserdata │ │ └── chuchukalo_cr.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── CRRulerControl-Example.xcscheme │ └── project.pbxproj ├── CRRulerControl.xcworkspace │ ├── xcuserdata │ │ └── chuchukalo_cr.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── contents.xcworkspacedata └── Podfile.lock ├── images ├── demo.gif ├── header.jpg └── logo-footer.png ├── RulerControl.xcodeproj ├── project.xcworkspace │ └── xcuserdata │ │ └── chuchukalo_cr.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── chuchukalo_cr.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── RulerControl.xcscheme ├── CRRulerControl.podspec ├── LICENSE └── README.md /CRRulerControl/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/images/demo.gif -------------------------------------------------------------------------------- /images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/images/header.jpg -------------------------------------------------------------------------------- /Example/CRRulerControl/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /images/logo-footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/images/logo-footer.png -------------------------------------------------------------------------------- /Example/CRRulerControl/GSTouchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/GSTouchImage.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/CRRulerControl-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/CRRulerControl/GSTouchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/GSTouchImage@2x.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/image.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/image.imageset/image.png -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/image.imageset/image@2х.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/image.imageset/image@2х.png.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/image.imageset/image@3x.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/image.imageset/image@3x.png.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done@2x.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done@2x.png.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done@3x.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_done.imageset/ic_done@3x.png.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/CRRulerControl.modulemap: -------------------------------------------------------------------------------- 1 | framework module CRRulerControl { 2 | umbrella header "CRRulerControl-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/CRRulerControl-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CRRulerControl : NSObject 3 | @end 4 | @implementation PodsDummy_CRRulerControl 5 | @end 6 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings@2x.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings@2x.png.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings@3x.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/ic_settings.imageset/ic_settings@3x.png.png -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'CRRulerControl_Example' do 4 | pod 'CRRulerControl', :path => '../' 5 | 6 | target 'CRRulerControl_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CRRulerControl_Tests { 2 | umbrella header "Pods-CRRulerControl_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/CRRulerControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/CRRulerControl.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-1.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-2.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/pointer.imageset/red_line_png_by_juliisweetunicorn-d603lvp-3.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CRRulerControl_Example { 2 | umbrella header "Pods-CRRulerControl_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CRRulerControl_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CRRulerControl_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CRRulerControl_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CRRulerControl_Example 5 | @end 6 | -------------------------------------------------------------------------------- /RulerControl.xcodeproj/project.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/RulerControl.xcodeproj/project.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_CRRulerControl_TestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_CRRulerControl_TestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/CRRulerControl.xcodeproj/project.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl.xcodeproj/project.xcworkspace/xcuserdata/chuchukalo_cr.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_CRRulerControl_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_CRRulerControl_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/CRRulerControl/CRViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRViewController.h 3 | // CRRulerControl 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | @import UIKit; 10 | 11 | @interface CRViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-1.png -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cleveroad/CRRulerControl/HEAD/Example/CRRulerControl/Images.xcassets/triangle.imageset/red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-2.png -------------------------------------------------------------------------------- /Example/CRRulerControl.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/CRRulerControl-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "CRMark.h" 4 | #import "CRRulerControl.h" 5 | #import "CRRulerLayer.h" 6 | 7 | FOUNDATION_EXPORT double CRRulerControlVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char CRRulerControlVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CRRulerControl (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - CRRulerControl (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | CRRulerControl: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | CRRulerControl: f98f07bc98906bedbb46e6c1751bd9a07b914b67 13 | 14 | PODFILE CHECKSUM: c460c86759e3e5ae0f43108712c93f17419ede12 15 | 16 | COCOAPODS: 1.0.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CRRulerControl (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - CRRulerControl (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | CRRulerControl: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | CRRulerControl: f98f07bc98906bedbb46e6c1751bd9a07b914b67 13 | 14 | PODFILE CHECKSUM: c460c86759e3e5ae0f43108712c93f17419ede12 15 | 16 | COCOAPODS: 1.0.1 17 | -------------------------------------------------------------------------------- /Example/CRRulerControl/CRAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRAppDelegate.h 3 | // CRRulerControl 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | @import UIKit; 10 | 11 | @interface CRAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/CRRulerControl/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CRRulerControl 4 | // 5 | // Created by Sergey on 08/25/2016. 6 | // Copyright (c) 2016 Sergey. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "CRAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CRAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/CRRulerControl/CRRulerControl-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/CRRulerControl.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CRRulerControl 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "image.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "image@2х.png.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "image@3x.png.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_done.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_done.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_done@2x.png.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_done@3x.png.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/ic_settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_settings.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_settings@2x.png.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_settings@3x.png.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/CRRulerControl.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SuppressBuildableAutocreation 6 | 7 | 6003F589195388D20070C39A 8 | 9 | primary 10 | 11 | 12 | 6003F5AD195388D20070C39A 13 | 14 | primary 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl/CRRulerControl.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl/CRRulerControl.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRRulerLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRRulerLayer.h 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import 10 | #import "CRMark.h" 11 | 12 | @interface CRRulerLayer : CALayer 13 | 14 | typedef struct CRRange { 15 | CGFloat location; 16 | CGFloat length; 17 | } CRRange; 18 | 19 | @property (nonatomic) CRRange rulerRange; 20 | 21 | @property (nonatomic) CRMark *minorMark; 22 | @property (nonatomic) CRMark *middleMark; 23 | @property (nonatomic) CRMark *majorMark; 24 | 25 | @end -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/pointer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "red_line_png_by_juliisweetunicorn-d603lvp-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "red_line_png_by_juliisweetunicorn-d603lvp-3.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "red_line_png_by_juliisweetunicorn-d603lvp-1.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl/CRRulerControl.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "CRRulerControl" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CRRulerControl/CRRulerControl.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "CRRulerControl" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /RulerControl.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RulerControl.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F5844E1A1C7B422400F551B4 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/CRRulerControl.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CRRulerControl", 3 | "version": "0.1.0", 4 | "summary": "A short description of CRRulerControl.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com//CRRulerControl", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Sergey": "Chuchukalo.cr@gmail.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com//CRRulerControl.git", 16 | "tag": "0.1.0" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "CRRulerControl/Classes/**/*" 22 | } 23 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/triangle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "red-triangle-free-images-at-clker-com-vector-clip-art-online-0W8cqq-clipart-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRRulerControlTests.m 3 | // CRRulerControlTests 4 | // 5 | // Created by Sergey on 08/25/2016. 6 | // Copyright (c) 2016 Sergey. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRMark.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRMark.h 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import 10 | 11 | @interface CRMark : NSObject 12 | 13 | typedef NS_ENUM(NSUInteger, CRRulerMarkAlignment) { 14 | CRRulerMarkAlignmentBottom = 0, 15 | CRRulerMarkAlignmentCenter, 16 | CRRulerMarkAlignmentTop, 17 | }; 18 | 19 | @property (nonatomic) CGFloat frequency; 20 | @property (nonatomic) CGSize size; 21 | @property (nonatomic) UIColor *color; 22 | @property (nonatomic) UIFont *font; 23 | @property (nonatomic) UIColor *textColor; 24 | @property (nonatomic) CRRulerMarkAlignment alignment; 25 | @property (nonatomic) CRRulerMarkAlignment textAlignment; 26 | @property (nonatomic) CGPoint textOffset; 27 | @property (nonatomic) CGPoint offset; 28 | 29 | @end -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/CRRulerControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /CRRulerControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "CRRulerControl" 4 | s.version = "1.0.0" 5 | s.summary = "A CocoaPod that simplifies the process of setting and reading values from the ruler. Supplied with UIControl subclass." 6 | s.description = <<-DESC 7 | A CocoaPod that simplifies the process of setting and reading values from the ruler. Supplied with UIControl subclass. 8 | DESC 9 | 10 | s.homepage = "https://github.com/Cleveroad/CRRulerControl" 11 | s.screenshots = "https://raw.githubusercontent.com/Cleveroad/CRRulerControl/master/images/header.jpg", "https://raw.githubusercontent.com/Cleveroad/CRRulerControl/master/images/demo.gif" 12 | s.license = "MIT" 13 | s.author = { "Sergey" => "Chuchukalo.cr@gmail.com" } 14 | s.source = { :git => "https://github.com/Cleveroad/CRRulerControl.git", :tag => "1.0.0" } 15 | s.platform = :ios, "8.0" 16 | s.requires_arc = true 17 | s.source_files = 'CRRulerControl/Classes/**/*.{h,m}' 18 | 19 | end 20 | -------------------------------------------------------------------------------- /CRRulerControl/1.0.0/CRRulerControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "CRRulerControl" 4 | s.version = "1.0.0" 5 | s.summary = "A CocoaPod that simplifies the process of setting and reading values from the ruler. Supplied with UIControl subclass." 6 | s.description = <<-DESC 7 | A CocoaPod that simplifies the process of setting and reading values from the ruler. Supplied with UIControl subclass. 8 | DESC 9 | 10 | s.homepage = "https://github.com/Cleveroad/CRRulerControl" 11 | s.screenshots = "https://raw.githubusercontent.com/Cleveroad/CRRulerControl/master/images/header.jpg", "https://raw.githubusercontent.com/Cleveroad/CRRulerControl/master/images/demo.gif" 12 | s.license = "MIT" 13 | s.author = { "Sergey" => "Chuchukalo.cr@gmail.com" } 14 | s.source = { :git => "https://github.com/Cleveroad/CRRulerControl.git", :tag => "1.0.0" } 15 | s.platform = :ios, "8.0" 16 | s.requires_arc = true 17 | s.source_files = 'CRRulerControl/Classes/**/*.{h,m}' 18 | 19 | end -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRMark.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRMark.m 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import "CRMark.h" 10 | 11 | @implementation CRMark 12 | 13 | - (instancetype)init { 14 | self = [super init]; 15 | if (self) { 16 | self.frequency = 1.0; // default frequency for minor mark 17 | self.size = CGSizeMake(1.0, 5.0); // default size for minor lines mark 18 | self.color = [UIColor blackColor]; // default color set in RullerControl (is Tint Color) 19 | self.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; // default font for all text mark 20 | self.textColor = [UIColor blackColor]; // default color set in RullerControl (is Tint Color) 21 | self.alignment = CRRulerMarkAlignmentCenter; 22 | self.textAlignment = CRRulerMarkAlignmentBottom; 23 | self.offset = CGPointZero; 24 | self.textOffset = CGPointZero; 25 | } 26 | return self; 27 | } 28 | 29 | @end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Sergey 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CRRulerControl.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-CRRulerControl_Example.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-CRRulerControl_Tests.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 23CE4647591C91D95338D5E9CD9D029D 26 | 27 | primary 28 | 29 | 30 | 32CB51E50529AEF689D11528DD8245C5 31 | 32 | primary 33 | 34 | 35 | 6159CA9436C5BCC1423C9E1052959B71 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CRRulerControl 5 | 6 | Copyright (c) 2016 Sergey 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/CRRulerControl/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /Example/CRRulerControl/CRRulerControl-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/CRRulerControl/CRAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRAppDelegate.m 3 | // CRRulerControl 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import "CRAppDelegate.h" 10 | 11 | @implementation CRAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | // Override point for customization after application launch. 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application { 19 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 20 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 21 | } 22 | 23 | - (void)applicationDidEnterBackground:(UIApplication *)application { 24 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 25 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 26 | } 27 | 28 | - (void)applicationWillEnterForeground:(UIApplication *)application { 29 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 30 | } 31 | 32 | - (void)applicationDidBecomeActive:(UIApplication *)application { 33 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 34 | } 35 | 36 | - (void)applicationWillTerminate:(UIApplication *)application { 37 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 38 | 39 | } 40 | 41 | @end -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2016 Sergey <Chuchukalo.cr@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | CRRulerControl 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - https://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/CRRulerControl.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/Pods-CRRulerControl_Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/Pods-CRRulerControl_Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /RulerControl.xcodeproj/xcuserdata/chuchukalo_cr.xcuserdatad/xcschemes/RulerControl.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/CRRulerControl/CRRulerControl.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "$BUILT_PRODUCTS_DIR/CRRulerControl/CRRulerControl.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Example/CRRulerControl.xcodeproj/xcshareddata/xcschemes/CRRulerControl-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/CRRulerControl/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Example/CRRulerControl/CRViewController.m: -------------------------------------------------------------------------------- 1 | 2 | // CRViewController.m 3 | // CRRulerControl 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import "CRViewController.h" 10 | #import "CRRulerControl.h" 11 | 12 | @interface CRViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet CRRulerControl *rulerView; 15 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 16 | @property (weak, nonatomic) IBOutlet UIView *editView; 17 | @property (weak, nonatomic) IBOutlet UILabel *widthLabel; 18 | @property (weak, nonatomic) IBOutlet UILabel *fromLabel; 19 | @property (weak, nonatomic) IBOutlet UILabel *lengthLabel; 20 | @property (weak, nonatomic) IBOutlet UILabel *frequencyLabel; 21 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBarButtonItem; 22 | @end 23 | 24 | @implementation CRViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | self.widthLabel.text = [NSNumber numberWithFloat:self.rulerView.rulerWidth].stringValue; 30 | self.fromLabel.text = [NSNumber numberWithFloat:self.rulerView.rangeFrom].stringValue; 31 | self.lengthLabel.text = [NSNumber numberWithFloat:self.rulerView.rangeLength].stringValue; 32 | self.frequencyLabel.text = [NSNumber numberWithFloat:[self.rulerView frequencyForMarkType:CRRulerMarkTypeMinor]].stringValue; 33 | self.imageView.layer.zPosition = -1000; 34 | [self setEditing:NO animated:NO]; 35 | UIImage *image = [self createImageWithColor:[UIColor whiteColor]]; 36 | [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; 37 | [self.navigationController.navigationBar setShadowImage:image]; 38 | self.editView.layer.shadowColor = [UIColor lightGrayColor].CGColor; 39 | self.editView.layer.shadowOffset = CGSizeMake(0, 2); 40 | self.editView.layer.shadowOpacity = 1; 41 | self.editView.layer.shadowRadius = 1.0; 42 | self.rulerView.pointerImageView.layer.cornerRadius = 2; 43 | } 44 | 45 | - (UIImage *) createImageWithColor:(UIColor *)color { 46 | UIGraphicsBeginImageContext(CGSizeMake(5, 5)); 47 | UIBezierPath* rPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 5, 5)]; 48 | [color setFill]; 49 | [rPath fill]; 50 | UIImage *clearImage = UIGraphicsGetImageFromCurrentImageContext(); 51 | UIGraphicsEndImageContext(); 52 | return clearImage; 53 | } 54 | 55 | - (void)setEditing:(BOOL)editing animated:(BOOL)animated { 56 | [super setEditing:editing animated:animated]; 57 | 58 | UIImage *buttonImage = editing ? [UIImage imageNamed:@"ic_done"] : [UIImage imageNamed:@"ic_settings"]; 59 | NSTimeInterval duration = animated ? 0.5 : 0.0; 60 | [self.menuBarButtonItem setImage:buttonImage]; 61 | CGAffineTransform transform = editing ? CGAffineTransformIdentity : CGAffineTransformMakeTranslation(0, - self.editView.frame.size.height - 100); 62 | [UIView animateWithDuration:duration 63 | delay:0 64 | usingSpringWithDamping:0.6f 65 | initialSpringVelocity:0 66 | options:UIViewAnimationOptionBeginFromCurrentState 67 | animations:^{ 68 | self.editView.transform = transform; 69 | } completion:nil]; 70 | } 71 | 72 | #pragma mark - Actions 73 | 74 | - (IBAction)rulerValueChaned:(CRRulerControl *)sender { 75 | NSLog(@"value = %f",sender.value); 76 | CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; 77 | rotationAndPerspectiveTransform.m34 = 1.0 / -500; 78 | rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, sender.value * M_PI / 180, 0.0f, 1.0f, 0.0f); 79 | self.imageView.layer.transform = rotationAndPerspectiveTransform; 80 | } 81 | 82 | - (IBAction)rulerWidthValueChanged:(UISlider *)sender { 83 | self.rulerView.rulerWidth = roundf(sender.value); 84 | self.widthLabel.text = [NSNumber numberWithFloat:roundf(sender.value)].stringValue; 85 | } 86 | 87 | - (IBAction)frequencyValueChange:(UISlider *)sender { 88 | [self.rulerView setFrequency:roundf(sender.value) forMarkType:CRRulerMarkTypeMinor]; 89 | self.frequencyLabel.text = [NSNumber numberWithFloat:roundf(sender.value)].stringValue; 90 | } 91 | 92 | - (IBAction)rulerFromValueChanged:(UISlider *)sender { 93 | self.rulerView.rangeFrom = roundf(sender.value); 94 | self.fromLabel.text = [NSNumber numberWithFloat:roundf(sender.value)].stringValue; 95 | } 96 | 97 | - (IBAction)rulerLengthCalueChanged:(UISlider *)sender { 98 | self.rulerView.rangeLength = roundf(sender.value); 99 | self.lengthLabel.text = [NSNumber numberWithFloat:roundf(sender.value)].stringValue; 100 | } 101 | 102 | - (IBAction)barButtonItemTouchDown:(UIBarButtonItem *)sender { 103 | [self setEditing:!self.isEditing animated:YES]; 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CRRulerControl [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) 2 | 3 | [![CI Status](http://img.shields.io/travis/Sergey/CRRulerControl.svg?style=flat)](https://travis-ci.org/Sergey/CRRulerControl) [![Version](https://img.shields.io/cocoapods/v/CRRulerControl.svg?style=flat)](http://cocoapods.org/pods/CRRulerControl) [![License](https://img.shields.io/cocoapods/l/CRRulerControl.svg?style=flat)](http://cocoapods.org/pods/CRRulerControl) [![Platform](https://img.shields.io/cocoapods/p/CRRulerControl.svg?style=flat)](http://cocoapods.org/pods/CRRulerControl) 4 | 5 | ![Header image](/images/header.jpg) 6 | 7 | ## Meet CRRulerControl - Customizable Control for iOS 8 | 9 | Cleveroad is happy to present a new library for iOS apps — CRRulerControl. Whether your app is going to operate over graphics or any scalable elements, ruler is crucial to provide users convenience and enhance their experience. Customizable component, created by Cleveroad iOS developers, is aimed at turning a simple ruler into a handy and smart instrument. 10 | 11 | ![Demo image](/images/demo.gif) 12 | 13 | #####Check out the animation of CRRulerControl for iOS on YouTube in HD quality. 14 | 15 | If you are ready to take a fresh look at traditional control elements, start with the Ruler. Integrate your iOS app with CRRulerControl library and try out all the benefits it provides. 16 | 17 | 18 | [![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts) 19 |
20 | 21 | A CocoaPod that simplifies the process of setting and reading values from the ruler. 22 | 23 | Creating control elements is rather a simple task. However, it may take fairly large amount of time. To save this time, Cleveroad has created one of the control elements called CRRulerControl. CRRulerControl is a UIControl that can adjust to any your requirements in just a few seconds. 24 | 25 | ## Requirements 26 | * iOS 8 or higher 27 | 28 | ## Example 29 | 30 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 31 | 32 | ## Installation 33 | 34 | CRRulerControl is available through [CocoaPods](http://cocoapods.org). To install 35 | it, simply add the following line to your Podfile: 36 | 37 | ``` 38 | pod "CRRulerControl" 39 | ``` 40 | and run pod install in terminal. 41 | Usage 42 | 43 | ## CRRulerControl 44 | ####You can use storyboard to create a control element. 45 | 46 | ```c 47 | //Setting the distance between the minimal marks. 48 | - @property (nonatomic) IBInspectable CGFloat spacingBetweenMarks; 49 | 50 | //Setting ruler width 51 | - @property (nonatomic) IBInspectable CGFloat rulerWidth; 52 | 53 | //Setting the minimum value 54 | - @property (nonatomic) IBInspectable CGFloat rangeFrom; 55 | 56 | //Setting the length of liner 57 | - @property (nonatomic) IBInspectable CGFloat rangeLength; 58 | 59 | //Setting value. 60 | - @property (nonatomic) IBInspectable CGFloat value; 61 | 62 | //Setting image of pointer 63 | - @property (nonatomic, readonly) UIImageView *pointerImageView; 64 | 65 | - @property (nonatomic, readonly) UIScrollView *scrollView; 66 | 67 | //Setting with animation or without it. 68 | - (void)setValue:(CGFloat)value animated:(BOOL)animated; 69 | 70 | - (CGRect)frameForPointerImageView; 71 | 72 | - (CGPoint)contentOffsetForValue:(CGFloat)value; 73 | 74 | //To set the size of the lines 75 | - (void)setSize:(CGSize)size forMarkType:(CRRulerMarkType)markType; 76 | 77 | //To set the color of the lines 78 | - (void)setColor:(UIColor *)color forMarkType:(CRRulerMarkType)markType; 79 | 80 | //To set the text of the lines 81 | - (void)setTextColor:(UIColor *)textColor forMarkType:(CRRulerMarkType)markType; 82 | 83 | //To set the font to the text 84 | - (void)setFont:(UIFont *)font forMarkType:(CRRulerMarkType)markType; 85 | 86 | //To set the frequency of lines appearance 87 | - (void)setFrequency:(CGFloat)frequency forMarkType:(CRRulerMarkType)markType; 88 | ``` 89 | ## Example 90 | 91 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 92 | 93 | 94 | ## Support 95 | 96 | If you have any other questions regarding the use of this library, please contact us for support at info@cleveroad.com (email subject: "CRRulerControl. Support request.") 97 | 98 | ## Author 99 | 100 | [Sergey Chuchukalo](Chuchukalo.cr@gmail.com) 101 | 102 | ## License 103 | 104 | The MIT License (MIT) 105 | 106 | Copyright (c) 2016 Cleveroad Inc. 107 | 108 | Permission is hereby granted, free of charge, to any person obtaining a copy 109 | of this software and associated documentation files (the "Software"), to deal 110 | in the Software without restriction, including without limitation the rights 111 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 112 | copies of the Software, and to permit persons to whom the Software is 113 | furnished to do so, subject to the following conditions: 114 | 115 | The above copyright notice and this permission notice shall be included in all 116 | copies or substantial portions of the Software. 117 | 118 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 119 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 120 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 121 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 122 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 123 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 124 | SOFTWARE. 125 | -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRRulerLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRRulerLayer.m 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import "CRRulerLayer.h" 10 | 11 | static const CGFloat kScreenSeparatorPositionToTextAndLines = 0.66; 12 | static const CGFloat kDefaultFrequencyForMajorMark = 10; 13 | static const CGFloat kDefaultFrequencyForMiddleMark = 5; 14 | static const CGFloat kSideOffset = 30.0; 15 | static const CGSize kMiddleMarkSize = {1, 15}; 16 | static const CGSize kMajorMarkSize = {1, 30}; 17 | 18 | @implementation CRRulerLayer 19 | 20 | // in init code init and set default value for different style of marks 21 | - (instancetype)init { 22 | if (self = [super init]) { 23 | self.minorMark = [CRMark new]; 24 | self.minorMark.textColor = [UIColor clearColor]; // set default text color 25 | self.middleMark = [CRMark new]; 26 | self.middleMark.frequency = kDefaultFrequencyForMiddleMark; // set default frequency 27 | self.middleMark.size = kMiddleMarkSize; // set dafault size 28 | self.majorMark = [CRMark new]; 29 | self.majorMark.frequency = kDefaultFrequencyForMajorMark; // set default frequency 30 | self.majorMark.size = kMajorMarkSize; // set dafault size 31 | } 32 | return self; 33 | } 34 | 35 | // setters where code checking valid value 36 | - (void)setRulerRange:(CRRange)rulerRange { 37 | _rulerRange = rulerRange; 38 | if (rulerRange.length > 0.0) { 39 | [self setNeedsDisplay]; 40 | } 41 | } 42 | - (void)setFrame:(CGRect)frame { 43 | if (!CGRectEqualToRect(frame, self.frame)) { 44 | super.frame = frame; 45 | [self setNeedsDisplay]; 46 | } 47 | } 48 | 49 | // in drawToImage code set position where need draw marks 50 | - (void)drawToImage { 51 | NSUInteger numberOfLines = ceilf(self.rulerRange.length / [NSNumber numberWithFloat:self.minorMark.frequency].doubleValue); 52 | NSUInteger numberOfLinesToZeroForMajor; 53 | NSUInteger numberOfLinesToZeroForMiddle; 54 | if (self.rulerRange.location >= 0) { 55 | numberOfLinesToZeroForMajor = self.rulerRange.location / [NSNumber numberWithFloat:self.minorMark.frequency].doubleValue; 56 | numberOfLinesToZeroForMiddle = self.rulerRange.location / [NSNumber numberWithFloat:self.minorMark.frequency].doubleValue; 57 | } else { 58 | numberOfLinesToZeroForMajor = ceilf((-self.rulerRange.location * self.majorMark.frequency + self.rulerRange.location) / [NSNumber numberWithFloat:self.minorMark.frequency].doubleValue); 59 | numberOfLinesToZeroForMiddle = ceilf((-self.rulerRange.location * self.middleMark.frequency + self.rulerRange.location) / [NSNumber numberWithFloat:self.minorMark.frequency].doubleValue); 60 | } 61 | UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, [UIScreen mainScreen].scale); 62 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 63 | CGFloat lineOffset = (self.frame.size.width - kSideOffset * 2) / numberOfLines; 64 | NSMutableArray *arrayWithTypeMarks = [NSMutableArray arrayWithCapacity:numberOfLines]; 65 | NSNumberFormatter *textMarkFormater = [NSNumberFormatter new]; 66 | textMarkFormater.numberStyle = NSNumberFormatterDecimalStyle; 67 | textMarkFormater.maximumFractionDigits = 2; 68 | for (int i = 0; i <= numberOfLines; i++) { 69 | arrayWithTypeMarks[i] = self.minorMark; 70 | if ([NSNumber numberWithFloat:self.middleMark.frequency].integerValue != 0) { 71 | if ((i + numberOfLinesToZeroForMiddle) % [NSNumber numberWithFloat:self.middleMark.frequency].integerValue == 0) { 72 | arrayWithTypeMarks[i] = self.middleMark; 73 | } 74 | } 75 | if ([NSNumber numberWithFloat:self.majorMark.frequency].integerValue != 0) { 76 | if ((i + numberOfLinesToZeroForMajor) % [NSNumber numberWithFloat:self.majorMark.frequency].integerValue == 0) { 77 | arrayWithTypeMarks[i] = self.majorMark; 78 | } 79 | } 80 | } 81 | for (int i = 0; i <= numberOfLines; i++) { 82 | CGFloat num = self.rulerRange.location + (self.minorMark.frequency * i); 83 | NSString * numStr = [textMarkFormater stringFromNumber:[NSNumber numberWithFloat:num]]; 84 | CGFloat position = i * lineOffset; 85 | [self drawMarkInContext:ctx position:position text:numStr mark:arrayWithTypeMarks[i]]; 86 | } 87 | UIImage *imageToDraw = UIGraphicsGetImageFromCurrentImageContext(); 88 | UIGraphicsEndImageContext(); 89 | [imageToDraw imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 90 | 91 | self.contents = (id)imageToDraw.CGImage; 92 | } 93 | 94 | // in drawMarkInContext:position:text:mark code draw lines marks and text marks on position with text 95 | // and style (color of text; color of lines; font of text; size of lines 96 | - (void)drawMarkInContext:(CGContextRef)ctx position:(CGFloat)position text:(NSString *)text mark:(CRMark *)mark { 97 | NSDictionary *attributes = @{ NSFontAttributeName: mark.font, NSForegroundColorAttributeName: mark.textColor}; 98 | CGSize textSize = [text sizeWithAttributes:attributes]; 99 | 100 | CGFloat rectX = position + kSideOffset - mark.size.width / 2 + mark.offset.x; 101 | CGFloat rectY; 102 | if (mark.alignment == CRRulerMarkAlignmentCenter) { 103 | rectY = (self.frame.size.height - mark.size.height) / 2; 104 | } 105 | if (mark.alignment == CRRulerMarkAlignmentBottom) { 106 | rectY = self.frame.size.height - mark.size.height - textSize.height; 107 | } 108 | if (mark.alignment == CRRulerMarkAlignmentTop) { 109 | rectY = textSize.height; 110 | } 111 | rectY += mark.offset.y; 112 | CGRect rect = CGRectMake(rectX, rectY, mark.size.width, mark.size.height); 113 | CGContextSetFillColorWithColor(ctx, mark.color.CGColor); 114 | CGContextFillRect(ctx, rect); 115 | 116 | CGFloat textRectX = position + kSideOffset - textSize.width / 2 + mark.textOffset.x; 117 | CGFloat textRectY; 118 | if (mark.textAlignment == CRRulerMarkAlignmentCenter) { 119 | textRectY = (self.frame.size.height - textSize.height) / 2 ; 120 | } 121 | if (mark.textAlignment == CRRulerMarkAlignmentBottom) { 122 | textRectY = self.frame.size.height - textSize.height; 123 | } 124 | if (mark.textAlignment == CRRulerMarkAlignmentTop) { 125 | textRectY = 0; 126 | } 127 | textRectY += mark.textOffset.y; 128 | CGRect textRect = CGRectMake(textRectX, textRectY, textSize.width, textSize.height); 129 | [text drawInRect:textRect withAttributes:attributes]; 130 | } 131 | 132 | #pragma mark - Display 133 | 134 | - (void)display { 135 | [CATransaction begin]; 136 | [CATransaction setDisableActions:YES]; 137 | [self drawToImage]; 138 | [CATransaction commit]; 139 | } 140 | 141 | @end -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRRulerControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRRulerControl.h 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import 10 | #import "CRRulerLayer.h" 11 | 12 | /** 13 | * Customise ruler. Have action rulerValueChaned. Can change color and size all elements. 14 | */ 15 | IB_DESIGNABLE 16 | @interface CRRulerControl : UIControl 17 | 18 | /** 19 | * NS_OPTIONS of all marks on the ruller view. 20 | */ 21 | typedef NS_OPTIONS(NSUInteger, CRRulerMarkType) { 22 | /** 23 | * Major mark 24 | */ 25 | CRRulerMarkTypeMajor = 1 << 0, 26 | /** 27 | * Middle mark 28 | */ 29 | CRRulerMarkTypeMiddle = 1 << 1, 30 | /** 31 | * Minor mark 32 | */ 33 | CRRulerMarkTypeMinor = 1 << 2, 34 | /** 35 | * Choose all marks 36 | */ 37 | CRRulerMarkTypeAll = ~0UL, 38 | }; 39 | 40 | @property (nonatomic, readonly) UIScrollView *scrollView; 41 | /** 42 | * ImageView on center controll default red line 43 | */ 44 | @property (nonatomic, readonly) UIImageView *pointerImageView; 45 | /** 46 | * Spacing between center of nearby marks 47 | */ 48 | @property (nonatomic) IBInspectable CGFloat spacingBetweenMarks; 49 | /** 50 | * All width of rulerControl default 1000 51 | */ 52 | @property (nonatomic) IBInspectable CGFloat rulerWidth; 53 | /** 54 | * Text value of left mark on rulerControl default - 10 55 | */ 56 | @property (nonatomic) IBInspectable CGFloat rangeFrom; 57 | /** 58 | * Length rulerControl beginning from rangeFrom default 20 59 | */ 60 | @property (nonatomic) IBInspectable CGFloat rangeLength; 61 | /** 62 | * Value on center of CRRulerControl. Thay variable by proterty rangeFrom and rangeLength default 0 63 | */ 64 | @property (nonatomic) IBInspectable CGFloat value; 65 | 66 | /** 67 | * Change value with animation or without it 68 | * 69 | * @param Value Label beneath lines. Set by proterty rangeFrom and rangeLength. Have setter method. 70 | * @param Animated BOOL parameters with show scroll animation or without it 71 | */ 72 | - (void)setValue:(CGFloat)value animated:(BOOL)animated; 73 | 74 | /** 75 | * Helper for choose position of ImageView on CRRulerControl 76 | * 77 | * @return Return position of ImageView on X cordinate line 78 | */ 79 | - (CGRect)frameForPointerImageView; 80 | 81 | /** 82 | * Helper for set on scrollview some custom elements 83 | * 84 | * @param Value Set by proterty rangeFrom and rangeLength 85 | * 86 | * @return ContentOffset of scrollView where located mark with this value 87 | */ 88 | - (CGPoint)contentOffsetForValue:(CGFloat)value; 89 | 90 | 91 | /** 92 | * Change size of line mark 93 | * 94 | * @param lineSize Size of line mark 95 | * @param markType NS_OPTIONS CRRulerMarkType. 96 | * CRRulerMarkTypeMajor for choose Major Mark default {1, 5} 97 | * CRRulerMarkTypeMiddle for choose Middle Mark default {1,10} 98 | * CRRulerMarkTypeMinor for choose Minor Mark default {2,20} 99 | * CRRulerMarkTypeAll for choose All Mark 100 | */ 101 | - (void)setSize:(CGSize)size forMarkType:(CRRulerMarkType)markType; 102 | 103 | /** 104 | * Change size of line mark 105 | * 106 | * @param lineColor Color of line Mark default used tintColor of CRRulerControl 107 | * @param markType NS_OPTIONS CRRulerMarkType. 108 | * CRRulerMarkTypeMajor for choose Major Mark 109 | * CRRulerMarkTypeMiddle for choose Middle Mark 110 | * CRRulerMarkTypeMinor for choose Minor Mark 111 | * CRRulerMarkTypeAll for choose All Mark 112 | * 113 | */ 114 | - (void)setColor:(UIColor *)color forMarkType:(CRRulerMarkType)markType; 115 | 116 | /** 117 | * Change text of line mark 118 | * 119 | * @param lineColor Color of line Mark default used tintColor of CRRulerControl 120 | * @param markType NS_OPTIONS CRRulerMarkType. 121 | * CRRulerMarkTypeMajor for choose Major Mark 122 | * CRRulerMarkTypeMiddle for choose Middle Mark 123 | * CRRulerMarkTypeMinor for choose Minor Mark 124 | * CRRulerMarkTypeAll for choose All Mark 125 | */ 126 | - (void)setTextColor:(UIColor *)textColor forMarkType:(CRRulerMarkType)markType; 127 | 128 | /** 129 | * Change font of text mark 130 | * 131 | * @param textFont Font of text mark default Courier with size 10 132 | * @param markType NS_OPTIONS CRRulerMarkType. 133 | * CRRulerMarkTypeMajor for choose Major Mark 134 | * CRRulerMarkTypeMiddle for choose Middle Mark 135 | * CRRulerMarkTypeMinor for choose Minor Mark 136 | * CRRulerMarkTypeAll for choose All Mark 137 | */ 138 | - (void)setFont:(UIFont *)font forMarkType:(CRRulerMarkType)markType; 139 | 140 | /** 141 | * Change frequency of mark 142 | * 143 | * @param Frequency of showing mark in CRRulerControl 144 | * @param markType NS_OPTIONS CRRulerMarkType. 145 | * CRRulerMarkTypeMajor for choose Major Mark default every 10 Mark (When set new value showing this 146 | * mark is = frequency this mark / frequency of minor mark. This Mark have a priority by middle mark 147 | * and by minor mark. If this frequency <= of minor mark frequency, than you can not see this mark. (first set minor mark). 148 | * CRRulerMarkTypeMiddle for choose Middle Mark default every 5 Mark (When set new value showing this 149 | * mark is = frequency this mark / frequency of minor mark. This Mark have a priority by minor mark. 150 | * If this frequency <= of minor mark frequency, than you can not see this mark. (first set minor mark). 151 | * CRRulerMarkTypeMinor for choose Minor Mark. if mark is not major of middle than they minor. 152 | * Thay can not be 0. Minor mark it is one step on CRRulerControl. 153 | * CRRulerMarkTypeAll for choose All Mark 154 | * 155 | * Count of marks = rangeLength / frequency of minor mark 156 | */ 157 | - (void)setFrequency:(CGFloat)frequency forMarkType:(CRRulerMarkType)markType; 158 | 159 | /** 160 | * Change alignment of text mark 161 | * 162 | * @param alignment CRRulerMarkAlignment of text mark default bottom 163 | * CRRulerMarkAlignmentBottom, 164 | * CRRulerMarkAlignmentCenter, 165 | * CRRulerMarkAlignmentTop, 166 | * @param markType NS_OPTIONS CRRulerMarkType. 167 | * CRRulerMarkTypeMajor for choose Major Mark 168 | * CRRulerMarkTypeMiddle for choose Middle Mark 169 | * CRRulerMarkTypeMinor for choose Minor Mark 170 | * CRRulerMarkTypeAll for choose All Mark 171 | */ 172 | - (void)setTextAlignment:(CRRulerMarkAlignment)alignment forMarkType:(CRRulerMarkType)markType; 173 | 174 | /** 175 | * Change alignment of lines mark 176 | * 177 | * @param alignment CRRulerMarkAlignment of line mark default center 178 | * CRRulerMarkAlignmentBottom, 179 | * CRRulerMarkAlignmentCenter, 180 | * CRRulerMarkAlignmentTop, 181 | * @param markType NS_OPTIONS CRRulerMarkType. 182 | * CRRulerMarkTypeMajor for choose Major Mark 183 | * CRRulerMarkTypeMiddle for choose Middle Mark 184 | * CRRulerMarkTypeMinor for choose Minor Mark 185 | * CRRulerMarkTypeAll for choose All Mark 186 | */ 187 | - (void)setAlignment:(CRRulerMarkAlignment)alignment forMarkType:(CRRulerMarkType)markType; 188 | 189 | /** 190 | * Change offset of text marks 191 | * 192 | * @param textOffset CGPoint default {0.0} 193 | * @param markType NS_OPTIONS CRRulerMarkType. 194 | * CRRulerMarkTypeMajor for choose Major Mark 195 | * CRRulerMarkTypeMiddle for choose Middle Mark 196 | * CRRulerMarkTypeMinor for choose Minor Mark 197 | * CRRulerMarkTypeAll for choose All Mark 198 | */ 199 | - (void)setTextOffset:(CGPoint)textOffset forMarkType:(CRRulerMarkType)markType; 200 | 201 | /** 202 | * Change offset of lines marks 203 | * 204 | * @param offset CGPoint default {0.0} 205 | * @param markType NS_OPTIONS CRRulerMarkType. 206 | * CRRulerMarkTypeMajor for choose Major Mark 207 | * CRRulerMarkTypeMiddle for choose Middle Mark 208 | * CRRulerMarkTypeMinor for choose Minor Mark 209 | * CRRulerMarkTypeAll for choose All Mark 210 | */ 211 | - (void)setOffset:(CGPoint)offset forMarkType:(CRRulerMarkType)markType; 212 | 213 | /** 214 | * Return size of Mark 215 | * 216 | * @param markType NS_OPTIONS CRRulerMarkType. 217 | * CRRulerMarkTypeMajor for choose Major Mark 218 | * CRRulerMarkTypeMiddle for choose Middle Mark 219 | * CRRulerMarkTypeMinor for choose Minor Mark 220 | * CRRulerMarkTypeAll for choose All Mark 221 | * 222 | * @return If choose CRRulerMarkTypeAll mark than return CGSizeZero 223 | */ 224 | - (CGSize)sizeForMarkType:(CRRulerMarkType)markType; 225 | /** 226 | * Return color of Mark 227 | * 228 | * @param markType NS_OPTIONS CRRulerMarkType. 229 | * CRRulerMarkTypeMajor for choose Major Mark 230 | * CRRulerMarkTypeMiddle for choose Middle Mark 231 | * CRRulerMarkTypeMinor for choose Minor Mark 232 | * CRRulerMarkTypeAll for choose All Mark 233 | * 234 | * @return If choose CRRulerMarkTypeAll mark than return nil 235 | */ 236 | - (UIColor *)colorForMarkType:(CRRulerMarkType)markType; 237 | /** 238 | * Return text color of mark 239 | * 240 | * @param markType NS_OPTIONS CRRulerMarkType. 241 | * CRRulerMarkTypeMajor for choose Major Mark 242 | * CRRulerMarkTypeMiddle for choose Middle Mark 243 | * CRRulerMarkTypeMinor for choose Minor Mark 244 | * CRRulerMarkTypeAll for choose All Mark 245 | * 246 | * @return If choose CRRulerMarkTypeAll mark than return nil 247 | */ 248 | - (UIColor *)textColorForMarkType:(CRRulerMarkType)markType; 249 | /** 250 | * Return font of mark 251 | * 252 | * @param markType NS_OPTIONS CRRulerMarkType. 253 | * CRRulerMarkTypeMajor for choose Major Mark 254 | * CRRulerMarkTypeMiddle for choose Middle Mark 255 | * CRRulerMarkTypeMinor for choose Minor Mark 256 | * CRRulerMarkTypeAll for choose All Mark 257 | * 258 | * @return If choose CRRulerMarkTypeAll mark than return nil 259 | */ 260 | - (UIFont *)fontForMarkType:(CRRulerMarkType)markType; 261 | /** 262 | * Return frequency of mark 263 | * 264 | * @param markType NS_OPTIONS CRRulerMarkType. 265 | * CRRulerMarkTypeMajor for choose Major Mark 266 | * CRRulerMarkTypeMiddle for choose Middle Mark 267 | * CRRulerMarkTypeMinor for choose Minor Mark 268 | * CRRulerMarkTypeAll for choose All Mark 269 | * 270 | * @return If choose CRRulerMarkTypeAll mark than return CGSizeZero 271 | */ 272 | - (CGFloat)frequencyForMarkType:(CRRulerMarkType)markType; 273 | 274 | /** 275 | * Return alignment of text mark 276 | * 277 | * @param markType NS_OPTIONS CRRulerMarkType. 278 | * CRRulerMarkTypeMajor for choose Major Mark 279 | * CRRulerMarkTypeMiddle for choose Middle Mark 280 | * CRRulerMarkTypeMinor for choose Minor Mark 281 | * CRRulerMarkTypeAll for choose All Mark 282 | * 283 | * @return alignment CRRulerMarkAlignment 284 | * CRRulerMarkAlignmentBottom, 285 | * CRRulerMarkAlignmentCenter, 286 | * CRRulerMarkAlignmentTop, 287 | */ 288 | - (CRRulerMarkAlignment)textAlignmentForMarkType:(CRRulerMarkType)markType; 289 | 290 | /** 291 | * Return alignment of line mark 292 | * 293 | * @param markType NS_OPTIONS CRRulerMarkType. 294 | * CRRulerMarkTypeMajor for choose Major Mark 295 | * CRRulerMarkTypeMiddle for choose Middle Mark 296 | * CRRulerMarkTypeMinor for choose Minor Mark 297 | * CRRulerMarkTypeAll for choose All Mark 298 | * 299 | * @return alignment CRRulerMarkAlignment 300 | * CRRulerMarkAlignmentBottom, 301 | * CRRulerMarkAlignmentCenter, 302 | * CRRulerMarkAlignmentTop, 303 | */ 304 | - (CRRulerMarkAlignment)alignmentForMarkType:(CRRulerMarkType)markType; 305 | 306 | /** 307 | * Return offset of text mark 308 | * 309 | * @param markType NS_OPTIONS CRRulerMarkType. 310 | * CRRulerMarkTypeMajor for choose Major Mark 311 | * CRRulerMarkTypeMiddle for choose Middle Mark 312 | * CRRulerMarkTypeMinor for choose Minor Mark 313 | * CRRulerMarkTypeAll for choose All Mark 314 | * 315 | * @return alignment CRRulerMarkAlignment 316 | * CRRulerMarkAlignmentBottom, 317 | * CRRulerMarkAlignmentCenter, 318 | * CRRulerMarkAlignmentTop, 319 | */ 320 | - (CGPoint)textOffsetForMarkType:(CRRulerMarkType)markType; 321 | 322 | /** 323 | * Return offset of line mark 324 | * 325 | * @param markType NS_OPTIONS CRRulerMarkType. 326 | * CRRulerMarkTypeMajor for choose Major Mark 327 | * CRRulerMarkTypeMiddle for choose Middle Mark 328 | * CRRulerMarkTypeMinor for choose Minor Mark 329 | * CRRulerMarkTypeAll for choose All Mark 330 | * 331 | * @return alignment CRRulerMarkAlignment 332 | * CRRulerMarkAlignmentBottom, 333 | * CRRulerMarkAlignmentCenter, 334 | * CRRulerMarkAlignmentTop, 335 | */ 336 | - (CGPoint)offsetForMarkType:(CRRulerMarkType)markType; 337 | 338 | @end -------------------------------------------------------------------------------- /CRRulerControl/Classes/CRRulerControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRRulerControl.m 3 | // Pods 4 | // 5 | // Created by Sergey Chuchukalo on 08/25/2016. 6 | // 7 | // Copyright © 2016 Cleveroad Inc. All rights reserved. 8 | 9 | #import "CRRulerControl.h" 10 | 11 | static const CGFloat kDefaultRulerWidth = 500; 12 | static const CGFloat kDefaultRangeFrom = -10; 13 | static const CGFloat kDefaultRangeLength = 20; 14 | static const CGFloat kSideOffset = 30.0; 15 | static const CGSize kPointerImageViewSize = {2, 30}; 16 | 17 | 18 | @interface CRRulerControl () 19 | 20 | @property (nonatomic) CRRange rulerRange; 21 | @property (nonatomic) CRRulerLayer *rulerLayer; 22 | @property (nonatomic, readwrite) UIScrollView *scrollView; 23 | @property (nonatomic, readwrite) UIImageView *pointerImageView; 24 | 25 | @end 26 | 27 | @implementation CRRulerControl 28 | 29 | #pragma mark - Initialization 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame { 32 | if (self = [super initWithFrame:frame]) { 33 | [self _setupDefaultValues]; 34 | [self _commonInit]; 35 | } 36 | return self; 37 | } 38 | 39 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | [self _setupDefaultValues]; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)awakeFromNib { 47 | [super awakeFromNib]; 48 | if (_spacingBetweenMarks > 0 ) { 49 | self.rulerWidth = _spacingBetweenMarks * _rangeLength; 50 | } 51 | [self _commonInit]; 52 | } 53 | 54 | - (void)_commonInit { 55 | [self setupScrollView]; 56 | [self setupRulerLayer]; 57 | [self setupPointerImage]; 58 | } 59 | 60 | - (void)_setupDefaultValues { 61 | _rangeFrom = kDefaultRangeFrom; 62 | _rangeLength = kDefaultRangeLength; 63 | _rulerWidth = kDefaultRulerWidth; 64 | } 65 | 66 | #pragma mark - Layout 67 | 68 | - (void)layoutSubviews { 69 | [super layoutSubviews]; 70 | 71 | CGFloat value = self.value; 72 | CGFloat sideInset = CGRectGetWidth(self.scrollView.frame) / 2.0f; 73 | self.scrollView.contentInset = UIEdgeInsetsMake(0, sideInset - kSideOffset, 0, sideInset - kSideOffset); 74 | [CATransaction begin]; 75 | [CATransaction setDisableActions:YES]; 76 | self.rulerLayer.frame = [self frameForRulerLayer]; 77 | [CATransaction commit]; 78 | [self.scrollView setContentSize:CGSizeMake(self.rulerWidth, self.frame.size.height)]; 79 | self.scrollView.contentOffset = [self contentOffsetForValue:value]; 80 | self.pointerImageView.frame = [self frameForPointerImageView]; 81 | } 82 | 83 | #pragma mark - Frame 84 | 85 | - (CGRect)frameForPointerImageView { 86 | CGFloat pointerImageViewOriginX = (self.frame.size.width - kPointerImageViewSize.width) / 2; 87 | CGFloat pointerImageViewOriginY = (self.frame.size.height - kPointerImageViewSize.height) / 2; 88 | CGRect rulerCenterViewRect = CGRectMake(pointerImageViewOriginX, pointerImageViewOriginY, 89 | kPointerImageViewSize.width, kPointerImageViewSize.height); 90 | return rulerCenterViewRect; 91 | } 92 | 93 | - (CGRect)frameForRulerLayer { 94 | return CGRectMake(0, 0, self.rulerWidth, self.frame.size.height); 95 | } 96 | 97 | #pragma mark - Setups 98 | 99 | - (void)setupPointerImage { 100 | self.pointerImageView = [[UIImageView alloc] init]; 101 | self.pointerImageView.backgroundColor = self.tintColor; 102 | [self addSubview:self.pointerImageView]; 103 | } 104 | 105 | - (void)setupScrollView { 106 | self.scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; 107 | self.scrollView.translatesAutoresizingMaskIntoConstraints = YES; 108 | self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 109 | self.scrollView.delegate = self; 110 | self.scrollView.bounces = NO; 111 | [self.scrollView setShowsHorizontalScrollIndicator:NO]; 112 | [self addSubview:self.scrollView]; 113 | } 114 | 115 | - (void)setupRulerLayer { 116 | CRRange range; 117 | range.location = self.rangeFrom; 118 | range.length = self.rangeLength; 119 | self.rulerRange = range; 120 | self.rulerLayer = [CRRulerLayer new]; 121 | self.rulerLayer.rulerRange = self.rulerRange; 122 | self.rulerLayer.backgroundColor = [UIColor clearColor].CGColor; 123 | [self setColor:self.tintColor forMarkType:CRRulerMarkTypeAll]; 124 | [self setTextColor:self.tintColor forMarkType:CRRulerMarkTypeMiddle | CRRulerMarkTypeMajor]; 125 | [self.scrollView.layer addSublayer:self.rulerLayer]; 126 | } 127 | 128 | #pragma mark - ScrollView Delegate 129 | 130 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 131 | CGFloat oldValue = _value; 132 | _value = [self valueForContentOffset:scrollView.contentOffset]; 133 | if (oldValue != _value) { 134 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 135 | } 136 | } 137 | 138 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { 139 | CGFloat value = [self valueForContentOffset:*targetContentOffset]; 140 | value = lroundf(value / self.rulerLayer.minorMark.frequency) * self.rulerLayer.minorMark.frequency; 141 | targetContentOffset->x = [self contentOffsetForValue:value].x; 142 | } 143 | 144 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 145 | CGFloat oldValue = [self valueForContentOffset:scrollView.contentOffset]; 146 | _value = lroundf(oldValue / self.rulerLayer.minorMark.frequency) * self.rulerLayer.minorMark.frequency; 147 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 148 | } 149 | 150 | #pragma mark - Helper for scroll 151 | 152 | - (CGPoint)contentOffsetForValue:(CGFloat)value { 153 | CGFloat contentOffsetY = (value - self.rulerRange.location) * [self offsetCoefficient] - self.scrollView.contentInset.left; 154 | return CGPointMake(contentOffsetY, self.scrollView.contentOffset.y); 155 | } 156 | 157 | - (CGFloat)valueForContentOffset:(CGPoint)contentOffset { 158 | return self.rulerRange.location + (contentOffset.x + self.scrollView.contentInset.left) / [self offsetCoefficient]; 159 | } 160 | 161 | - (CGFloat)offsetCoefficient { 162 | NSInteger distance = self.rulerRange.length; 163 | return (self.scrollView.contentSize.width - kSideOffset * 2) / distance; 164 | } 165 | 166 | #pragma mark - User interaction 167 | 168 | - (void)tintColorDidChange { 169 | [self setColor:self.tintColor forMarkType:CRRulerMarkTypeAll]; 170 | [self setTextColor:self.tintColor forMarkType:CRRulerMarkTypeMiddle | CRRulerMarkTypeMajor]; 171 | self.pointerImageView.backgroundColor = self.tintColor; 172 | } 173 | 174 | #pragma mark - Setters 175 | 176 | - (void)setRangeFrom:(CGFloat)rangeFrom { 177 | _rangeFrom = rangeFrom; 178 | [self setRange]; 179 | } 180 | 181 | - (void)setRangeLength:(CGFloat)rangeLength { 182 | _rangeLength = rangeLength; 183 | [self setRange]; 184 | } 185 | 186 | - (void)setRange { 187 | CRRange range; 188 | range.location = self.rangeFrom; 189 | range.length = self.rangeLength; 190 | self.rulerRange = range; 191 | self.rulerLayer.rulerRange = range; 192 | [self.rulerLayer setNeedsDisplay]; 193 | } 194 | 195 | - (void)setSpacingBetweenMarks:(CGFloat)spacingBetweenMarks { 196 | _spacingBetweenMarks = spacingBetweenMarks; 197 | if (_spacingBetweenMarks >= 1 ) { 198 | if (self.rulerLayer.minorMark.frequency > 0) { 199 | self.rulerWidth = _spacingBetweenMarks * _rangeLength / self.rulerLayer.minorMark.frequency; 200 | } else { 201 | self.rulerWidth = _spacingBetweenMarks * _rangeLength; 202 | } 203 | } 204 | } 205 | 206 | - (void)setRulerWidth:(CGFloat)rulerWidth { 207 | if ((_rulerWidth != rulerWidth) && (rulerWidth <= 7000) && (rulerWidth > 0)) { 208 | _rulerWidth = rulerWidth; 209 | [self setNeedsLayout]; 210 | } 211 | } 212 | 213 | - (void)setValue:(CGFloat)value { 214 | [self setValue:value animated:NO]; 215 | } 216 | 217 | - (void)setValue:(CGFloat)value animated:(BOOL)animated { 218 | _value = value; 219 | [self.scrollView setContentOffset:[self contentOffsetForValue:value] animated:animated]; 220 | } 221 | 222 | #pragma mark - Change mark type method 223 | 224 | - (void)setSize:(CGSize)size forMarkType:(CRRulerMarkType)markType { 225 | if (markType & CRRulerMarkTypeMajor) { 226 | self.rulerLayer.majorMark.size = size; 227 | } 228 | if (markType & CRRulerMarkTypeMiddle) { 229 | self.rulerLayer.middleMark.size = size; 230 | } 231 | if (markType & CRRulerMarkTypeMinor) { 232 | self.rulerLayer.minorMark.size = size; 233 | } 234 | [self.rulerLayer setNeedsDisplay]; 235 | } 236 | 237 | - (void)setColor:(UIColor *)color forMarkType:(CRRulerMarkType)markType { 238 | if (markType & CRRulerMarkTypeMajor) { 239 | self.rulerLayer.majorMark.color = color; 240 | } 241 | if (markType & CRRulerMarkTypeMiddle) { 242 | self.rulerLayer.middleMark.color = color; 243 | } 244 | if (markType & CRRulerMarkTypeMinor) { 245 | self.rulerLayer.minorMark.color = color; 246 | } 247 | [self.rulerLayer setNeedsDisplay]; 248 | } 249 | 250 | - (void)setTextColor:(UIColor *)textColor forMarkType:(CRRulerMarkType)markType { 251 | if (markType & CRRulerMarkTypeMajor) { 252 | self.rulerLayer.majorMark.textColor = textColor; 253 | } 254 | if (markType & CRRulerMarkTypeMiddle) { 255 | self.rulerLayer.middleMark.textColor = textColor; 256 | } 257 | if (markType & CRRulerMarkTypeMinor) { 258 | self.rulerLayer.minorMark.textColor = textColor; 259 | } 260 | [self.rulerLayer setNeedsDisplay]; 261 | } 262 | 263 | - (void)setFont:(UIFont *)font forMarkType:(CRRulerMarkType)markType { 264 | if (markType & CRRulerMarkTypeMajor) { 265 | self.rulerLayer.majorMark.font = font; 266 | } 267 | if (markType & CRRulerMarkTypeMiddle) { 268 | self.rulerLayer.middleMark.font = font; 269 | } 270 | if (markType & CRRulerMarkTypeMinor) { 271 | self.rulerLayer.minorMark.font = font; 272 | } 273 | [self.rulerLayer setNeedsDisplay]; 274 | } 275 | 276 | - (void)setFrequency:(CGFloat)frequency forMarkType:(CRRulerMarkType)markType { 277 | if (markType & CRRulerMarkTypeMajor) { 278 | if (self.rulerLayer.minorMark.frequency < frequency) { 279 | self.rulerLayer.majorMark.frequency = frequency / [NSNumber numberWithFloat:self.rulerLayer.minorMark.frequency].floatValue; 280 | } else { 281 | self.rulerLayer.majorMark.frequency = 0; 282 | } 283 | } 284 | if (markType & CRRulerMarkTypeMiddle) { 285 | if (self.rulerLayer.minorMark.frequency < frequency) { 286 | self.rulerLayer.middleMark.frequency = frequency / [NSNumber numberWithFloat:self.rulerLayer.minorMark.frequency].floatValue; 287 | } else { 288 | self.rulerLayer.middleMark.frequency = 0; 289 | } 290 | } 291 | if ((markType & CRRulerMarkTypeMinor) && (frequency > 0)) { 292 | if ((_spacingBetweenMarks > 0 ) || (_rulerWidth > 0)) { 293 | self.rulerLayer.minorMark.frequency = [NSNumber numberWithFloat:frequency].doubleValue; 294 | self.rulerWidth = _rulerWidth; 295 | self.spacingBetweenMarks = _spacingBetweenMarks; 296 | } 297 | } 298 | [self.rulerLayer setNeedsDisplay]; 299 | } 300 | 301 | - (void)setTextAlignment:(CRRulerMarkAlignment)alignment forMarkType:(CRRulerMarkType)markType { 302 | if (markType & CRRulerMarkTypeMajor) { 303 | self.rulerLayer.majorMark.textAlignment = alignment; 304 | } 305 | if (markType & CRRulerMarkTypeMiddle) { 306 | self.rulerLayer.middleMark.textAlignment = alignment; 307 | } 308 | if (markType & CRRulerMarkTypeMinor) { 309 | self.rulerLayer.minorMark.textAlignment = alignment; 310 | } 311 | [self.rulerLayer setNeedsDisplay]; 312 | } 313 | 314 | - (void)setAlignment:(CRRulerMarkAlignment)alignment forMarkType:(CRRulerMarkType)markType { 315 | if (markType & CRRulerMarkTypeMajor) { 316 | self.rulerLayer.majorMark.alignment = alignment; 317 | } 318 | if (markType & CRRulerMarkTypeMiddle) { 319 | self.rulerLayer.middleMark.alignment = alignment; 320 | } 321 | if (markType & CRRulerMarkTypeMinor) { 322 | self.rulerLayer.minorMark.alignment = alignment; 323 | } 324 | [self.rulerLayer setNeedsDisplay]; 325 | } 326 | 327 | - (void)setTextOffset:(CGPoint)textOffset forMarkType:(CRRulerMarkType)markType { 328 | if (markType & CRRulerMarkTypeMajor) { 329 | self.rulerLayer.majorMark.textOffset = textOffset; 330 | } 331 | if (markType & CRRulerMarkTypeMiddle) { 332 | self.rulerLayer.middleMark.textOffset = textOffset; 333 | } 334 | if (markType & CRRulerMarkTypeMinor) { 335 | self.rulerLayer.minorMark.textOffset = textOffset; 336 | } 337 | [self.rulerLayer setNeedsDisplay]; 338 | } 339 | 340 | - (void)setOffset:(CGPoint)offset forMarkType:(CRRulerMarkType)markType { 341 | if (markType & CRRulerMarkTypeMajor) { 342 | self.rulerLayer.majorMark.offset = offset; 343 | } 344 | if (markType & CRRulerMarkTypeMiddle) { 345 | self.rulerLayer.middleMark.offset = offset; 346 | } 347 | if (markType & CRRulerMarkTypeMinor) { 348 | self.rulerLayer.minorMark.offset = offset; 349 | } 350 | [self.rulerLayer setNeedsDisplay]; 351 | } 352 | 353 | #pragma mark - Get mark type method 354 | 355 | - (CGSize)sizeForMarkType:(CRRulerMarkType)markType { 356 | if (markType == CRRulerMarkTypeMajor) { 357 | return self.rulerLayer.majorMark.size; 358 | } 359 | if (markType == CRRulerMarkTypeMiddle) { 360 | return self.rulerLayer.middleMark.size; 361 | } 362 | if (markType == CRRulerMarkTypeMinor) { 363 | return self.rulerLayer.minorMark.size; 364 | } 365 | return CGSizeZero; 366 | } 367 | 368 | - (UIColor *)colorForMarkType:(CRRulerMarkType)markType { 369 | if (markType & CRRulerMarkTypeMajor) { 370 | return self.rulerLayer.majorMark.color; 371 | } 372 | if (markType & CRRulerMarkTypeMiddle) { 373 | return self.rulerLayer.middleMark.color; 374 | } 375 | if (markType & CRRulerMarkTypeMinor) { 376 | return self.rulerLayer.minorMark.color; 377 | } 378 | return nil; 379 | } 380 | 381 | - (UIColor *)textColorForMarkType:(CRRulerMarkType)markType { 382 | if (markType & CRRulerMarkTypeMajor) { 383 | return self.rulerLayer.majorMark.textColor; 384 | } 385 | if (markType & CRRulerMarkTypeMiddle) { 386 | return self.rulerLayer.middleMark.textColor; 387 | } 388 | if (markType & CRRulerMarkTypeMinor) { 389 | return self.rulerLayer.minorMark.textColor; 390 | } 391 | return nil; 392 | } 393 | 394 | - (UIFont *)fontForMarkType:(CRRulerMarkType)markType { 395 | if (markType & CRRulerMarkTypeMajor) { 396 | return self.rulerLayer.majorMark.font; 397 | } 398 | if (markType & CRRulerMarkTypeMiddle) { 399 | return self.rulerLayer.middleMark.font; 400 | } 401 | if (markType & CRRulerMarkTypeMinor) { 402 | return self.rulerLayer.minorMark.font; 403 | } 404 | return nil; 405 | } 406 | 407 | - (CGFloat)frequencyForMarkType:(CRRulerMarkType)markType { 408 | if (markType & CRRulerMarkTypeMajor) { 409 | return self.rulerLayer.majorMark.frequency * self.rulerLayer.minorMark.frequency; 410 | } 411 | if (markType & CRRulerMarkTypeMiddle) { 412 | return self.rulerLayer.middleMark.frequency * self.rulerLayer.minorMark.frequency; 413 | } 414 | if (markType & CRRulerMarkTypeMinor) { 415 | return self.rulerLayer.minorMark.frequency; 416 | } 417 | return CGFLOAT_MIN; 418 | } 419 | 420 | - (CRRulerMarkAlignment)textAlignmentForMarkType:(CRRulerMarkType)markType { 421 | if (markType & CRRulerMarkTypeMajor) { 422 | return self.rulerLayer.majorMark.textAlignment; 423 | } 424 | if (markType & CRRulerMarkTypeMiddle) { 425 | return self.rulerLayer.middleMark.textAlignment; 426 | } 427 | if (markType & CRRulerMarkTypeMinor) { 428 | return self.rulerLayer.minorMark.textAlignment; 429 | } 430 | return 0; 431 | } 432 | 433 | - (CRRulerMarkAlignment)alignmentForMarkType:(CRRulerMarkType)markType { 434 | if (markType & CRRulerMarkTypeMajor) { 435 | return self.rulerLayer.majorMark.alignment; 436 | } 437 | if (markType & CRRulerMarkTypeMiddle) { 438 | return self.rulerLayer.middleMark.alignment; 439 | } 440 | if (markType & CRRulerMarkTypeMinor) { 441 | return self.rulerLayer.minorMark.alignment; 442 | } 443 | return 0; 444 | } 445 | 446 | - (CGPoint)textOffsetForMarkType:(CRRulerMarkType)markType { 447 | if (markType & CRRulerMarkTypeMajor) { 448 | return self.rulerLayer.majorMark.textOffset; 449 | } 450 | if (markType & CRRulerMarkTypeMiddle) { 451 | return self.rulerLayer.middleMark.textOffset; 452 | } 453 | if (markType & CRRulerMarkTypeMinor) { 454 | return self.rulerLayer.minorMark.textOffset; 455 | } 456 | return CGPointZero; 457 | } 458 | 459 | - (CGPoint)offsetForMarkType:(CRRulerMarkType)markType { 460 | if (markType & CRRulerMarkTypeMajor) { 461 | return self.rulerLayer.majorMark.offset; 462 | } 463 | if (markType & CRRulerMarkTypeMiddle) { 464 | return self.rulerLayer.middleMark.offset; 465 | } 466 | if (markType & CRRulerMarkTypeMinor) { 467 | return self.rulerLayer.minorMark.offset; 468 | } 469 | return CGPointZero; 470 | } 471 | 472 | @end -------------------------------------------------------------------------------- /Example/CRRulerControl/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 78 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 105 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 159 | 168 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | -------------------------------------------------------------------------------- /Example/CRRulerControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 467B3D1144DB2FBB08093D45 /* Pods_CRRulerControl_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 40A73019ED4E58EB998427AF /* Pods_CRRulerControl_Example.framework */; }; 11 | 5B2D3FCB52685471A64C28D6 /* Pods_CRRulerControl_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2196C3E67D7DE78A5BC8839 /* Pods_CRRulerControl_Tests.framework */; }; 12 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 13 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 14 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 15 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 16 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 17 | 6003F59E195388D20070C39A /* CRAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CRAppDelegate.m */; }; 18 | 6003F5A7195388D20070C39A /* CRViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CRViewController.m */; }; 19 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 20 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 21 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 22 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 23 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 24 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 25 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 26 | CF5E93771D86F8360033D78D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CF5E93761D86F8360033D78D /* LaunchScreen.storyboard */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 6003F582195388D10070C39A /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6003F589195388D20070C39A; 35 | remoteInfo = CRRulerControl; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 29C12442D27734638ADCC43E /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 41 | 376D54F164B583ACDF09E6AA /* CRRulerControl.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CRRulerControl.podspec; path = ../CRRulerControl.podspec; sourceTree = ""; }; 42 | 40A73019ED4E58EB998427AF /* Pods_CRRulerControl_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CRRulerControl_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 4313911982D628FD34017C55 /* Pods-CRRulerControl_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CRRulerControl_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests.release.xcconfig"; sourceTree = ""; }; 44 | 465E656E724C1B2A3032792A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 45 | 5BC1F993D24C5351AFA37E43 /* Pods-CRRulerControl_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CRRulerControl_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests.debug.xcconfig"; sourceTree = ""; }; 46 | 6003F58A195388D20070C39A /* CRRulerControl_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CRRulerControl_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | 6003F595195388D20070C39A /* CRRulerControl-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CRRulerControl-Info.plist"; sourceTree = ""; }; 51 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 52 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | 6003F59B195388D20070C39A /* CRRulerControl-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CRRulerControl-Prefix.pch"; sourceTree = ""; }; 54 | 6003F59C195388D20070C39A /* CRAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CRAppDelegate.h; sourceTree = ""; }; 55 | 6003F59D195388D20070C39A /* CRAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CRAppDelegate.m; sourceTree = ""; }; 56 | 6003F5A5195388D20070C39A /* CRViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CRViewController.h; sourceTree = ""; }; 57 | 6003F5A6195388D20070C39A /* CRViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CRViewController.m; sourceTree = ""; }; 58 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 59 | 6003F5AE195388D20070C39A /* CRRulerControl_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CRRulerControl_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 61 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 62 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 63 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 64 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 65 | 76D6FFB79DEE1BE313478E7C /* Pods-CRRulerControl_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CRRulerControl_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example.debug.xcconfig"; sourceTree = ""; }; 66 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 67 | CF5E93761D86F8360033D78D /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 68 | E2196C3E67D7DE78A5BC8839 /* Pods_CRRulerControl_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CRRulerControl_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | E3D06A6CC5AD24B78FA59477 /* Pods-CRRulerControl_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CRRulerControl_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example.release.xcconfig"; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 6003F587195388D20070C39A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 80 | 467B3D1144DB2FBB08093D45 /* Pods_CRRulerControl_Example.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 6003F5AB195388D20070C39A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 89 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 90 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 91 | 5B2D3FCB52685471A64C28D6 /* Pods_CRRulerControl_Tests.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 4380B732118462BE4414DC7D /* Pods */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 76D6FFB79DEE1BE313478E7C /* Pods-CRRulerControl_Example.debug.xcconfig */, 102 | E3D06A6CC5AD24B78FA59477 /* Pods-CRRulerControl_Example.release.xcconfig */, 103 | 5BC1F993D24C5351AFA37E43 /* Pods-CRRulerControl_Tests.debug.xcconfig */, 104 | 4313911982D628FD34017C55 /* Pods-CRRulerControl_Tests.release.xcconfig */, 105 | ); 106 | name = Pods; 107 | sourceTree = ""; 108 | }; 109 | 6003F581195388D10070C39A = { 110 | isa = PBXGroup; 111 | children = ( 112 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 113 | 6003F593195388D20070C39A /* Example for CRRulerControl */, 114 | 6003F5B5195388D20070C39A /* Tests */, 115 | 6003F58C195388D20070C39A /* Frameworks */, 116 | 6003F58B195388D20070C39A /* Products */, 117 | 4380B732118462BE4414DC7D /* Pods */, 118 | ); 119 | sourceTree = ""; 120 | }; 121 | 6003F58B195388D20070C39A /* Products */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 6003F58A195388D20070C39A /* CRRulerControl_Example.app */, 125 | 6003F5AE195388D20070C39A /* CRRulerControl_Tests.xctest */, 126 | ); 127 | name = Products; 128 | sourceTree = ""; 129 | }; 130 | 6003F58C195388D20070C39A /* Frameworks */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 6003F58D195388D20070C39A /* Foundation.framework */, 134 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 135 | 6003F591195388D20070C39A /* UIKit.framework */, 136 | 6003F5AF195388D20070C39A /* XCTest.framework */, 137 | 40A73019ED4E58EB998427AF /* Pods_CRRulerControl_Example.framework */, 138 | E2196C3E67D7DE78A5BC8839 /* Pods_CRRulerControl_Tests.framework */, 139 | ); 140 | name = Frameworks; 141 | sourceTree = ""; 142 | }; 143 | 6003F593195388D20070C39A /* Example for CRRulerControl */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 6003F59C195388D20070C39A /* CRAppDelegate.h */, 147 | 6003F59D195388D20070C39A /* CRAppDelegate.m */, 148 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 149 | 6003F5A5195388D20070C39A /* CRViewController.h */, 150 | 6003F5A6195388D20070C39A /* CRViewController.m */, 151 | 6003F5A8195388D20070C39A /* Images.xcassets */, 152 | 6003F594195388D20070C39A /* Supporting Files */, 153 | CF5E93761D86F8360033D78D /* LaunchScreen.storyboard */, 154 | ); 155 | name = "Example for CRRulerControl"; 156 | path = CRRulerControl; 157 | sourceTree = ""; 158 | }; 159 | 6003F594195388D20070C39A /* Supporting Files */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 6003F595195388D20070C39A /* CRRulerControl-Info.plist */, 163 | 6003F596195388D20070C39A /* InfoPlist.strings */, 164 | 6003F599195388D20070C39A /* main.m */, 165 | 6003F59B195388D20070C39A /* CRRulerControl-Prefix.pch */, 166 | ); 167 | name = "Supporting Files"; 168 | sourceTree = ""; 169 | }; 170 | 6003F5B5195388D20070C39A /* Tests */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 6003F5BB195388D20070C39A /* Tests.m */, 174 | 6003F5B6195388D20070C39A /* Supporting Files */, 175 | ); 176 | path = Tests; 177 | sourceTree = ""; 178 | }; 179 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 183 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 184 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 185 | ); 186 | name = "Supporting Files"; 187 | sourceTree = ""; 188 | }; 189 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 376D54F164B583ACDF09E6AA /* CRRulerControl.podspec */, 193 | 29C12442D27734638ADCC43E /* README.md */, 194 | 465E656E724C1B2A3032792A /* LICENSE */, 195 | ); 196 | name = "Podspec Metadata"; 197 | sourceTree = ""; 198 | }; 199 | /* End PBXGroup section */ 200 | 201 | /* Begin PBXNativeTarget section */ 202 | 6003F589195388D20070C39A /* CRRulerControl_Example */ = { 203 | isa = PBXNativeTarget; 204 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CRRulerControl_Example" */; 205 | buildPhases = ( 206 | 52B46DB70B72CA13FB9EC212 /* [CP] Check Pods Manifest.lock */, 207 | 6003F586195388D20070C39A /* Sources */, 208 | 6003F587195388D20070C39A /* Frameworks */, 209 | 6003F588195388D20070C39A /* Resources */, 210 | 1D220A72C2C76141B4AA0F39 /* [CP] Embed Pods Frameworks */, 211 | 4ECE42D5D9F2776B241750B9 /* [CP] Copy Pods Resources */, 212 | ); 213 | buildRules = ( 214 | ); 215 | dependencies = ( 216 | ); 217 | name = CRRulerControl_Example; 218 | productName = CRRulerControl; 219 | productReference = 6003F58A195388D20070C39A /* CRRulerControl_Example.app */; 220 | productType = "com.apple.product-type.application"; 221 | }; 222 | 6003F5AD195388D20070C39A /* CRRulerControl_Tests */ = { 223 | isa = PBXNativeTarget; 224 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CRRulerControl_Tests" */; 225 | buildPhases = ( 226 | D420E138321BD6B292A61EF9 /* [CP] Check Pods Manifest.lock */, 227 | 6003F5AA195388D20070C39A /* Sources */, 228 | 6003F5AB195388D20070C39A /* Frameworks */, 229 | 6003F5AC195388D20070C39A /* Resources */, 230 | 1812EEF88936FC0CFA97A3EE /* [CP] Embed Pods Frameworks */, 231 | 00A686189F054CA45568E757 /* [CP] Copy Pods Resources */, 232 | ); 233 | buildRules = ( 234 | ); 235 | dependencies = ( 236 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 237 | ); 238 | name = CRRulerControl_Tests; 239 | productName = CRRulerControlTests; 240 | productReference = 6003F5AE195388D20070C39A /* CRRulerControl_Tests.xctest */; 241 | productType = "com.apple.product-type.bundle.unit-test"; 242 | }; 243 | /* End PBXNativeTarget section */ 244 | 245 | /* Begin PBXProject section */ 246 | 6003F582195388D10070C39A /* Project object */ = { 247 | isa = PBXProject; 248 | attributes = { 249 | CLASSPREFIX = CR; 250 | LastUpgradeCheck = 0720; 251 | ORGANIZATIONNAME = Sergey; 252 | TargetAttributes = { 253 | 6003F5AD195388D20070C39A = { 254 | TestTargetID = 6003F589195388D20070C39A; 255 | }; 256 | }; 257 | }; 258 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CRRulerControl" */; 259 | compatibilityVersion = "Xcode 3.2"; 260 | developmentRegion = English; 261 | hasScannedForEncodings = 0; 262 | knownRegions = ( 263 | en, 264 | Base, 265 | ); 266 | mainGroup = 6003F581195388D10070C39A; 267 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 268 | projectDirPath = ""; 269 | projectRoot = ""; 270 | targets = ( 271 | 6003F589195388D20070C39A /* CRRulerControl_Example */, 272 | 6003F5AD195388D20070C39A /* CRRulerControl_Tests */, 273 | ); 274 | }; 275 | /* End PBXProject section */ 276 | 277 | /* Begin PBXResourcesBuildPhase section */ 278 | 6003F588195388D20070C39A /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 283 | CF5E93771D86F8360033D78D /* LaunchScreen.storyboard in Resources */, 284 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 285 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 6003F5AC195388D20070C39A /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXResourcesBuildPhase section */ 298 | 299 | /* Begin PBXShellScriptBuildPhase section */ 300 | 00A686189F054CA45568E757 /* [CP] Copy Pods Resources */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | ); 307 | name = "[CP] Copy Pods Resources"; 308 | outputPaths = ( 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | shellPath = /bin/sh; 312 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-resources.sh\"\n"; 313 | showEnvVarsInLog = 0; 314 | }; 315 | 1812EEF88936FC0CFA97A3EE /* [CP] Embed Pods Frameworks */ = { 316 | isa = PBXShellScriptBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | ); 320 | inputPaths = ( 321 | ); 322 | name = "[CP] Embed Pods Frameworks"; 323 | outputPaths = ( 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | shellPath = /bin/sh; 327 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CRRulerControl_Tests/Pods-CRRulerControl_Tests-frameworks.sh\"\n"; 328 | showEnvVarsInLog = 0; 329 | }; 330 | 1D220A72C2C76141B4AA0F39 /* [CP] Embed Pods Frameworks */ = { 331 | isa = PBXShellScriptBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | ); 335 | inputPaths = ( 336 | ); 337 | name = "[CP] Embed Pods Frameworks"; 338 | outputPaths = ( 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | shellPath = /bin/sh; 342 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-frameworks.sh\"\n"; 343 | showEnvVarsInLog = 0; 344 | }; 345 | 4ECE42D5D9F2776B241750B9 /* [CP] Copy Pods Resources */ = { 346 | isa = PBXShellScriptBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | ); 350 | inputPaths = ( 351 | ); 352 | name = "[CP] Copy Pods Resources"; 353 | outputPaths = ( 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | shellPath = /bin/sh; 357 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CRRulerControl_Example/Pods-CRRulerControl_Example-resources.sh\"\n"; 358 | showEnvVarsInLog = 0; 359 | }; 360 | 52B46DB70B72CA13FB9EC212 /* [CP] Check Pods Manifest.lock */ = { 361 | isa = PBXShellScriptBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | inputPaths = ( 366 | ); 367 | name = "[CP] Check Pods Manifest.lock"; 368 | outputPaths = ( 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | shellPath = /bin/sh; 372 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 373 | showEnvVarsInLog = 0; 374 | }; 375 | D420E138321BD6B292A61EF9 /* [CP] Check Pods Manifest.lock */ = { 376 | isa = PBXShellScriptBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | ); 380 | inputPaths = ( 381 | ); 382 | name = "[CP] Check Pods Manifest.lock"; 383 | outputPaths = ( 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | shellPath = /bin/sh; 387 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 388 | showEnvVarsInLog = 0; 389 | }; 390 | /* End PBXShellScriptBuildPhase section */ 391 | 392 | /* Begin PBXSourcesBuildPhase section */ 393 | 6003F586195388D20070C39A /* Sources */ = { 394 | isa = PBXSourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | 6003F59E195388D20070C39A /* CRAppDelegate.m in Sources */, 398 | 6003F5A7195388D20070C39A /* CRViewController.m in Sources */, 399 | 6003F59A195388D20070C39A /* main.m in Sources */, 400 | ); 401 | runOnlyForDeploymentPostprocessing = 0; 402 | }; 403 | 6003F5AA195388D20070C39A /* Sources */ = { 404 | isa = PBXSourcesBuildPhase; 405 | buildActionMask = 2147483647; 406 | files = ( 407 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 408 | ); 409 | runOnlyForDeploymentPostprocessing = 0; 410 | }; 411 | /* End PBXSourcesBuildPhase section */ 412 | 413 | /* Begin PBXTargetDependency section */ 414 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 415 | isa = PBXTargetDependency; 416 | target = 6003F589195388D20070C39A /* CRRulerControl_Example */; 417 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 418 | }; 419 | /* End PBXTargetDependency section */ 420 | 421 | /* Begin PBXVariantGroup section */ 422 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 423 | isa = PBXVariantGroup; 424 | children = ( 425 | 6003F597195388D20070C39A /* en */, 426 | ); 427 | name = InfoPlist.strings; 428 | sourceTree = ""; 429 | }; 430 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 431 | isa = PBXVariantGroup; 432 | children = ( 433 | 6003F5B9195388D20070C39A /* en */, 434 | ); 435 | name = InfoPlist.strings; 436 | sourceTree = ""; 437 | }; 438 | /* End PBXVariantGroup section */ 439 | 440 | /* Begin XCBuildConfiguration section */ 441 | 6003F5BD195388D20070C39A /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ALWAYS_SEARCH_USER_PATHS = NO; 445 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 446 | CLANG_CXX_LIBRARY = "libc++"; 447 | CLANG_ENABLE_MODULES = YES; 448 | CLANG_ENABLE_OBJC_ARC = YES; 449 | CLANG_WARN_BOOL_CONVERSION = YES; 450 | CLANG_WARN_CONSTANT_CONVERSION = YES; 451 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 452 | CLANG_WARN_EMPTY_BODY = YES; 453 | CLANG_WARN_ENUM_CONVERSION = YES; 454 | CLANG_WARN_INT_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | ENABLE_TESTABILITY = YES; 460 | GCC_C_LANGUAGE_STANDARD = gnu99; 461 | GCC_DYNAMIC_NO_PIC = NO; 462 | GCC_OPTIMIZATION_LEVEL = 0; 463 | GCC_PREPROCESSOR_DEFINITIONS = ( 464 | "DEBUG=1", 465 | "$(inherited)", 466 | ); 467 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 468 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 469 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 470 | GCC_WARN_UNDECLARED_SELECTOR = YES; 471 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 472 | GCC_WARN_UNUSED_FUNCTION = YES; 473 | GCC_WARN_UNUSED_VARIABLE = YES; 474 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 475 | ONLY_ACTIVE_ARCH = YES; 476 | SDKROOT = iphoneos; 477 | TARGETED_DEVICE_FAMILY = "1,2"; 478 | }; 479 | name = Debug; 480 | }; 481 | 6003F5BE195388D20070C39A /* Release */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | ALWAYS_SEARCH_USER_PATHS = NO; 485 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 486 | CLANG_CXX_LIBRARY = "libc++"; 487 | CLANG_ENABLE_MODULES = YES; 488 | CLANG_ENABLE_OBJC_ARC = YES; 489 | CLANG_WARN_BOOL_CONVERSION = YES; 490 | CLANG_WARN_CONSTANT_CONVERSION = YES; 491 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 492 | CLANG_WARN_EMPTY_BODY = YES; 493 | CLANG_WARN_ENUM_CONVERSION = YES; 494 | CLANG_WARN_INT_CONVERSION = YES; 495 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 496 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 497 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 498 | COPY_PHASE_STRIP = YES; 499 | ENABLE_NS_ASSERTIONS = NO; 500 | GCC_C_LANGUAGE_STANDARD = gnu99; 501 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 502 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 503 | GCC_WARN_UNDECLARED_SELECTOR = YES; 504 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 505 | GCC_WARN_UNUSED_FUNCTION = YES; 506 | GCC_WARN_UNUSED_VARIABLE = YES; 507 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 508 | SDKROOT = iphoneos; 509 | TARGETED_DEVICE_FAMILY = "1,2"; 510 | VALIDATE_PRODUCT = YES; 511 | }; 512 | name = Release; 513 | }; 514 | 6003F5C0195388D20070C39A /* Debug */ = { 515 | isa = XCBuildConfiguration; 516 | baseConfigurationReference = 76D6FFB79DEE1BE313478E7C /* Pods-CRRulerControl_Example.debug.xcconfig */; 517 | buildSettings = { 518 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 519 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 520 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 521 | GCC_PREFIX_HEADER = "CRRulerControl/CRRulerControl-Prefix.pch"; 522 | INFOPLIST_FILE = "CRRulerControl/CRRulerControl-Info.plist"; 523 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 524 | MODULE_NAME = ExampleApp; 525 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | WRAPPER_EXTENSION = app; 528 | }; 529 | name = Debug; 530 | }; 531 | 6003F5C1195388D20070C39A /* Release */ = { 532 | isa = XCBuildConfiguration; 533 | baseConfigurationReference = E3D06A6CC5AD24B78FA59477 /* Pods-CRRulerControl_Example.release.xcconfig */; 534 | buildSettings = { 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 536 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 537 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 538 | GCC_PREFIX_HEADER = "CRRulerControl/CRRulerControl-Prefix.pch"; 539 | INFOPLIST_FILE = "CRRulerControl/CRRulerControl-Info.plist"; 540 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 541 | MODULE_NAME = ExampleApp; 542 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | WRAPPER_EXTENSION = app; 545 | }; 546 | name = Release; 547 | }; 548 | 6003F5C3195388D20070C39A /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | baseConfigurationReference = 5BC1F993D24C5351AFA37E43 /* Pods-CRRulerControl_Tests.debug.xcconfig */; 551 | buildSettings = { 552 | BUNDLE_LOADER = "$(TEST_HOST)"; 553 | FRAMEWORK_SEARCH_PATHS = ( 554 | "$(SDKROOT)/Developer/Library/Frameworks", 555 | "$(inherited)", 556 | "$(DEVELOPER_FRAMEWORKS_DIR)", 557 | ); 558 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 559 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 560 | GCC_PREPROCESSOR_DEFINITIONS = ( 561 | "DEBUG=1", 562 | "$(inherited)", 563 | ); 564 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 565 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 566 | PRODUCT_NAME = "$(TARGET_NAME)"; 567 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CRRulerControl_Example.app/CRRulerControl_Example"; 568 | WRAPPER_EXTENSION = xctest; 569 | }; 570 | name = Debug; 571 | }; 572 | 6003F5C4195388D20070C39A /* Release */ = { 573 | isa = XCBuildConfiguration; 574 | baseConfigurationReference = 4313911982D628FD34017C55 /* Pods-CRRulerControl_Tests.release.xcconfig */; 575 | buildSettings = { 576 | BUNDLE_LOADER = "$(TEST_HOST)"; 577 | FRAMEWORK_SEARCH_PATHS = ( 578 | "$(SDKROOT)/Developer/Library/Frameworks", 579 | "$(inherited)", 580 | "$(DEVELOPER_FRAMEWORKS_DIR)", 581 | ); 582 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 583 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 584 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 585 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CRRulerControl_Example.app/CRRulerControl_Example"; 588 | WRAPPER_EXTENSION = xctest; 589 | }; 590 | name = Release; 591 | }; 592 | /* End XCBuildConfiguration section */ 593 | 594 | /* Begin XCConfigurationList section */ 595 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "CRRulerControl" */ = { 596 | isa = XCConfigurationList; 597 | buildConfigurations = ( 598 | 6003F5BD195388D20070C39A /* Debug */, 599 | 6003F5BE195388D20070C39A /* Release */, 600 | ); 601 | defaultConfigurationIsVisible = 0; 602 | defaultConfigurationName = Release; 603 | }; 604 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CRRulerControl_Example" */ = { 605 | isa = XCConfigurationList; 606 | buildConfigurations = ( 607 | 6003F5C0195388D20070C39A /* Debug */, 608 | 6003F5C1195388D20070C39A /* Release */, 609 | ); 610 | defaultConfigurationIsVisible = 0; 611 | defaultConfigurationName = Release; 612 | }; 613 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CRRulerControl_Tests" */ = { 614 | isa = XCConfigurationList; 615 | buildConfigurations = ( 616 | 6003F5C3195388D20070C39A /* Debug */, 617 | 6003F5C4195388D20070C39A /* Release */, 618 | ); 619 | defaultConfigurationIsVisible = 0; 620 | defaultConfigurationName = Release; 621 | }; 622 | /* End XCConfigurationList section */ 623 | }; 624 | rootObject = 6003F582195388D10070C39A /* Project object */; 625 | } 626 | --------------------------------------------------------------------------------