From a8cf37ab37685b33580b71c71983965832ff2729 Mon Sep 17 00:00:00 2001 From: Andrew Podkovyrin Date: Fri, 6 Jan 2017 02:11:46 +0300 Subject: [PATCH] Reorganize project, add Carthage support, add nullability support, minor refactoring --- .gitignore | 46 +- .travis.yml | 14 + APNumberPad.podspec | 40 +- APNumberPad.xcodeproj/project.pbxproj | 521 -------------- .../xcshareddata/APNumberPad.xccheckout | 41 -- .../APNumberPad/APNumberPadDefaultStyle.m | 79 --- .../APNumberPad/NSBundle+APNumberPad.m | 25 - .../apnumberpad_backspace_icon.png | Bin .../apnumberpad_backspace_icon@2x.png | Bin .../apnumberpad_backspace_icon@3x.png | Bin .../{APNumberPad => Classes}/APNumberButton.h | 4 + .../{APNumberPad => Classes}/APNumberButton.m | 8 +- .../{APNumberPad => Classes}/APNumberPad.h | 8 +- .../{APNumberPad => Classes}/APNumberPad.m | 154 +++-- .../APNumberPadDefaultStyle.h | 6 +- APNumberPad/Classes/APNumberPadDefaultStyle.m | 79 +++ .../APNumberPadStyle.h | 6 +- .../NSBundle+APNumberPad.h | 4 + APNumberPad/Classes/NSBundle+APNumberPad.m | 25 + APNumberPad/DemoStyles/APDarkPadStyle.m | 54 -- .../AppIcon.appiconset/Contents.json | 23 - .../LaunchImage.launchimage/Contents.json | 23 - Example/APNumberPad.xcodeproj/project.pbxproj | 645 ++++++++++++++++++ .../contents.xcworkspacedata | 0 .../xcschemes/APNumberPad-Example.xcscheme | 101 +++ .../contents.xcworkspacedata | 10 + .../APNumberPad}/APAppDelegate.h | 6 +- .../APNumberPad}/APAppDelegate.m | 31 +- .../APNumberPad}/APNumberPad-Info.plist | 9 +- .../APNumberPad}/APNumberPad-Prefix.pch | 8 +- .../APNumberPadExampleViewController.h | 0 .../APNumberPadExampleViewController.m | 34 +- .../APNumberPad}/DemoStyles/APBluePadStyle.h | 2 +- .../APNumberPad}/DemoStyles/APBluePadStyle.m | 20 +- .../APNumberPad}/DemoStyles/APDarkPadStyle.h | 2 +- .../APNumberPad/DemoStyles/APDarkPadStyle.m | 56 ++ .../AppIcon.appiconset/Contents.json | 53 ++ .../LaunchImage.launchimage/Contents.json | 51 ++ .../APNumberPad}/en.lproj/InfoPlist.strings | 0 {APNumberPad => Example/APNumberPad}/main.m | 7 +- Example/Podfile | 11 + .../Tests/Tests-Info.plist | 2 +- Example/Tests/Tests-Prefix.pch | 7 + .../Tests/Tests.m | 11 +- .../Tests}/en.lproj/InfoPlist.strings | 0 LICENCE.txt => LICENSE | 38 +- README.md | 69 +- _Pods.xcodeproj | 1 + 48 files changed, 1338 insertions(+), 996 deletions(-) create mode 100644 .travis.yml delete mode 100755 APNumberPad.xcodeproj/project.pbxproj delete mode 100644 APNumberPad.xcodeproj/project.xcworkspace/xcshareddata/APNumberPad.xccheckout delete mode 100644 APNumberPad/APNumberPad/APNumberPadDefaultStyle.m delete mode 100644 APNumberPad/APNumberPad/NSBundle+APNumberPad.m rename APNumberPad/{APNumberPad.bundle/images => Assets}/apnumberpad_backspace_icon.png (100%) rename APNumberPad/{APNumberPad.bundle/images => Assets}/apnumberpad_backspace_icon@2x.png (100%) rename APNumberPad/{APNumberPad.bundle/images => Assets}/apnumberpad_backspace_icon@3x.png (100%) rename APNumberPad/{APNumberPad => Classes}/APNumberButton.h (91%) rename APNumberPad/{APNumberPad => Classes}/APNumberButton.m (97%) rename APNumberPad/{APNumberPad => Classes}/APNumberPad.h (90%) rename APNumberPad/{APNumberPad => Classes}/APNumberPad.m (89%) rename APNumberPad/{APNumberPad => Classes}/APNumberPadDefaultStyle.h (84%) create mode 100644 APNumberPad/Classes/APNumberPadDefaultStyle.m rename APNumberPad/{APNumberPad => Classes}/APNumberPadStyle.h (90%) rename APNumberPad/{APNumberPad => Classes}/NSBundle+APNumberPad.h (84%) create mode 100644 APNumberPad/Classes/NSBundle+APNumberPad.m delete mode 100644 APNumberPad/DemoStyles/APDarkPadStyle.m delete mode 100644 APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 Example/APNumberPad.xcodeproj/project.pbxproj rename {APNumberPad.xcodeproj => Example/APNumberPad.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) create mode 100644 Example/APNumberPad.xcodeproj/xcshareddata/xcschemes/APNumberPad-Example.xcscheme create mode 100644 Example/APNumberPad.xcworkspace/contents.xcworkspacedata rename {APNumberPad => Example/APNumberPad}/APAppDelegate.h (55%) rename {APNumberPad => Example/APNumberPad}/APAppDelegate.m (85%) rename {APNumberPad => Example/APNumberPad}/APNumberPad-Info.plist (76%) rename {APNumberPad => Example/APNumberPad}/APNumberPad-Prefix.pch (56%) rename {APNumberPad => Example/APNumberPad}/APNumberPadExampleViewController.h (100%) rename {APNumberPad => Example/APNumberPad}/APNumberPadExampleViewController.m (91%) rename {APNumberPad => Example/APNumberPad}/DemoStyles/APBluePadStyle.h (81%) rename {APNumberPad => Example/APNumberPad}/DemoStyles/APBluePadStyle.m (53%) rename {APNumberPad => Example/APNumberPad}/DemoStyles/APDarkPadStyle.h (81%) create mode 100644 Example/APNumberPad/DemoStyles/APDarkPadStyle.m create mode 100644 Example/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json rename {APNumberPad => Example/APNumberPad}/en.lproj/InfoPlist.strings (100%) rename {APNumberPad => Example/APNumberPad}/main.m (62%) create mode 100644 Example/Podfile rename APNumberPadTests/APNumberPadTests-Info.plist => Example/Tests/Tests-Info.plist (90%) create mode 100644 Example/Tests/Tests-Prefix.pch rename APNumberPadTests/APNumberPadTests.m => Example/Tests/Tests.m (68%) rename {APNumberPadTests => Example/Tests}/en.lproj/InfoPlist.strings (100%) rename LICENCE.txt => LICENSE (87%) create mode 120000 _Pods.xcodeproj diff --git a/.gitignore b/.gitignore index 44172cc..d855e82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,34 @@ -# OS X Finder +# OS X .DS_Store -# Xcode per-user config -*.mode1 +# Xcode +build/ +*.pbxuser +!default.pbxuser *.mode1v3 +!default.mode1v3 *.mode2v3 -*.perspective +!default.mode2v3 *.perspectivev3 -*.pbxuser -xcuserdata - -# Build products -build/ -*.o -*.LinkFileList +!default.perspectivev3 +xcuserdata/ +*.xccheckout +profile +*.moved-aside +DerivedData *.hmap +*.ipa -# Automatic backup files -*~.nib/ -*.swp -*~ -*.dat -*.dep +# Bundler +.bundle -# AppCode specific files -.idea/ -*.iml \ No newline at end of file +Carthage +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Note: if you ignore the Pods directory, make sure to uncomment +# `pod install` in .travis.yml +# +Pods/ +Example/Podfile.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..754df5e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +# references: +# * http://www.objc.io/issue-6/travis-ci.html +# * https://github.com/supermarin/xcpretty#usage + +osx_image: xcode7.3 +language: objective-c +# cache: cocoapods +# podfile: Example/Podfile +# before_install: +# - gem install cocoapods # Since Travis is not always on latest version +# - pod install --project-directory=Example +script: +- set -o pipefail && xcodebuild test -workspace Example/APNumberPad.xcworkspace -scheme APNumberPad-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty +- pod lib lint diff --git a/APNumberPad.podspec b/APNumberPad.podspec index 52cf5f4..8e5131a 100644 --- a/APNumberPad.podspec +++ b/APNumberPad.podspec @@ -1,17 +1,27 @@ Pod::Spec.new do |s| - s.name = 'APNumberPad' - s.version = '1.1.3' - s.summary = 'Full clone of iOS number keyboard with customizable function button' - s.description = 'Custom keyboard for iOS allows you to create a keyboard inputView '\ - 'that looks and feels just like the iPhone keyboard '\ - 'with UIKeyboardTypeNumberPad as keyboardType. '\ - 'Also APNumberPad provides customizable left-function button.' - s.homepage = 'https://github.com/podkovyrin/APNumberPad' - s.license = 'MIT' - s.author = { 'Andrew Podkovyrin' => 'podkovyrin@gmail.com' } - s.source = { :git => 'https://github.com/podkovyrin/APNumberPad.git', :tag => s.version.to_s } - s.platform = :ios, '6.0' - s.source_files = 'APNumberPad/APNumberPad/*.{h,m}' - s.resources = 'APNumberPad/APNumberPad.bundle' - s.requires_arc = true + s.name = 'APNumberPad' + s.version = '1.2.0' + s.summary = 'Full clone of iOS number keyboard with customizable function button' + + s.description = <<-DESC +Custom keyboard for iOS allows you to create a keyboard inputView +that looks and feels just like the iPhone keyboard +with UIKeyboardTypeNumberPad as keyboardType. +Also APNumberPad provides customizable left-function button. + DESC + + s.homepage = 'https://github.com/podkovyrin/APNumberPad' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'Andrew Podkovyrin' => 'podkovyrin@gmail.com' } + s.source = { :git => 'https://github.com/podkovyrin/APNumberPad.git', :tag => s.version.to_s } + s.social_media_url = 'https://twitter.com/podkovyr' + + s.ios.deployment_target = '8.2' + + s.source_files = 'APNumberPad/Classes/**/*' + s.resource_bundles = { + 'APNumberPad' => ['APNumberPad/Assets/*.png'] + } + + s.frameworks = 'UIKit' end diff --git a/APNumberPad.xcodeproj/project.pbxproj b/APNumberPad.xcodeproj/project.pbxproj deleted file mode 100755 index 05f3e01..0000000 --- a/APNumberPad.xcodeproj/project.pbxproj +++ /dev/null @@ -1,521 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 2ACD618519260EBD005E5DA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD618419260EBD005E5DA5 /* Foundation.framework */; }; - 2ACD618719260EBD005E5DA5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD618619260EBD005E5DA5 /* CoreGraphics.framework */; }; - 2ACD618919260EBD005E5DA5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD618819260EBD005E5DA5 /* UIKit.framework */; }; - 2ACD618F19260EBD005E5DA5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2ACD618D19260EBD005E5DA5 /* InfoPlist.strings */; }; - 2ACD619119260EBD005E5DA5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACD619019260EBD005E5DA5 /* main.m */; }; - 2ACD619519260EBD005E5DA5 /* APAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACD619419260EBD005E5DA5 /* APAppDelegate.m */; }; - 2ACD619719260EBD005E5DA5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2ACD619619260EBD005E5DA5 /* Images.xcassets */; }; - 2ACD619E19260EBD005E5DA5 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD619D19260EBD005E5DA5 /* XCTest.framework */; }; - 2ACD619F19260EBD005E5DA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD618419260EBD005E5DA5 /* Foundation.framework */; }; - 2ACD61A019260EBD005E5DA5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACD618819260EBD005E5DA5 /* UIKit.framework */; }; - 2ACD61A819260EBD005E5DA5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2ACD61A619260EBD005E5DA5 /* InfoPlist.strings */; }; - 2ACD61AA19260EBD005E5DA5 /* APNumberPadTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACD61A919260EBD005E5DA5 /* APNumberPadTests.m */; }; - 2ACD620619261A19005E5DA5 /* APNumberPadExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACD620519261A19005E5DA5 /* APNumberPadExampleViewController.m */; }; - 2ACD620919261D53005E5DA5 /* APNumberPad.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2ACD620819261D53005E5DA5 /* APNumberPad.bundle */; }; - B23467A11974A61800FE3F7A /* APNumberButton.m in Sources */ = {isa = PBXBuildFile; fileRef = B234679C1974A61800FE3F7A /* APNumberButton.m */; }; - B23467A21974A61800FE3F7A /* APNumberPad.m in Sources */ = {isa = PBXBuildFile; fileRef = B234679E1974A61800FE3F7A /* APNumberPad.m */; }; - B23467A31974A61800FE3F7A /* APNumberPadDefaultStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = B23467A01974A61800FE3F7A /* APNumberPadDefaultStyle.m */; }; - B23467A61974A66A00FE3F7A /* APDarkPadStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = B23467A51974A66A00FE3F7A /* APDarkPadStyle.m */; }; - B2DD031B197578030051DD71 /* APBluePadStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = B2DD031A197578030051DD71 /* APBluePadStyle.m */; }; - D8F707361D5A010800C63B6A /* NSBundle+APNumberPad.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F707351D5A010800C63B6A /* NSBundle+APNumberPad.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 2ACD61A119260EBD005E5DA5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 2ACD617919260EBD005E5DA5 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2ACD618019260EBD005E5DA5; - remoteInfo = APNumberPad; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 2A4F2A55197DA26500ADEB96 /* APNumberPadStyle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APNumberPadStyle.h; sourceTree = ""; }; - 2ACD618119260EBD005E5DA5 /* APNumberPad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APNumberPad.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 2ACD618419260EBD005E5DA5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 2ACD618619260EBD005E5DA5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 2ACD618819260EBD005E5DA5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 2ACD618C19260EBD005E5DA5 /* APNumberPad-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "APNumberPad-Info.plist"; sourceTree = ""; }; - 2ACD618E19260EBD005E5DA5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 2ACD619019260EBD005E5DA5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2ACD619219260EBD005E5DA5 /* APNumberPad-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "APNumberPad-Prefix.pch"; sourceTree = ""; }; - 2ACD619319260EBD005E5DA5 /* APAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APAppDelegate.h; sourceTree = ""; }; - 2ACD619419260EBD005E5DA5 /* APAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APAppDelegate.m; sourceTree = ""; }; - 2ACD619619260EBD005E5DA5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 2ACD619C19260EBD005E5DA5 /* APNumberPadTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APNumberPadTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 2ACD619D19260EBD005E5DA5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 2ACD61A519260EBD005E5DA5 /* APNumberPadTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "APNumberPadTests-Info.plist"; sourceTree = ""; }; - 2ACD61A719260EBD005E5DA5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 2ACD61A919260EBD005E5DA5 /* APNumberPadTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APNumberPadTests.m; sourceTree = ""; }; - 2ACD620419261A19005E5DA5 /* APNumberPadExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APNumberPadExampleViewController.h; sourceTree = ""; }; - 2ACD620519261A19005E5DA5 /* APNumberPadExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APNumberPadExampleViewController.m; sourceTree = ""; }; - 2ACD620819261D53005E5DA5 /* APNumberPad.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = APNumberPad.bundle; sourceTree = ""; }; - B234679B1974A61800FE3F7A /* APNumberButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APNumberButton.h; sourceTree = ""; }; - B234679C1974A61800FE3F7A /* APNumberButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APNumberButton.m; sourceTree = ""; }; - B234679D1974A61800FE3F7A /* APNumberPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APNumberPad.h; sourceTree = ""; }; - B234679E1974A61800FE3F7A /* APNumberPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APNumberPad.m; sourceTree = ""; }; - B234679F1974A61800FE3F7A /* APNumberPadDefaultStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APNumberPadDefaultStyle.h; sourceTree = ""; }; - B23467A01974A61800FE3F7A /* APNumberPadDefaultStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APNumberPadDefaultStyle.m; sourceTree = ""; }; - B23467A41974A66A00FE3F7A /* APDarkPadStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APDarkPadStyle.h; sourceTree = ""; }; - B23467A51974A66A00FE3F7A /* APDarkPadStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APDarkPadStyle.m; sourceTree = ""; }; - B2DD0319197578030051DD71 /* APBluePadStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APBluePadStyle.h; sourceTree = ""; }; - B2DD031A197578030051DD71 /* APBluePadStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APBluePadStyle.m; sourceTree = ""; }; - D8F707341D5A010800C63B6A /* NSBundle+APNumberPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+APNumberPad.h"; sourceTree = ""; }; - D8F707351D5A010800C63B6A /* NSBundle+APNumberPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+APNumberPad.m"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 2ACD617E19260EBD005E5DA5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD618719260EBD005E5DA5 /* CoreGraphics.framework in Frameworks */, - 2ACD618919260EBD005E5DA5 /* UIKit.framework in Frameworks */, - 2ACD618519260EBD005E5DA5 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2ACD619919260EBD005E5DA5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD619E19260EBD005E5DA5 /* XCTest.framework in Frameworks */, - 2ACD61A019260EBD005E5DA5 /* UIKit.framework in Frameworks */, - 2ACD619F19260EBD005E5DA5 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 2ACD617819260EBD005E5DA5 = { - isa = PBXGroup; - children = ( - 2ACD618A19260EBD005E5DA5 /* APNumberPad */, - 2ACD61A319260EBD005E5DA5 /* APNumberPadTests */, - 2ACD618319260EBD005E5DA5 /* Frameworks */, - 2ACD618219260EBD005E5DA5 /* Products */, - ); - sourceTree = ""; - }; - 2ACD618219260EBD005E5DA5 /* Products */ = { - isa = PBXGroup; - children = ( - 2ACD618119260EBD005E5DA5 /* APNumberPad.app */, - 2ACD619C19260EBD005E5DA5 /* APNumberPadTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 2ACD618319260EBD005E5DA5 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 2ACD618419260EBD005E5DA5 /* Foundation.framework */, - 2ACD618619260EBD005E5DA5 /* CoreGraphics.framework */, - 2ACD618819260EBD005E5DA5 /* UIKit.framework */, - 2ACD619D19260EBD005E5DA5 /* XCTest.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 2ACD618A19260EBD005E5DA5 /* APNumberPad */ = { - isa = PBXGroup; - children = ( - B234679A1974A61800FE3F7A /* APNumberPad */, - B23467991974A59B00FE3F7A /* DemoStyles */, - 2ACD620819261D53005E5DA5 /* APNumberPad.bundle */, - 2ACD619319260EBD005E5DA5 /* APAppDelegate.h */, - 2ACD619419260EBD005E5DA5 /* APAppDelegate.m */, - 2ACD619619260EBD005E5DA5 /* Images.xcassets */, - 2ACD618B19260EBD005E5DA5 /* Supporting Files */, - 2ACD620419261A19005E5DA5 /* APNumberPadExampleViewController.h */, - 2ACD620519261A19005E5DA5 /* APNumberPadExampleViewController.m */, - ); - path = APNumberPad; - sourceTree = ""; - }; - 2ACD618B19260EBD005E5DA5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 2ACD618C19260EBD005E5DA5 /* APNumberPad-Info.plist */, - 2ACD618D19260EBD005E5DA5 /* InfoPlist.strings */, - 2ACD619019260EBD005E5DA5 /* main.m */, - 2ACD619219260EBD005E5DA5 /* APNumberPad-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 2ACD61A319260EBD005E5DA5 /* APNumberPadTests */ = { - isa = PBXGroup; - children = ( - 2ACD61A919260EBD005E5DA5 /* APNumberPadTests.m */, - 2ACD61A419260EBD005E5DA5 /* Supporting Files */, - ); - path = APNumberPadTests; - sourceTree = ""; - }; - 2ACD61A419260EBD005E5DA5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 2ACD61A519260EBD005E5DA5 /* APNumberPadTests-Info.plist */, - 2ACD61A619260EBD005E5DA5 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - B23467991974A59B00FE3F7A /* DemoStyles */ = { - isa = PBXGroup; - children = ( - B23467A41974A66A00FE3F7A /* APDarkPadStyle.h */, - B23467A51974A66A00FE3F7A /* APDarkPadStyle.m */, - B2DD0319197578030051DD71 /* APBluePadStyle.h */, - B2DD031A197578030051DD71 /* APBluePadStyle.m */, - ); - path = DemoStyles; - sourceTree = ""; - }; - B234679A1974A61800FE3F7A /* APNumberPad */ = { - isa = PBXGroup; - children = ( - B234679B1974A61800FE3F7A /* APNumberButton.h */, - B234679C1974A61800FE3F7A /* APNumberButton.m */, - B234679D1974A61800FE3F7A /* APNumberPad.h */, - B234679E1974A61800FE3F7A /* APNumberPad.m */, - B234679F1974A61800FE3F7A /* APNumberPadDefaultStyle.h */, - B23467A01974A61800FE3F7A /* APNumberPadDefaultStyle.m */, - 2A4F2A55197DA26500ADEB96 /* APNumberPadStyle.h */, - D8F707341D5A010800C63B6A /* NSBundle+APNumberPad.h */, - D8F707351D5A010800C63B6A /* NSBundle+APNumberPad.m */, - ); - path = APNumberPad; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 2ACD618019260EBD005E5DA5 /* APNumberPad */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2ACD61AD19260EBD005E5DA5 /* Build configuration list for PBXNativeTarget "APNumberPad" */; - buildPhases = ( - 2ACD617D19260EBD005E5DA5 /* Sources */, - 2ACD617E19260EBD005E5DA5 /* Frameworks */, - 2ACD617F19260EBD005E5DA5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = APNumberPad; - productName = APNumberPad; - productReference = 2ACD618119260EBD005E5DA5 /* APNumberPad.app */; - productType = "com.apple.product-type.application"; - }; - 2ACD619B19260EBD005E5DA5 /* APNumberPadTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2ACD61B019260EBD005E5DA5 /* Build configuration list for PBXNativeTarget "APNumberPadTests" */; - buildPhases = ( - 2ACD619819260EBD005E5DA5 /* Sources */, - 2ACD619919260EBD005E5DA5 /* Frameworks */, - 2ACD619A19260EBD005E5DA5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 2ACD61A219260EBD005E5DA5 /* PBXTargetDependency */, - ); - name = APNumberPadTests; - productName = APNumberPadTests; - productReference = 2ACD619C19260EBD005E5DA5 /* APNumberPadTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 2ACD617919260EBD005E5DA5 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = AP; - LastUpgradeCheck = 0510; - ORGANIZATIONNAME = "Andrew Podkovyrin"; - TargetAttributes = { - 2ACD619B19260EBD005E5DA5 = { - TestTargetID = 2ACD618019260EBD005E5DA5; - }; - }; - }; - buildConfigurationList = 2ACD617C19260EBD005E5DA5 /* Build configuration list for PBXProject "APNumberPad" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 2ACD617819260EBD005E5DA5; - productRefGroup = 2ACD618219260EBD005E5DA5 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 2ACD618019260EBD005E5DA5 /* APNumberPad */, - 2ACD619B19260EBD005E5DA5 /* APNumberPadTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 2ACD617F19260EBD005E5DA5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD618F19260EBD005E5DA5 /* InfoPlist.strings in Resources */, - 2ACD619719260EBD005E5DA5 /* Images.xcassets in Resources */, - 2ACD620919261D53005E5DA5 /* APNumberPad.bundle in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2ACD619A19260EBD005E5DA5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD61A819260EBD005E5DA5 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 2ACD617D19260EBD005E5DA5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD619119260EBD005E5DA5 /* main.m in Sources */, - B23467A31974A61800FE3F7A /* APNumberPadDefaultStyle.m in Sources */, - B2DD031B197578030051DD71 /* APBluePadStyle.m in Sources */, - B23467A11974A61800FE3F7A /* APNumberButton.m in Sources */, - B23467A21974A61800FE3F7A /* APNumberPad.m in Sources */, - 2ACD620619261A19005E5DA5 /* APNumberPadExampleViewController.m in Sources */, - D8F707361D5A010800C63B6A /* NSBundle+APNumberPad.m in Sources */, - 2ACD619519260EBD005E5DA5 /* APAppDelegate.m in Sources */, - B23467A61974A66A00FE3F7A /* APDarkPadStyle.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2ACD619819260EBD005E5DA5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2ACD61AA19260EBD005E5DA5 /* APNumberPadTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 2ACD61A219260EBD005E5DA5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 2ACD618019260EBD005E5DA5 /* APNumberPad */; - targetProxy = 2ACD61A119260EBD005E5DA5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 2ACD618D19260EBD005E5DA5 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 2ACD618E19260EBD005E5DA5 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 2ACD61A619260EBD005E5DA5 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 2ACD61A719260EBD005E5DA5 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 2ACD61AB19260EBD005E5DA5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 2ACD61AC19260EBD005E5DA5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 2ACD61AE19260EBD005E5DA5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; - INFOPLIST_FILE = "APNumberPad/APNumberPad-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 2ACD61AF19260EBD005E5DA5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; - INFOPLIST_FILE = "APNumberPad/APNumberPad-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 2ACD61B119260EBD005E5DA5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/APNumberPad.app/APNumberPad"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "APNumberPadTests/APNumberPadTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - 2ACD61B219260EBD005E5DA5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/APNumberPad.app/APNumberPad"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; - INFOPLIST_FILE = "APNumberPadTests/APNumberPadTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2ACD617C19260EBD005E5DA5 /* Build configuration list for PBXProject "APNumberPad" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2ACD61AB19260EBD005E5DA5 /* Debug */, - 2ACD61AC19260EBD005E5DA5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2ACD61AD19260EBD005E5DA5 /* Build configuration list for PBXNativeTarget "APNumberPad" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2ACD61AE19260EBD005E5DA5 /* Debug */, - 2ACD61AF19260EBD005E5DA5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2ACD61B019260EBD005E5DA5 /* Build configuration list for PBXNativeTarget "APNumberPadTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2ACD61B119260EBD005E5DA5 /* Debug */, - 2ACD61B219260EBD005E5DA5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 2ACD617919260EBD005E5DA5 /* Project object */; -} diff --git a/APNumberPad.xcodeproj/project.xcworkspace/xcshareddata/APNumberPad.xccheckout b/APNumberPad.xcodeproj/project.xcworkspace/xcshareddata/APNumberPad.xccheckout deleted file mode 100644 index a13a675..0000000 --- a/APNumberPad.xcodeproj/project.xcworkspace/xcshareddata/APNumberPad.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - F5218634-6CFB-46FE-AABC-BC814ED76F77 - IDESourceControlProjectName - APNumberPad - IDESourceControlProjectOriginsDictionary - - 7B54C4CA-B1A7-4E48-BF5D-A66FD7776A7B - https://github.com/podkovyrin/APNumberPad.git - - IDESourceControlProjectPath - APNumberPad.xcodeproj/project.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - 7B54C4CA-B1A7-4E48-BF5D-A66FD7776A7B - ../.. - - IDESourceControlProjectURL - https://github.com/podkovyrin/APNumberPad.git - IDESourceControlProjectVersion - 110 - IDESourceControlProjectWCCIdentifier - 7B54C4CA-B1A7-4E48-BF5D-A66FD7776A7B - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - 7B54C4CA-B1A7-4E48-BF5D-A66FD7776A7B - IDESourceControlWCCName - APNumberPad - - - - diff --git a/APNumberPad/APNumberPad/APNumberPadDefaultStyle.m b/APNumberPad/APNumberPad/APNumberPadDefaultStyle.m deleted file mode 100644 index 386340e..0000000 --- a/APNumberPad/APNumberPad/APNumberPadDefaultStyle.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// APNumberPadDefaultStyle.m -// APNumberPad -// -// Created by Andrew Podkovyrin on 16/05/14. -// Copyright (c) 2014 Podkovyrin. All rights reserved. -// - -#import "APNumberPadDefaultStyle.h" -#import "NSBundle+APNumberPad.h" - -static inline UIColor * APNP_RGBa(int r, int g, int b, CGFloat alpha) { - return [UIColor colorWithRed:r / 255.f - green:g / 255.f - blue:b / 255.f - alpha:alpha]; -} - -@implementation APNumberPadDefaultStyle - -#pragma mark - Pad - -+ (CGRect)numberPadFrame { - return CGRectMake(0.f, 0.f, 320.f, 216.f); -} - -+ (CGFloat)separator { - return [UIScreen mainScreen].scale == 2.f ? 0.5f : 1.f; -} - -+ (UIColor *)numberPadBackgroundColor { - return APNP_RGBa(183, 186, 191, 1.f); -} - -#pragma mark - Number button - -+ (UIFont *)numberButtonFont { - return [UIFont fontWithName:@"HelveticaNeue-Light" size:28.f]; -} - -+ (UIColor *)numberButtonTextColor { - return [UIColor blackColor]; -} - -+ (UIColor *)numberButtonBackgroundColor { - return APNP_RGBa(252, 252, 252, 1.f); -} - -+ (UIColor *)numberButtonHighlightedColor { - return APNP_RGBa(188, 192, 198, 1.f); -} - -#pragma mark - Function button - -+ (UIFont *)functionButtonFont { - return [UIFont fontWithName:@"HelveticaNeue-Light" size:28.f]; -} - -+ (UIColor *)functionButtonTextColor { - return [UIColor blackColor]; -} - -+ (UIColor *)functionButtonBackgroundColor { - return APNP_RGBa(188, 192, 198, 1.f); -} - -+ (UIColor *)functionButtonHighlightedColor { - return APNP_RGBa(252, 252, 252, 1.f); -} - -+ (UIImage *)clearFunctionButtonImage { - return [UIImage imageNamed:@"images/apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; -} - -+(UIImage *)clearFunctionButtonImageHighlighted { - return [UIImage imageNamed:@"images/apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; -} - -@end diff --git a/APNumberPad/APNumberPad/NSBundle+APNumberPad.m b/APNumberPad/APNumberPad/NSBundle+APNumberPad.m deleted file mode 100644 index b08fa9a..0000000 --- a/APNumberPad/APNumberPad/NSBundle+APNumberPad.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// NSBundle+APNumberPad.m -// APNumberPad -// -// Created by Kian Lim on 8/9/16. -// Copyright © 2016 Andrew Podkovyrin. All rights reserved. -// -// Category credits to Chris Dzombak https://github.com/NYTimes/NYTPhotoViewer - -#import "NSBundle+APNumberPad.h" - -@implementation NSBundle (APNumberPad) - -+ (instancetype)ap_numberPadResourceBundle { - static NSBundle *resourceBundle = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSString *resourceBundlePath = [[NSBundle bundleForClass:NSClassFromString(@"APNumberPad")] pathForResource:@"APNumberPad" ofType:@"bundle"]; - resourceBundle = [self bundleWithPath:resourceBundlePath]; - }); - - return resourceBundle; -} - -@end diff --git a/APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon.png b/APNumberPad/Assets/apnumberpad_backspace_icon.png similarity index 100% rename from APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon.png rename to APNumberPad/Assets/apnumberpad_backspace_icon.png diff --git a/APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon@2x.png b/APNumberPad/Assets/apnumberpad_backspace_icon@2x.png similarity index 100% rename from APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon@2x.png rename to APNumberPad/Assets/apnumberpad_backspace_icon@2x.png diff --git a/APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon@3x.png b/APNumberPad/Assets/apnumberpad_backspace_icon@3x.png similarity index 100% rename from APNumberPad/APNumberPad.bundle/images/apnumberpad_backspace_icon@3x.png rename to APNumberPad/Assets/apnumberpad_backspace_icon@3x.png diff --git a/APNumberPad/APNumberPad/APNumberButton.h b/APNumberPad/Classes/APNumberButton.h similarity index 91% rename from APNumberPad/APNumberPad/APNumberButton.h rename to APNumberPad/Classes/APNumberButton.h index 3f5e738..c4f67ff 100644 --- a/APNumberPad/APNumberPad/APNumberButton.h +++ b/APNumberPad/Classes/APNumberButton.h @@ -7,6 +7,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface APNumberButton : UIButton + (instancetype)buttonWithBackgroundColor:(UIColor *)backgroundColor highlightedColor:(UIColor *)highlightedColor; @@ -16,3 +18,5 @@ - (void)np_touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; @end + +NS_ASSUME_NONNULL_END diff --git a/APNumberPad/APNumberPad/APNumberButton.m b/APNumberPad/Classes/APNumberButton.m similarity index 97% rename from APNumberPad/APNumberPad/APNumberButton.m rename to APNumberPad/Classes/APNumberButton.m index b7f1299..c005b14 100644 --- a/APNumberPad/APNumberPad/APNumberButton.m +++ b/APNumberPad/Classes/APNumberButton.m @@ -12,16 +12,16 @@ @implementation UIImage (APNumberPad) + (UIImage *)ap_imageWithColor:(UIColor *)color { - CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); + CGRect rect = CGRectMake(0.0, 0.0, 1.0, 1.0); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); - + CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); - + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); - + return image; } diff --git a/APNumberPad/APNumberPad/APNumberPad.h b/APNumberPad/Classes/APNumberPad.h similarity index 90% rename from APNumberPad/APNumberPad/APNumberPad.h rename to APNumberPad/Classes/APNumberPad.h index 8dc33cc..a63016e 100644 --- a/APNumberPad/APNumberPad/APNumberPad.h +++ b/APNumberPad/Classes/APNumberPad.h @@ -6,17 +6,19 @@ // #import + #import "APNumberPadStyle.h" +NS_ASSUME_NONNULL_BEGIN + @protocol APNumberPadDelegate; /// @interface APNumberPad : UIView -+ (instancetype)numberPadWithDelegate:(id)delegate numberPadStyleClass:(Class)styleClass; - + (instancetype)numberPadWithDelegate:(id)delegate; ++ (instancetype)numberPadWithDelegate:(id)delegate numberPadStyleClass:(nullable Class)styleClass; /** * Left function button for custom configuration @@ -44,3 +46,5 @@ - (void)numberPad:(APNumberPad *)numberPad functionButtonAction:(UIButton *)functionButton textInput:(UIResponder *)textInput; @end + +NS_ASSUME_NONNULL_END diff --git a/APNumberPad/APNumberPad/APNumberPad.m b/APNumberPad/Classes/APNumberPad.m similarity index 89% rename from APNumberPad/APNumberPad/APNumberPad.m rename to APNumberPad/Classes/APNumberPad.m index 040a7ab..9aa1d81 100755 --- a/APNumberPad/APNumberPad/APNumberPad.m +++ b/APNumberPad/Classes/APNumberPad.m @@ -5,19 +5,19 @@ // Copyright (c) 2014 Podkovyrin. All rights reserved. // -#import "APNumberPad.h" - #import "APNumberButton.h" #import "APNumberPadDefaultStyle.h" +#import "APNumberPad.h" + @interface APNumberPad () { BOOL _clearButtonLongPressGesture; - - struct { - unsigned int textInputSupportsShouldChangeTextInRange:1; - unsigned int delegateSupportsTextFieldShouldChangeCharactersInRange:1; - unsigned int delegateSupportsTextViewShouldChangeTextInRange:1; - } _delegateFlags; + + struct { + unsigned int textInputSupportsShouldChangeTextInRange : 1; + unsigned int delegateSupportsTextFieldShouldChangeCharactersInRange : 1; + unsigned int delegateSupportsTextViewShouldChangeTextInRange : 1; + } _delegateFlags; } /** @@ -59,7 +59,7 @@ + (instancetype)numberPadWithDelegate:(id)delegate { return [self numberPadWithDelegate:delegate numberPadStyleClass:nil]; } -+ (instancetype)numberPadWithDelegate:(id)delegate numberPadStyleClass:(Class)styleClass{ ++ (instancetype)numberPadWithDelegate:(id)delegate numberPadStyleClass:(Class)styleClass { return [[self alloc] initWithDelegate:delegate numberPadStyleClass:styleClass]; } @@ -70,11 +70,11 @@ - (instancetype)initWithDelegate:(id)delegate numberPadStyl self.frame = [self.styleClass numberPadFrame]; self.autoresizingMask = UIViewAutoresizingFlexibleHeight; // for support rotation self.backgroundColor = [self.styleClass numberPadBackgroundColor]; - + [self addNotificationsObservers]; - + self.delegate = delegate; - + // Number buttons (0-9) // NSMutableArray *numberButtons = [NSMutableArray array]; @@ -84,7 +84,7 @@ - (instancetype)initWithDelegate:(id)delegate numberPadStyl [numberButtons addObject:numberButton]; } self.numberButtons = numberButtons; - + // Function button // self.leftButton = [self functionButton]; @@ -92,16 +92,17 @@ - (instancetype)initWithDelegate:(id)delegate numberPadStyl [self.leftButton setTitleColor:[self.styleClass functionButtonTextColor] forState:UIControlStateNormal]; [self.leftButton addTarget:self action:@selector(functionButtonAction:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:self.leftButton]; - + // Clear button // self.clearButton = [self functionButton]; [self.clearButton setImage:[self.styleClass clearFunctionButtonImage] forState:UIControlStateNormal]; [self.clearButton setImage:[self.styleClass clearFunctionButtonImageHighlighted] forState:UIControlStateHighlighted]; [self.clearButton addTarget:self action:@selector(clearButtonAction) forControlEvents:UIControlEventTouchUpInside]; - + UILongPressGestureRecognizer *longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] - initWithTarget:self action:@selector(longPressGestureRecognizerAction:)]; + initWithTarget:self + action:@selector(longPressGestureRecognizerAction:)]; longPressGestureRecognizer.cancelsTouchesInView = NO; [self.clearButton addGestureRecognizer:longPressGestureRecognizer]; [self addSubview:self.clearButton]; @@ -115,53 +116,54 @@ - (void)dealloc { - (void)layoutSubviews { [super layoutSubviews]; - + int rows = 4; int sections = 3; - - const UIUserInterfaceIdiom interfaceIdiom = UI_USER_INTERFACE_IDIOM(); - const CGFloat maximumWidth = (interfaceIdiom == UIUserInterfaceIdiomPad) ? 400.0f : CGRectGetWidth(self.bounds); - + + const UIUserInterfaceIdiom interfaceIdiom = UI_USER_INTERFACE_IDIOM(); + const CGFloat maximumWidth = (interfaceIdiom == UIUserInterfaceIdiomPad) ? 400.0 : CGRectGetWidth(self.bounds); + CGFloat sep = [self.styleClass separator]; - CGFloat left = (CGRectGetWidth(self.bounds) - maximumWidth) / 2; + CGFloat left = (CGRectGetWidth(self.bounds) - maximumWidth) / 2; CGFloat top = 0.f; - + #if defined(__LP64__) && __LP64__ CGFloat buttonHeight = trunc((CGRectGetHeight(self.bounds) - sep * (rows - 1)) / rows) + sep; #else CGFloat buttonHeight = truncf((CGRectGetHeight(self.bounds) - sep * (rows - 1)) / rows) + sep; #endif - + CGSize buttonSize = CGSizeMake((CGRectGetWidth(self.bounds) - sep * (sections - 1)) / sections, buttonHeight); - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - buttonSize = CGSizeMake((maximumWidth - sep * (sections - 1)) / sections, buttonHeight); - } + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + buttonSize = CGSizeMake((maximumWidth - sep * (sections - 1)) / sections, buttonHeight); + } // Number buttons (1-9) // for (int i = 1; i < self.numberButtons.count - 1; i++) { APNumberButton *numberButton = self.numberButtons[i]; numberButton.frame = CGRectMake(left, top, buttonSize.width, buttonSize.height); - + if (i % sections == 0) { left = (CGRectGetWidth(self.bounds) - maximumWidth) / 2; top += buttonSize.height + sep; - } else { + } + else { left += buttonSize.width + sep; } } - + // Function button // left = (CGRectGetWidth(self.bounds) - maximumWidth) / 2; self.leftButton.frame = CGRectMake(left, top, buttonSize.width, buttonSize.height); - + // Number buttons (0) // left += buttonSize.width + sep; UIButton *zeroButton = self.numberButtons.firstObject; zeroButton.frame = CGRectMake(left, top, buttonSize.width, buttonSize.height); - + // Clear button // left += buttonSize.width + sep; @@ -175,17 +177,17 @@ - (void)addNotificationsObservers { selector:@selector(textDidBeginEditing:) name:UITextFieldTextDidBeginEditingNotification object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidBeginEditing:) name:UITextViewTextDidBeginEditingNotification object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidEndEditing:) name:UITextFieldTextDidEndEditingNotification object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidEndEditing:) name:UITextViewTextDidEndEditingNotification @@ -196,24 +198,26 @@ - (void)textDidBeginEditing:(NSNotification *)notification { if (![notification.object conformsToProtocol:@protocol(UITextInput)]) { return; } - + UIResponder *textInput = notification.object; - + if (textInput.inputView && self == textInput.inputView) { self.textInput = textInput; - + _delegateFlags.textInputSupportsShouldChangeTextInRange = NO; _delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange = NO; _delegateFlags.delegateSupportsTextViewShouldChangeTextInRange = NO; - + if ([self.textInput respondsToSelector:@selector(shouldChangeTextInRange:replacementText:)]) { _delegateFlags.textInputSupportsShouldChangeTextInRange = YES; - } else if ([self.textInput isKindOfClass:[UITextField class]]) { + } + else if ([self.textInput isKindOfClass:[UITextField class]]) { id delegate = [(UITextField *)self.textInput delegate]; if ([delegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)]) { _delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange = YES; } - } else if ([self.textInput isKindOfClass:[UITextView class]]) { + } + else if ([self.textInput isKindOfClass:[UITextView class]]) { id delegate = [(UITextView *)self.textInput delegate]; if ([delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { _delegateFlags.delegateSupportsTextViewShouldChangeTextInRange = YES; @@ -230,7 +234,7 @@ - (void)textDidEndEditing:(NSNotification *)notification { - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[UIDevice currentDevice] playInputClick]; - + // Perform number button action for previous `self.lastTouch` // if (self.lastTouch) { @@ -240,14 +244,15 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // `touches` contains only one UITouch (self.multipleTouchEnabled == NO) // self.lastTouch = [touches anyObject]; - + // Update highlighted state for number buttons, cancel `touches` for everything but the catched // CGPoint location = [self.lastTouch locationInView:self]; for (APNumberButton *b in self.numberButtons) { if (CGRectContainsPoint(b.frame, location)) { b.highlighted = YES; - } else { + } + else { b.highlighted = NO; [b np_touchesCancelled:touches withEvent:event]; } @@ -258,24 +263,24 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { if (!self.lastTouch || ![touches containsObject:self.lastTouch]) { return; // ignore old touches movings } - + CGPoint location = [self.lastTouch locationInView:self]; - + // Forget highlighted state for functional buttons after move // if (!CGRectContainsPoint(self.clearButton.frame, location)) { APNumberButton *clearButton = (id)self.clearButton; [clearButton np_touchesCancelled:touches withEvent:event]; - + // Disable long gesture action for clear button // _clearButtonLongPressGesture = NO; } - + if (!CGRectContainsPoint(self.leftButton.frame, location)) { [self.leftButton np_touchesCancelled:touches withEvent:event]; } - + // Update highlighted state for number buttons // for (APNumberButton *b in self.numberButtons) { @@ -287,9 +292,9 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { if (!self.lastTouch || ![touches containsObject:self.lastTouch]) { return; // ignore old touches } - + [self performLastTouchAction]; - + self.lastTouch = nil; } @@ -298,11 +303,11 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { // self.leftButton.highlighted = NO; self.clearButton.highlighted = NO; - + for (APNumberButton *b in self.numberButtons) { b.highlighted = NO; } - + self.lastTouch = nil; } @@ -323,7 +328,8 @@ - (void)performLastTouchAction { - (void)setStyleClass:(Class)styleClass { if (styleClass) { _styleClass = styleClass; - } else { + } + else { _styleClass = [APNumberPadDefaultStyle class]; } } @@ -340,26 +346,29 @@ - (void)numberButtonAction:(UIButton *)sender { if (!self.textInput) { return; } - + NSString *text = sender.currentTitle; - + if (_delegateFlags.textInputSupportsShouldChangeTextInRange) { if ([self.textInput shouldChangeTextInRange:self.textInput.selectedTextRange replacementText:text]) { [self.textInput insertText:text]; } - } else if (_delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange) { + } + else if (_delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange) { NSRange selectedRange = [[self class] selectedRange:self.textInput]; UITextField *textField = (UITextField *)self.textInput; if ([textField.delegate textField:textField shouldChangeCharactersInRange:selectedRange replacementString:text]) { [self.textInput insertText:text]; } - } else if (_delegateFlags.delegateSupportsTextViewShouldChangeTextInRange) { + } + else if (_delegateFlags.delegateSupportsTextViewShouldChangeTextInRange) { NSRange selectedRange = [[self class] selectedRange:self.textInput]; UITextView *textView = (UITextView *)self.textInput; if ([textView.delegate textView:textView shouldChangeTextInRange:selectedRange replacementText:text]) { [self.textInput insertText:text]; } - } else { + } + else { [self.textInput insertText:text]; } } @@ -368,7 +377,7 @@ - (void)clearButtonAction { if (!self.textInput) { return; } - + if (_delegateFlags.textInputSupportsShouldChangeTextInRange) { UITextRange *textRange = self.textInput.selectedTextRange; if ([textRange.start isEqual:textRange.end]) { @@ -378,7 +387,8 @@ - (void)clearButtonAction { if ([self.textInput shouldChangeTextInRange:textRange replacementText:@""]) { [self.textInput deleteBackward]; } - } else if (_delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange) { + } + else if (_delegateFlags.delegateSupportsTextFieldShouldChangeCharactersInRange) { NSRange selectedRange = [[self class] selectedRange:self.textInput]; if (selectedRange.length == 0 && selectedRange.location > 0) { selectedRange.location--; @@ -388,7 +398,8 @@ - (void)clearButtonAction { if ([textField.delegate textField:textField shouldChangeCharactersInRange:selectedRange replacementString:@""]) { [self.textInput deleteBackward]; } - } else if (_delegateFlags.delegateSupportsTextViewShouldChangeTextInRange) { + } + else if (_delegateFlags.delegateSupportsTextViewShouldChangeTextInRange) { NSRange selectedRange = [[self class] selectedRange:self.textInput]; if (selectedRange.length == 0 && selectedRange.location > 0) { selectedRange.location--; @@ -398,7 +409,8 @@ - (void)clearButtonAction { if ([textView.delegate textView:textView shouldChangeTextInRange:selectedRange replacementText:@""]) { [self.textInput deleteBackward]; } - } else { + } + else { [self.textInput deleteBackward]; } } @@ -407,7 +419,7 @@ - (void)functionButtonAction:(id)sender { if (!self.textInput) { return; } - + if ([self.delegate respondsToSelector:@selector(numberPad:functionButtonAction:textInput:)]) { [self.delegate numberPad:self functionButtonAction:sender textInput:self.textInput]; } @@ -419,7 +431,8 @@ - (void)longPressGestureRecognizerAction:(UILongPressGestureRecognizer *)gesture if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { _clearButtonLongPressGesture = YES; [self clearButtonActionLongPress]; - } else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { + } + else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { _clearButtonLongPressGesture = NO; } } @@ -428,10 +441,11 @@ - (void)clearButtonActionLongPress { if (_clearButtonLongPressGesture) { if ([self.textInput hasText]) { [[UIDevice currentDevice] playInputClick]; - + [self clearButtonAction]; - [self performSelector:@selector(clearButtonActionLongPress) withObject:nil afterDelay:0.1f]; // delay like in iOS keyboard - } else { + [self performSelector:@selector(clearButtonActionLongPress) withObject:nil afterDelay:0.1]; // delay like in iOS keyboard + } + else { _clearButtonLongPressGesture = NO; } } @@ -447,10 +461,10 @@ - (BOOL)enableInputClicksWhenVisible { + (NSRange)selectedRange:(id)textInput { UITextRange *textRange = [textInput selectedTextRange]; - + NSInteger startOffset = [textInput offsetFromPosition:textInput.beginningOfDocument toPosition:textRange.start]; NSInteger endOffset = [textInput offsetFromPosition:textInput.beginningOfDocument toPosition:textRange.end]; - + return NSMakeRange(startOffset, endOffset - startOffset); } diff --git a/APNumberPad/APNumberPad/APNumberPadDefaultStyle.h b/APNumberPad/Classes/APNumberPadDefaultStyle.h similarity index 84% rename from APNumberPad/APNumberPad/APNumberPadDefaultStyle.h rename to APNumberPad/Classes/APNumberPadDefaultStyle.h index 400e7bd..3deb82b 100644 --- a/APNumberPad/APNumberPad/APNumberPadDefaultStyle.h +++ b/APNumberPad/Classes/APNumberPadDefaultStyle.h @@ -6,10 +6,12 @@ // Copyright (c) 2014 Podkovyrin. All rights reserved. // -#import #import "APNumberPadStyle.h" -@interface APNumberPadDefaultStyle : NSObject +NS_ASSUME_NONNULL_BEGIN +@interface APNumberPadDefaultStyle : NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/APNumberPad/Classes/APNumberPadDefaultStyle.m b/APNumberPad/Classes/APNumberPadDefaultStyle.m new file mode 100644 index 0000000..6aa17e7 --- /dev/null +++ b/APNumberPad/Classes/APNumberPadDefaultStyle.m @@ -0,0 +1,79 @@ +// +// APNumberPadDefaultStyle.m +// APNumberPad +// +// Created by Andrew Podkovyrin on 16/05/14. +// Copyright (c) 2014 Podkovyrin. All rights reserved. +// + +#import "APNumberPadDefaultStyle.h" +#import "NSBundle+APNumberPad.h" + +static inline UIColor *APNP_RGBa(int r, int g, int b, CGFloat alpha) { + return [UIColor colorWithRed:r / 255.0 + green:g / 255.0 + blue:b / 255.0 + alpha:alpha]; +} + +@implementation APNumberPadDefaultStyle + +#pragma mark - Pad + ++ (CGRect)numberPadFrame { + return CGRectMake(0.0, 0.0, 320.0, 216.0); +} + ++ (CGFloat)separator { + return [UIScreen mainScreen].scale == 2.0 ? 0.5 : 1.0; +} + ++ (UIColor *)numberPadBackgroundColor { + return APNP_RGBa(183, 186, 191, 1.0); +} + +#pragma mark - Number button + ++ (UIFont *)numberButtonFont { + return [UIFont systemFontOfSize:28.0 weight:UIFontWeightLight]; +} + ++ (UIColor *)numberButtonTextColor { + return [UIColor blackColor]; +} + ++ (UIColor *)numberButtonBackgroundColor { + return APNP_RGBa(252, 252, 252, 1.0); +} + ++ (UIColor *)numberButtonHighlightedColor { + return APNP_RGBa(188, 192, 198, 1.0); +} + +#pragma mark - Function button + ++ (UIFont *)functionButtonFont { + return [UIFont systemFontOfSize:28.0 weight:UIFontWeightLight]; +} + ++ (UIColor *)functionButtonTextColor { + return [UIColor blackColor]; +} + ++ (UIColor *)functionButtonBackgroundColor { + return APNP_RGBa(188, 192, 198, 1.0); +} + ++ (UIColor *)functionButtonHighlightedColor { + return APNP_RGBa(252, 252, 252, 1.0); +} + ++ (UIImage *)clearFunctionButtonImage { + return [UIImage imageNamed:@"apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; +} + ++ (UIImage *)clearFunctionButtonImageHighlighted { + return [UIImage imageNamed:@"apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; +} + +@end diff --git a/APNumberPad/APNumberPad/APNumberPadStyle.h b/APNumberPad/Classes/APNumberPadStyle.h similarity index 90% rename from APNumberPad/APNumberPad/APNumberPadStyle.h rename to APNumberPad/Classes/APNumberPadStyle.h index b361fa2..b85b8e3 100644 --- a/APNumberPad/APNumberPad/APNumberPadStyle.h +++ b/APNumberPad/Classes/APNumberPadStyle.h @@ -5,7 +5,9 @@ // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // -#import +#import + +NS_ASSUME_NONNULL_BEGIN @protocol APNumberPadStyle @@ -26,3 +28,5 @@ + (UIImage *)clearFunctionButtonImageHighlighted; @end + +NS_ASSUME_NONNULL_END diff --git a/APNumberPad/APNumberPad/NSBundle+APNumberPad.h b/APNumberPad/Classes/NSBundle+APNumberPad.h similarity index 84% rename from APNumberPad/APNumberPad/NSBundle+APNumberPad.h rename to APNumberPad/Classes/NSBundle+APNumberPad.h index 4cc7ebe..b00e244 100644 --- a/APNumberPad/APNumberPad/NSBundle+APNumberPad.h +++ b/APNumberPad/Classes/NSBundle+APNumberPad.h @@ -8,8 +8,12 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface NSBundle (APNumberPad) + (instancetype)ap_numberPadResourceBundle; @end + +NS_ASSUME_NONNULL_END diff --git a/APNumberPad/Classes/NSBundle+APNumberPad.m b/APNumberPad/Classes/NSBundle+APNumberPad.m new file mode 100644 index 0000000..5f2dba8 --- /dev/null +++ b/APNumberPad/Classes/NSBundle+APNumberPad.m @@ -0,0 +1,25 @@ +// +// NSBundle+APNumberPad.m +// APNumberPad +// +// Created by Kian Lim on 8/9/16. +// Copyright © 2016 Andrew Podkovyrin. All rights reserved. +// +// Category credits to Chris Dzombak https://github.com/NYTimes/NYTPhotoViewer + +#import "NSBundle+APNumberPad.h" + +@implementation NSBundle (APNumberPad) + ++ (instancetype)ap_numberPadResourceBundle { + static NSBundle *resourceBundle = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSString *resourceBundlePath = [[NSBundle bundleForClass:NSClassFromString(@"APNumberPad")] pathForResource:@"APNumberPad" ofType:@"bundle"]; + resourceBundle = [self bundleWithPath:resourceBundlePath]; + }); + + return resourceBundle; +} + +@end diff --git a/APNumberPad/DemoStyles/APDarkPadStyle.m b/APNumberPad/DemoStyles/APDarkPadStyle.m deleted file mode 100644 index a463c5c..0000000 --- a/APNumberPad/DemoStyles/APDarkPadStyle.m +++ /dev/null @@ -1,54 +0,0 @@ -// -// APDarkPadStyle.m -// APNumberPad -// -// Created by VANGELI ONTIVEROS on 14/07/14. -// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. -// - -#import "APDarkPadStyle.h" - -@implementation APDarkPadStyle - -#pragma mark - Number button - -+ (UIFont *)numberButtonFont { - return [UIFont fontWithName:@"STHeitiTC-Light" size:28.f]; -} - -+ (UIColor *)numberButtonTextColor { - return [[UIColor whiteColor]colorWithAlphaComponent:0.8f]; -} - -+ (UIColor *)numberButtonBackgroundColor { - return [UIColor colorWithRed:108/255.0f green:122/255.0f blue:137/255.0f alpha:0.4]; -} - -+ (UIColor *)numberButtonHighlightedColor{ - return [UIColor colorWithRed:189/255.0f green:195/255.0f blue:199/255.0f alpha:1.0]; -} - -#pragma mark - Function button - -+ (UIFont *)functionButtonFont { - return [UIFont fontWithName:@"STHeitiTC-Light" size:28.f]; -} - -+ (UIColor *)functionButtonTextColor { - return [UIColor blackColor]; -} - -+ (UIColor *)functionButtonBackgroundColor { - return [UIColor colorWithRed:218/255.0f green:223/255.0f blue:225/255.0f alpha:0.8]; -} - -+ (UIColor *)functionButtonHighlightedColor { - return [UIColor colorWithRed:238/255.0f green:238/255.0f blue:238/255.0f alpha:1.0]; -} - -+ (UIImage *)clearFunctionButtonImage { - return [UIImage imageNamed:@"APNumberPad.bundle/images/apnumberpad_backspace_icon.png"]; -} - - -@end diff --git a/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json b/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a396706..0000000 --- a/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json b/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index c79ebd3..0000000 --- a/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example/APNumberPad.xcodeproj/project.pbxproj b/Example/APNumberPad.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4f48758 --- /dev/null +++ b/Example/APNumberPad.xcodeproj/project.pbxproj @@ -0,0 +1,645 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0D29199EC1C8913FC7966FCB /* Pods_APNumberPad_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E05626B0536F700D1C3928E0 /* Pods_APNumberPad_Example.framework */; }; + 1713C0A834B979A60E3C7004 /* Pods_APNumberPad_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C85F20285ACAB81F4E9531FB /* Pods_APNumberPad_Tests.framework */; }; + 2AD73C361E1F96BD00BBEAD9 /* APNumberPadExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD73C351E1F96BD00BBEAD9 /* APNumberPadExampleViewController.m */; }; + 2AD73C3C1E1F974C00BBEAD9 /* APBluePadStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD73C391E1F974C00BBEAD9 /* APBluePadStyle.m */; }; + 2AD73C3D1E1F974C00BBEAD9 /* APDarkPadStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD73C3B1E1F974C00BBEAD9 /* APDarkPadStyle.m */; }; + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; + 6003F59E195388D20070C39A /* APAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* APAppDelegate.m */; }; + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6003F582195388D10070C39A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6003F589195388D20070C39A; + remoteInfo = APNumberPad; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 27155A07BD982FDD725F0A4A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + 2AD73C341E1F96BD00BBEAD9 /* APNumberPadExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APNumberPadExampleViewController.h; sourceTree = ""; }; + 2AD73C351E1F96BD00BBEAD9 /* APNumberPadExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APNumberPadExampleViewController.m; sourceTree = ""; }; + 2AD73C381E1F974C00BBEAD9 /* APBluePadStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APBluePadStyle.h; sourceTree = ""; }; + 2AD73C391E1F974C00BBEAD9 /* APBluePadStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APBluePadStyle.m; sourceTree = ""; }; + 2AD73C3A1E1F974C00BBEAD9 /* APDarkPadStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APDarkPadStyle.h; sourceTree = ""; }; + 2AD73C3B1E1F974C00BBEAD9 /* APDarkPadStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APDarkPadStyle.m; sourceTree = ""; }; + 4C71A3E3B3C793921720E32F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; + 6003F58A195388D20070C39A /* APNumberPad_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APNumberPad_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 6003F595195388D20070C39A /* APNumberPad-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "APNumberPad-Info.plist"; sourceTree = ""; }; + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6003F59B195388D20070C39A /* APNumberPad-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "APNumberPad-Prefix.pch"; sourceTree = ""; }; + 6003F59C195388D20070C39A /* APAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APAppDelegate.h; sourceTree = ""; }; + 6003F59D195388D20070C39A /* APAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APAppDelegate.m; sourceTree = ""; }; + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 6003F5AE195388D20070C39A /* APNumberPad_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APNumberPad_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 62D47F7AF7F94081DC706925 /* Pods-APNumberPad_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APNumberPad_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-APNumberPad_Tests/Pods-APNumberPad_Tests.release.xcconfig"; sourceTree = ""; }; + 922A5437FBE42F8E28D89D86 /* Pods-APNumberPad_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APNumberPad_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APNumberPad_Tests/Pods-APNumberPad_Tests.debug.xcconfig"; sourceTree = ""; }; + 9F41435A7D1FBB7AA68682F1 /* Pods-APNumberPad_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APNumberPad_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-APNumberPad_Example/Pods-APNumberPad_Example.release.xcconfig"; sourceTree = ""; }; + C85F20285ACAB81F4E9531FB /* Pods_APNumberPad_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APNumberPad_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D69960327226B50CFABECECE /* APNumberPad.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = APNumberPad.podspec; path = ../APNumberPad.podspec; sourceTree = ""; }; + E05626B0536F700D1C3928E0 /* Pods_APNumberPad_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APNumberPad_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FD3077CBCB89EEA21C05ABE8 /* Pods-APNumberPad_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APNumberPad_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APNumberPad_Example/Pods-APNumberPad_Example.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6003F587195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, + 0D29199EC1C8913FC7966FCB /* Pods_APNumberPad_Example.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AB195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, + 1713C0A834B979A60E3C7004 /* Pods_APNumberPad_Tests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2AD73C371E1F974C00BBEAD9 /* DemoStyles */ = { + isa = PBXGroup; + children = ( + 2AD73C381E1F974C00BBEAD9 /* APBluePadStyle.h */, + 2AD73C391E1F974C00BBEAD9 /* APBluePadStyle.m */, + 2AD73C3A1E1F974C00BBEAD9 /* APDarkPadStyle.h */, + 2AD73C3B1E1F974C00BBEAD9 /* APDarkPadStyle.m */, + ); + path = DemoStyles; + sourceTree = ""; + }; + 6003F581195388D10070C39A = { + isa = PBXGroup; + children = ( + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, + 6003F593195388D20070C39A /* Example for APNumberPad */, + 6003F5B5195388D20070C39A /* Tests */, + 6003F58C195388D20070C39A /* Frameworks */, + 6003F58B195388D20070C39A /* Products */, + CEBDAA5D932C8E8893685D46 /* Pods */, + ); + sourceTree = ""; + }; + 6003F58B195388D20070C39A /* Products */ = { + isa = PBXGroup; + children = ( + 6003F58A195388D20070C39A /* APNumberPad_Example.app */, + 6003F5AE195388D20070C39A /* APNumberPad_Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6003F58C195388D20070C39A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6003F58D195388D20070C39A /* Foundation.framework */, + 6003F58F195388D20070C39A /* CoreGraphics.framework */, + 6003F591195388D20070C39A /* UIKit.framework */, + 6003F5AF195388D20070C39A /* XCTest.framework */, + E05626B0536F700D1C3928E0 /* Pods_APNumberPad_Example.framework */, + C85F20285ACAB81F4E9531FB /* Pods_APNumberPad_Tests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6003F593195388D20070C39A /* Example for APNumberPad */ = { + isa = PBXGroup; + children = ( + 2AD73C371E1F974C00BBEAD9 /* DemoStyles */, + 2AD73C341E1F96BD00BBEAD9 /* APNumberPadExampleViewController.h */, + 2AD73C351E1F96BD00BBEAD9 /* APNumberPadExampleViewController.m */, + 6003F59C195388D20070C39A /* APAppDelegate.h */, + 6003F59D195388D20070C39A /* APAppDelegate.m */, + 6003F5A8195388D20070C39A /* Images.xcassets */, + 6003F594195388D20070C39A /* Supporting Files */, + ); + name = "Example for APNumberPad"; + path = APNumberPad; + sourceTree = ""; + }; + 6003F594195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F595195388D20070C39A /* APNumberPad-Info.plist */, + 6003F596195388D20070C39A /* InfoPlist.strings */, + 6003F599195388D20070C39A /* main.m */, + 6003F59B195388D20070C39A /* APNumberPad-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 6003F5B5195388D20070C39A /* Tests */ = { + isa = PBXGroup; + children = ( + 6003F5BB195388D20070C39A /* Tests.m */, + 6003F5B6195388D20070C39A /* Supporting Files */, + ); + path = Tests; + sourceTree = ""; + }; + 6003F5B6195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F5B7195388D20070C39A /* Tests-Info.plist */, + 6003F5B8195388D20070C39A /* InfoPlist.strings */, + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { + isa = PBXGroup; + children = ( + D69960327226B50CFABECECE /* APNumberPad.podspec */, + 27155A07BD982FDD725F0A4A /* README.md */, + 4C71A3E3B3C793921720E32F /* LICENSE */, + ); + name = "Podspec Metadata"; + sourceTree = ""; + }; + CEBDAA5D932C8E8893685D46 /* Pods */ = { + isa = PBXGroup; + children = ( + FD3077CBCB89EEA21C05ABE8 /* Pods-APNumberPad_Example.debug.xcconfig */, + 9F41435A7D1FBB7AA68682F1 /* Pods-APNumberPad_Example.release.xcconfig */, + 922A5437FBE42F8E28D89D86 /* Pods-APNumberPad_Tests.debug.xcconfig */, + 62D47F7AF7F94081DC706925 /* Pods-APNumberPad_Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6003F589195388D20070C39A /* APNumberPad_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "APNumberPad_Example" */; + buildPhases = ( + 20411772B20B209BEBCFBA01 /* [CP] Check Pods Manifest.lock */, + 6003F586195388D20070C39A /* Sources */, + 6003F587195388D20070C39A /* Frameworks */, + 6003F588195388D20070C39A /* Resources */, + 04DFAC6811075B369B86562E /* [CP] Embed Pods Frameworks */, + 651E1944ACC08BD56BEF91DE /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = APNumberPad_Example; + productName = APNumberPad; + productReference = 6003F58A195388D20070C39A /* APNumberPad_Example.app */; + productType = "com.apple.product-type.application"; + }; + 6003F5AD195388D20070C39A /* APNumberPad_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "APNumberPad_Tests" */; + buildPhases = ( + 634A5542B140DEC2ABD28E20 /* [CP] Check Pods Manifest.lock */, + 6003F5AA195388D20070C39A /* Sources */, + 6003F5AB195388D20070C39A /* Frameworks */, + 6003F5AC195388D20070C39A /* Resources */, + F3A2C4877897F1F04C992E61 /* [CP] Embed Pods Frameworks */, + C9B3D7E10F94C5B777ADD3EB /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6003F5B4195388D20070C39A /* PBXTargetDependency */, + ); + name = APNumberPad_Tests; + productName = APNumberPadTests; + productReference = 6003F5AE195388D20070C39A /* APNumberPad_Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6003F582195388D10070C39A /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = AP; + LastUpgradeCheck = 0820; + ORGANIZATIONNAME = "Andrew Podkovyrin"; + TargetAttributes = { + 6003F5AD195388D20070C39A = { + TestTargetID = 6003F589195388D20070C39A; + }; + }; + }; + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "APNumberPad" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6003F581195388D10070C39A; + productRefGroup = 6003F58B195388D20070C39A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6003F589195388D20070C39A /* APNumberPad_Example */, + 6003F5AD195388D20070C39A /* APNumberPad_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6003F588195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AC195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 04DFAC6811075B369B86562E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APNumberPad_Example/Pods-APNumberPad_Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 20411772B20B209BEBCFBA01 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 634A5542B140DEC2ABD28E20 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 651E1944ACC08BD56BEF91DE /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APNumberPad_Example/Pods-APNumberPad_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + C9B3D7E10F94C5B777ADD3EB /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APNumberPad_Tests/Pods-APNumberPad_Tests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + F3A2C4877897F1F04C992E61 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APNumberPad_Tests/Pods-APNumberPad_Tests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6003F586195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2AD73C3D1E1F974C00BBEAD9 /* APDarkPadStyle.m in Sources */, + 6003F59E195388D20070C39A /* APAppDelegate.m in Sources */, + 6003F59A195388D20070C39A /* main.m in Sources */, + 2AD73C3C1E1F974C00BBEAD9 /* APBluePadStyle.m in Sources */, + 2AD73C361E1F96BD00BBEAD9 /* APNumberPadExampleViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AA195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5BC195388D20070C39A /* Tests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6003F589195388D20070C39A /* APNumberPad_Example */; + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6003F596195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F597195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F5B9195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6003F5BD195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6003F5BE195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6003F5C0195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FD3077CBCB89EEA21C05ABE8 /* Pods-APNumberPad_Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; + INFOPLIST_FILE = "APNumberPad/APNumberPad-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 6003F5C1195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9F41435A7D1FBB7AA68682F1 /* Pods-APNumberPad_Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "APNumberPad/APNumberPad-Prefix.pch"; + INFOPLIST_FILE = "APNumberPad/APNumberPad-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 6003F5C3195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 922A5437FBE42F8E28D89D86 /* Pods-APNumberPad_Tests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/APNumberPad_Example.app/APNumberPad_Example"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 6003F5C4195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 62D47F7AF7F94081DC706925 /* Pods-APNumberPad_Tests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/APNumberPad_Example.app/APNumberPad_Example"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6003F585195388D10070C39A /* Build configuration list for PBXProject "APNumberPad" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5BD195388D20070C39A /* Debug */, + 6003F5BE195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "APNumberPad_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C0195388D20070C39A /* Debug */, + 6003F5C1195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "APNumberPad_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C3195388D20070C39A /* Debug */, + 6003F5C4195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6003F582195388D10070C39A /* Project object */; +} diff --git a/APNumberPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/APNumberPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from APNumberPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Example/APNumberPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/APNumberPad.xcodeproj/xcshareddata/xcschemes/APNumberPad-Example.xcscheme b/Example/APNumberPad.xcodeproj/xcshareddata/xcschemes/APNumberPad-Example.xcscheme new file mode 100644 index 0000000..d02e709 --- /dev/null +++ b/Example/APNumberPad.xcodeproj/xcshareddata/xcschemes/APNumberPad-Example.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/APNumberPad.xcworkspace/contents.xcworkspacedata b/Example/APNumberPad.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..427c407 --- /dev/null +++ b/Example/APNumberPad.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/APNumberPad/APAppDelegate.h b/Example/APNumberPad/APAppDelegate.h similarity index 55% rename from APNumberPad/APAppDelegate.h rename to Example/APNumberPad/APAppDelegate.h index cc48de3..01b3433 100644 --- a/APNumberPad/APAppDelegate.h +++ b/Example/APNumberPad/APAppDelegate.h @@ -2,11 +2,11 @@ // APAppDelegate.h // APNumberPad // -// Created by Andrew Podkovyrin on 16/05/14. -// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. +// Created by Andrew Podkovyrin on 01/06/2017. +// Copyright (c) 2017 Andrew Podkovyrin. All rights reserved. // -#import +@import UIKit; @interface APAppDelegate : UIResponder diff --git a/APNumberPad/APAppDelegate.m b/Example/APNumberPad/APAppDelegate.m similarity index 85% rename from APNumberPad/APAppDelegate.m rename to Example/APNumberPad/APAppDelegate.m index b088179..de84b5d 100644 --- a/APNumberPad/APAppDelegate.m +++ b/Example/APNumberPad/APAppDelegate.m @@ -2,51 +2,44 @@ // APAppDelegate.m // APNumberPad // -// Created by Andrew Podkovyrin on 16/05/14. -// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. +// Created by Andrew Podkovyrin on 01/06/2017. +// Copyright (c) 2017 Andrew Podkovyrin. All rights reserved. // -#import "APAppDelegate.h" - #import "APNumberPadExampleViewController.h" +#import "APAppDelegate.h" + @implementation APAppDelegate -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = [[APNumberPadExampleViewController alloc] init]; - self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; + return YES; } -- (void)applicationWillResignActive:(UIApplication *)application -{ +- (void)applicationWillResignActive:(UIApplication *)application { // 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. // 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. } -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // 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. +- (void)applicationDidEnterBackground:(UIApplication *)application { + // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } -- (void)applicationWillEnterForeground:(UIApplication *)application -{ +- (void)applicationWillEnterForeground:(UIApplication *)application { // 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. } -- (void)applicationDidBecomeActive:(UIApplication *)application -{ +- (void)applicationDidBecomeActive:(UIApplication *)application { // 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. } -- (void)applicationWillTerminate:(UIApplication *)application -{ +- (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/APNumberPad/APNumberPad-Info.plist b/Example/APNumberPad/APNumberPad-Info.plist similarity index 76% rename from APNumberPad/APNumberPad-Info.plist rename to Example/APNumberPad/APNumberPad-Info.plist index 36526a8..6a012bd 100644 --- a/APNumberPad/APNumberPad-Info.plist +++ b/Example/APNumberPad/APNumberPad-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - podkovyrin.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -31,8 +31,15 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight diff --git a/APNumberPad/APNumberPad-Prefix.pch b/Example/APNumberPad/APNumberPad-Prefix.pch similarity index 56% rename from APNumberPad/APNumberPad-Prefix.pch rename to Example/APNumberPad/APNumberPad-Prefix.pch index 743435c..7825372 100644 --- a/APNumberPad/APNumberPad-Prefix.pch +++ b/Example/APNumberPad/APNumberPad-Prefix.pch @@ -6,11 +6,11 @@ #import -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iOS SDK 3.0 and later." +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ - #import - #import + @import UIKit; + @import Foundation; #endif diff --git a/APNumberPad/APNumberPadExampleViewController.h b/Example/APNumberPad/APNumberPadExampleViewController.h similarity index 100% rename from APNumberPad/APNumberPadExampleViewController.h rename to Example/APNumberPad/APNumberPadExampleViewController.h diff --git a/APNumberPad/APNumberPadExampleViewController.m b/Example/APNumberPad/APNumberPadExampleViewController.m similarity index 91% rename from APNumberPad/APNumberPadExampleViewController.m rename to Example/APNumberPad/APNumberPadExampleViewController.m index 0568643..9f264ac 100644 --- a/APNumberPad/APNumberPadExampleViewController.m +++ b/Example/APNumberPad/APNumberPadExampleViewController.m @@ -5,11 +5,12 @@ // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // -#import "APNumberPadExampleViewController.h" +#import -#import "APNumberPad.h" -#import "APDarkPadStyle.h" #import "APBluePadStyle.h" +#import "APDarkPadStyle.h" + +#import "APNumberPadExampleViewController.h" @interface APNumberPadExampleViewController () @@ -22,16 +23,16 @@ @implementation APNumberPadExampleViewController - (void)loadView { [super loadView]; - + [self.view addSubview:self.textField]; [self.view addSubview:self.styledTextField]; } - (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; - - self.textField.frame = CGRectMake(10.f, 50.f, CGRectGetWidth(self.view.bounds) - 10.f * 2, 30.f); - self.styledTextField.frame = CGRectOffset(self.textField.frame, 0, 52.0f); + + self.textField.frame = CGRectMake(10.0, 50.0, CGRectGetWidth(self.view.bounds) - 10.0 * 2, 30.0); + self.styledTextField.frame = CGRectOffset(self.textField.frame, 0, 52.0); } - (UITextField *)textField { @@ -40,7 +41,7 @@ - (UITextField *)textField { _textField.borderStyle = UITextBorderStyleRoundedRect; _textField.inputView = ({ APNumberPad *numberPad = [APNumberPad numberPadWithDelegate:self]; - + [numberPad.leftFunctionButton setTitle:@"B" forState:UIControlStateNormal]; numberPad.leftFunctionButton.titleLabel.adjustsFontSizeToFitWidth = YES; numberPad; @@ -49,20 +50,20 @@ - (UITextField *)textField { return _textField; } -- (UITextField *)styledTextField{ - +- (UITextField *)styledTextField { + if (!_styledTextField) { _styledTextField = [[UITextField alloc] initWithFrame:CGRectZero]; _styledTextField.borderStyle = UITextBorderStyleRoundedRect; _styledTextField.inputView = ({ APNumberPad *numberPad = [APNumberPad numberPadWithDelegate:self numberPadStyleClass:[APDarkPadStyle class]]; - + [numberPad.leftFunctionButton setTitle:@"Change Style" forState:UIControlStateNormal]; numberPad.leftFunctionButton.titleLabel.adjustsFontSizeToFitWidth = YES; numberPad; }); } - + return _styledTextField; } @@ -73,18 +74,19 @@ - (void)numberPad:(APNumberPad *)numberPad functionButtonAction:(UIButton *)func if ([textInput isEqual:self.textField]) { [functionButton setTitle:[functionButton.currentTitle stringByAppendingString:@"z"] forState:UIControlStateNormal]; [textInput insertText:@"#"]; - } else { + } + else { Class currentSyle = [numberPad styleClass]; - + Class nextStyle = currentSyle == [APDarkPadStyle class] ? [APBluePadStyle class] : [APDarkPadStyle class]; self.styledTextField.inputView = ({ APNumberPad *numberPad = [APNumberPad numberPadWithDelegate:self numberPadStyleClass:nextStyle]; - + [numberPad.leftFunctionButton setTitle:@"Change Style" forState:UIControlStateNormal]; numberPad.leftFunctionButton.titleLabel.adjustsFontSizeToFitWidth = YES; numberPad; }); - + // Trick for update the inputview // [self.styledTextField resignFirstResponder]; diff --git a/APNumberPad/DemoStyles/APBluePadStyle.h b/Example/APNumberPad/DemoStyles/APBluePadStyle.h similarity index 81% rename from APNumberPad/DemoStyles/APBluePadStyle.h rename to Example/APNumberPad/DemoStyles/APBluePadStyle.h index 84b7d4c..bd67fca 100644 --- a/APNumberPad/DemoStyles/APBluePadStyle.h +++ b/Example/APNumberPad/DemoStyles/APBluePadStyle.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // -#import "APNumberPadDefaultStyle.h" +#import @interface APBluePadStyle : APNumberPadDefaultStyle diff --git a/APNumberPad/DemoStyles/APBluePadStyle.m b/Example/APNumberPad/DemoStyles/APBluePadStyle.m similarity index 53% rename from APNumberPad/DemoStyles/APBluePadStyle.m rename to Example/APNumberPad/DemoStyles/APBluePadStyle.m index 3f25bc0..f49f04b 100644 --- a/APNumberPad/DemoStyles/APBluePadStyle.m +++ b/Example/APNumberPad/DemoStyles/APBluePadStyle.m @@ -6,6 +6,8 @@ // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // +#import + #import "APBluePadStyle.h" @implementation APBluePadStyle @@ -13,13 +15,13 @@ @implementation APBluePadStyle #pragma mark - Pad + (UIColor *)numberPadBackgroundColor { - return [UIColor colorWithRed:0.124 green:0.551 blue:0.796 alpha:1.000]; + return [UIColor colorWithRed:0.124 green:0.551 blue:0.796 alpha:1.0]; } #pragma mark - Number button + (UIFont *)numberButtonFont { - return [UIFont fontWithName:@"STHeitiTC-Light" size:28.f]; + return [UIFont fontWithName:@"STHeitiTC-Light" size:28.0]; } + (UIColor *)numberButtonTextColor { @@ -27,17 +29,17 @@ + (UIColor *)numberButtonTextColor { } + (UIColor *)numberButtonBackgroundColor { - return [UIColor colorWithRed:38/255.0f green:169/255.0f blue:242/255.0f alpha:0.8]; + return [UIColor colorWithRed:38 / 255.0 green:169 / 255.0 blue:242 / 255.0 alpha:0.8]; } -+ (UIColor *)numberButtonHighlightedColor{ - return [UIColor colorWithRed:0.686 green:0.832 blue:0.994 alpha:1.000]; ++ (UIColor *)numberButtonHighlightedColor { + return [UIColor colorWithRed:0.686 green:0.832 blue:0.994 alpha:1.0]; } #pragma mark - Function button + (UIFont *)functionButtonFont { - return [UIFont fontWithName:@"STHeitiTC-Light" size:28.f]; + return [UIFont fontWithName:@"STHeitiTC-Light" size:28.0]; } + (UIColor *)functionButtonTextColor { @@ -45,15 +47,15 @@ + (UIColor *)functionButtonTextColor { } + (UIColor *)functionButtonBackgroundColor { - return [UIColor colorWithRed:153/255.0f green:218/255.0f blue:255/255.0f alpha:0.8]; + return [UIColor colorWithRed:153 / 255.0 green:218 / 255.0 blue:255 / 255.0 alpha:0.8]; } + (UIColor *)functionButtonHighlightedColor { - return [UIColor colorWithRed:221/255.0f green:241/255.0f blue:254/255.0f alpha:1.0]; + return [UIColor colorWithRed:221 / 255.0 green:241 / 255.0 blue:254 / 255.0 alpha:1.0]; } + (UIImage *)clearFunctionButtonImage { - return [UIImage imageNamed:@"APNumberPad.bundle/images/apnumberpad_backspace_icon.png"]; + return [UIImage imageNamed:@"apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; } @end diff --git a/APNumberPad/DemoStyles/APDarkPadStyle.h b/Example/APNumberPad/DemoStyles/APDarkPadStyle.h similarity index 81% rename from APNumberPad/DemoStyles/APDarkPadStyle.h rename to Example/APNumberPad/DemoStyles/APDarkPadStyle.h index ccfb71a..79ec85b 100644 --- a/APNumberPad/DemoStyles/APDarkPadStyle.h +++ b/Example/APNumberPad/DemoStyles/APDarkPadStyle.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. // -#import "APNumberPadDefaultStyle.h" +#import @interface APDarkPadStyle : APNumberPadDefaultStyle diff --git a/Example/APNumberPad/DemoStyles/APDarkPadStyle.m b/Example/APNumberPad/DemoStyles/APDarkPadStyle.m new file mode 100644 index 0000000..f0d9024 --- /dev/null +++ b/Example/APNumberPad/DemoStyles/APDarkPadStyle.m @@ -0,0 +1,56 @@ +// +// APDarkPadStyle.m +// APNumberPad +// +// Created by VANGELI ONTIVEROS on 14/07/14. +// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. +// + +#import + +#import "APDarkPadStyle.h" + +@implementation APDarkPadStyle + +#pragma mark - Number button + ++ (UIFont *)numberButtonFont { + return [UIFont fontWithName:@"STHeitiTC-Light" size:28.0]; +} + ++ (UIColor *)numberButtonTextColor { + return [[UIColor whiteColor] colorWithAlphaComponent:0.8]; +} + ++ (UIColor *)numberButtonBackgroundColor { + return [UIColor colorWithRed:108 / 255.0 green:122 / 255.0 blue:137 / 255.0 alpha:0.4]; +} + ++ (UIColor *)numberButtonHighlightedColor { + return [UIColor colorWithRed:189 / 255.0 green:195 / 255.0 blue:199 / 255.0 alpha:1.0]; +} + +#pragma mark - Function button + ++ (UIFont *)functionButtonFont { + return [UIFont fontWithName:@"STHeitiTC-Light" size:28.0]; +} + ++ (UIColor *)functionButtonTextColor { + return [UIColor blackColor]; +} + ++ (UIColor *)functionButtonBackgroundColor { + return [UIColor colorWithRed:218 / 255.0 green:223 / 255.0 blue:225 / 255.0 alpha:0.8]; +} + ++ (UIColor *)functionButtonHighlightedColor { + return [UIColor colorWithRed:238 / 255.0 green:238 / 255.0 blue:238 / 255.0 alpha:1.0]; +} + ++ (UIImage *)clearFunctionButtonImage { + return [UIImage imageNamed:@"apnumberpad_backspace_icon.png" inBundle:[NSBundle ap_numberPadResourceBundle] compatibleWithTraitCollection:nil]; +} + + +@end diff --git a/Example/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..f697f61 --- /dev/null +++ b/Example/APNumberPad/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/Example/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json b/Example/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..4458b40 --- /dev/null +++ b/Example/APNumberPad/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,51 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/APNumberPad/en.lproj/InfoPlist.strings b/Example/APNumberPad/en.lproj/InfoPlist.strings similarity index 100% rename from APNumberPad/en.lproj/InfoPlist.strings rename to Example/APNumberPad/en.lproj/InfoPlist.strings diff --git a/APNumberPad/main.m b/Example/APNumberPad/main.m similarity index 62% rename from APNumberPad/main.m rename to Example/APNumberPad/main.m index c5c575f..9650166 100644 --- a/APNumberPad/main.m +++ b/Example/APNumberPad/main.m @@ -2,12 +2,11 @@ // main.m // APNumberPad // -// Created by Andrew Podkovyrin on 16/05/14. -// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. +// Created by Andrew Podkovyrin on 01/06/2017. +// Copyright (c) 2017 Andrew Podkovyrin. All rights reserved. // -#import - +@import UIKit; #import "APAppDelegate.h" int main(int argc, char * argv[]) diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..9e3d110 --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,11 @@ +use_frameworks! + +target 'APNumberPad_Example' do + pod 'APNumberPad', :path => '../' + + target 'APNumberPad_Tests' do + inherit! :search_paths + + + end +end diff --git a/APNumberPadTests/APNumberPadTests-Info.plist b/Example/Tests/Tests-Info.plist similarity index 90% rename from APNumberPadTests/APNumberPadTests-Info.plist rename to Example/Tests/Tests-Info.plist index b908a49..169b6f7 100644 --- a/APNumberPadTests/APNumberPadTests-Info.plist +++ b/Example/Tests/Tests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - podkovyrin.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/Example/Tests/Tests-Prefix.pch b/Example/Tests/Tests-Prefix.pch new file mode 100644 index 0000000..0bfb741 --- /dev/null +++ b/Example/Tests/Tests-Prefix.pch @@ -0,0 +1,7 @@ +// The contents of this file are implicitly included at the beginning of every test case source file. + +#ifdef __OBJC__ + + + +#endif diff --git a/APNumberPadTests/APNumberPadTests.m b/Example/Tests/Tests.m similarity index 68% rename from APNumberPadTests/APNumberPadTests.m rename to Example/Tests/Tests.m index 64b401f..4664940 100644 --- a/APNumberPadTests/APNumberPadTests.m +++ b/Example/Tests/Tests.m @@ -2,17 +2,17 @@ // APNumberPadTests.m // APNumberPadTests // -// Created by Andrew Podkovyrin on 16/05/14. -// Copyright (c) 2014 Andrew Podkovyrin. All rights reserved. +// Created by Andrew Podkovyrin on 01/06/2017. +// Copyright (c) 2017 Andrew Podkovyrin. All rights reserved. // -#import +@import XCTest; -@interface APNumberPadTests : XCTestCase +@interface Tests : XCTestCase @end -@implementation APNumberPadTests +@implementation Tests - (void)setUp { @@ -32,3 +32,4 @@ - (void)testExample } @end + diff --git a/APNumberPadTests/en.lproj/InfoPlist.strings b/Example/Tests/en.lproj/InfoPlist.strings similarity index 100% rename from APNumberPadTests/en.lproj/InfoPlist.strings rename to Example/Tests/en.lproj/InfoPlist.strings diff --git a/LICENCE.txt b/LICENSE similarity index 87% rename from LICENCE.txt rename to LICENSE index 74c98c8..3ad8445 100644 --- a/LICENCE.txt +++ b/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2014 Andrew Podkovyrin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +Copyright (c) 2017 Andrew Podkovyrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 80e7997..39b34b9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ -APNumberPad -========== +# APNumberPad + +[![CI Status](http://img.shields.io/travis/Andrew Podkovyrin/APNumberPad.svg?style=flat)](https://travis-ci.org/Andrew Podkovyrin/APNumberPad) +[![Version](https://img.shields.io/cocoapods/v/APNumberPad.svg?style=flat)](http://cocoapods.org/pods/APNumberPad) +[![License](https://img.shields.io/cocoapods/l/APNumberPad.svg?style=flat)](http://cocoapods.org/pods/APNumberPad) +[![Platform](https://img.shields.io/cocoapods/p/APNumberPad.svg?style=flat)](http://cocoapods.org/pods/APNumberPad) APNumberPad is a custom keyboard for iOS allows you to create a keyboard `inputView` that looks and feels just like the iPhone keyboard with `UIKeyboardTypeNumberPad` as `keyboardType`. Also APNumberPad provides customizable left-function button. @@ -13,16 +17,9 @@ APNumberPad is a custom keyboard for iOS allows you to create a keyboard `inputV - `UITextField` and `UITextView` support (or any other `UIResponder` object that responds to `UITextInput` protocol) - Input clicks -## Usage - - **[CocoaPods](http://cocoapods.org):** -``` -pod 'APNumberPad' -``` - - **Manual:** -1. Copy `APNumberPad/APNumberPad` folder anywhere to your project folder and add it to Xcode. -2. Copy `APNumberPad/APNumberPad.bundle` anywhere to your project folder and add it to Xcode. +## Example -##Sample +To run the example project, clone the repo, and run `pod install` from the Example directory first. ```obj-c // in .h: @@ -49,38 +46,44 @@ textField.inputView = ({ } ``` -## Compatibility -iOS 6.0 or later. +## Requirements +iOS 8.2 or later. ## Notes Inspired by https://github.com/kulpreetchilana/Custom-iOS-Keyboards and http://stackoverflow.com/questions/13205160/how-do-i-retrieve-keystrokes-from-a-custom-keyboard-on-an-ios-app/13205494#13205494 APNumberPad very gratefully makes use of backspace icon from Typicons set by Stephen Hutchings (http://typicons.com/), under Creative Commons (Attribution-Share Alike 3.0 Unported) license. -## Contributors +## Installation via CocoaPods -- [Vangeli Ontiveros](http://github.com/vanyas) +APNumberPad is available through [CocoaPods](http://cocoapods.org). To install +it, simply add the following line to your Podfile: -## License +```ruby +pod "APNumberPad" +``` + +## Installation via Carthage -APNumberPad is available under the MIT license. +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application. -Copyright © 2014 Andrew Podkovyrin +You can install Carthage with [Homebrew](http://brew.sh/) using the following command: -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +```bash +$ brew update +$ brew install carthage +``` -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +To integrate APNumberPad into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "podkovyrin/APNumberPad" +``` + +## Author + +Andrew Podkovyrin, podkovyrin@gmail.com + +## License -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +APNumberPad is available under the MIT license. See the LICENSE file for more info. diff --git a/_Pods.xcodeproj b/_Pods.xcodeproj new file mode 120000 index 0000000..3c5a8e7 --- /dev/null +++ b/_Pods.xcodeproj @@ -0,0 +1 @@ +Example/Pods/Pods.xcodeproj \ No newline at end of file