├── .gitignore ├── ACETelPrompt.podspec ├── ACETelPrompt ├── ACETelPrompt.h └── ACETelPrompt.m ├── ACETelPromptDemo.xcodeproj └── project.pbxproj ├── ACETelPromptDemo ├── ACEAppDelegate.h ├── ACEAppDelegate.m ├── ACETelPromptDemo-Info.plist ├── ACETelPromptDemo-Prefix.pch ├── ACEViewController.h ├── ACEViewController.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── en.lproj │ └── InfoPlist.strings └── main.m ├── ACETelPromptDemoTests ├── ACETelPromptDemoTests-Info.plist ├── ACETelPromptDemoTests.m └── en.lproj │ └── InfoPlist.strings ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | -------------------------------------------------------------------------------- /ACETelPrompt.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint ACETelPrompt.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "ACETelPrompt" 19 | s.version = "1.0.0" 20 | s.summary = "Helper to call a phone number from an iPhone using the telpromp scheme." 21 | s.homepage = "https://github.com/acerbetti/ACETelPrompt" 22 | 23 | 24 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 25 | # 26 | # Licensing your code is important. See http://choosealicense.com for more info. 27 | # CocoaPods will detect a license file if there is a named LICENSE* 28 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 29 | # 30 | 31 | s.license = { :type => "MIT", :file => "LICENSE" } 32 | 33 | 34 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 35 | # 36 | # Specify the authors of the library, with email addresses. Email addresses 37 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 38 | # accepts just a name if you'd rather not provide an email address. 39 | # 40 | # Specify a social_media_url where others can refer to, for example a twitter 41 | # profile URL. 42 | # 43 | 44 | s.author = { "Stefano Acerbetti" => "acerbetti@gmail.com" } 45 | 46 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # If this Pod runs only on iOS or OS X, then specify the platform and 49 | # the deployment target. You can optionally include the target after the platform. 50 | # 51 | 52 | s.platform = :ios 53 | 54 | 55 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 56 | # 57 | # Specify the location from where the source should be retrieved. 58 | # Supports git, hg, bzr, svn and HTTP. 59 | # 60 | 61 | s.source = { :git => "https://github.com/acerbetti/ACETelPrompt.git", :tag => "1.0.0" } 62 | 63 | 64 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 65 | # 66 | # CocoaPods is smart about how it includes source code. For source files 67 | # giving a folder will include any h, m, mm, c & cpp files. For header 68 | # files it will include any header in the folder. 69 | # Not including the public_header_files will make all headers public. 70 | # 71 | 72 | s.source_files = "ACETelPrompt/*.{h,m}" 73 | 74 | 75 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 76 | # 77 | # A list of resources included with the Pod. These are copied into the 78 | # target bundle with a build phase script. Anything else will be cleaned. 79 | # You can preserve files from being cleaned, please don't preserve 80 | # non-essential files like tests, examples and documentation. 81 | # 82 | 83 | # s.resource = "icon.png" 84 | # s.resources = "Resources/*.png" 85 | 86 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 87 | 88 | 89 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 90 | # 91 | # Link your library with frameworks, or libraries. Libraries do not include 92 | # the lib prefix of their name. 93 | # 94 | 95 | # s.framework = "SomeFramework" 96 | # s.frameworks = "SomeFramework", "AnotherFramework" 97 | 98 | # s.library = "iconv" 99 | # s.libraries = "iconv", "xml2" 100 | 101 | 102 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 103 | # 104 | # If your library depends on compiler flags you can set them in the xcconfig hash 105 | # where they will only apply to your library. If you depend on other Podspecs 106 | # you can include multiple dependencies to ensure it works. 107 | 108 | s.requires_arc = true 109 | 110 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 111 | # s.dependency "JSONKit", "~> 1.4" 112 | 113 | end 114 | -------------------------------------------------------------------------------- /ACETelPrompt/ACETelPrompt.h: -------------------------------------------------------------------------------- 1 | // ACETelPrompt.h 2 | // 3 | // Copyright (c) 2014 Stefano Acerbetti 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface ACETelPrompt : NSObject 26 | 27 | typedef void (^ACETelCallBlock)(NSTimeInterval duration); 28 | typedef void (^ACETelCancelBlock)(void); 29 | 30 | + (BOOL)callPhoneNumber:(NSString *)phoneNumber 31 | call:(ACETelCallBlock)callBlock 32 | cancel:(ACETelCancelBlock)cancelBlock; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ACETelPrompt/ACETelPrompt.m: -------------------------------------------------------------------------------- 1 | // ACETelPrompt.m 2 | // 3 | // Copyright (c) 2014 Stefano Acerbetti 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import "ACETelPrompt.h" 24 | 25 | // the time required to launch the phone app and come back (will be substracted to the duration) 26 | #define kCallSetupTime 3.0 27 | 28 | @interface ACETelPrompt () 29 | @property (nonatomic, strong) NSDate *callStartTime; 30 | 31 | @property (nonatomic, copy) ACETelCallBlock callBlock; 32 | @property (nonatomic, copy) ACETelCancelBlock cancelBlock; 33 | @end 34 | 35 | @implementation ACETelPrompt 36 | 37 | + (instancetype)sharedInstance 38 | { 39 | static ACETelPrompt *_instance = nil; 40 | static dispatch_once_t oncePredicate; 41 | dispatch_once(&oncePredicate, ^{ 42 | _instance = [[self alloc] init]; 43 | }); 44 | return _instance; 45 | } 46 | 47 | + (BOOL)callPhoneNumber:(NSString *)phoneNumber 48 | call:(ACETelCallBlock)callBlock 49 | cancel:(ACETelCancelBlock)cancelBlock 50 | { 51 | if ([self validPhone:phoneNumber]) { 52 | 53 | ACETelPrompt *telPrompt = [ACETelPrompt sharedInstance]; 54 | 55 | // observe the app notifications 56 | [telPrompt setNotifications]; 57 | 58 | // set the blocks 59 | telPrompt.callBlock = callBlock; 60 | telPrompt.cancelBlock = cancelBlock; 61 | 62 | // clean the phone number 63 | NSString *simplePhoneNumber = 64 | [[phoneNumber componentsSeparatedByCharactersInSet: 65 | [[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""]; 66 | 67 | // call the phone number using the telprompt scheme 68 | NSString *stringURL = [@"telprompt://" stringByAppendingString:simplePhoneNumber]; 69 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:stringURL]]; 70 | 71 | return YES; 72 | } 73 | return NO; 74 | } 75 | 76 | + (BOOL)validPhone:(NSString*) phoneString 77 | { 78 | NSTextCheckingType type = [[NSTextCheckingResult phoneNumberCheckingResultWithRange:NSMakeRange(0, phoneString.length) 79 | phoneNumber:phoneString] resultType]; 80 | return type == NSTextCheckingTypePhoneNumber; 81 | } 82 | 83 | 84 | #pragma mark - Notifications 85 | 86 | - (void)setNotifications 87 | { 88 | [[NSNotificationCenter defaultCenter] addObserver:self 89 | selector:@selector(applicationDidEnterBackground:) 90 | name:UIApplicationDidEnterBackgroundNotification 91 | object:nil]; 92 | 93 | [[NSNotificationCenter defaultCenter] addObserver:self 94 | selector:@selector(applicationDidBecomeActive:) 95 | name:UIApplicationDidBecomeActiveNotification 96 | object:nil]; 97 | 98 | } 99 | 100 | 101 | #pragma mark - Events 102 | 103 | - (void)applicationDidEnterBackground:(NSNotification *)notification 104 | { 105 | // save the time of the call 106 | self.callStartTime = [NSDate date]; 107 | } 108 | 109 | - (void)applicationDidBecomeActive:(NSNotification *)notification 110 | { 111 | // now it's time to remove the observers 112 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 113 | 114 | if (self.callStartTime != nil) { 115 | 116 | // I'm coming back after a call 117 | if (self.callBlock != nil) { 118 | self.callBlock(-([self.callStartTime timeIntervalSinceNow]) - kCallSetupTime); 119 | } 120 | 121 | // reset the start timer 122 | self.callStartTime = nil; 123 | 124 | } else if (self.cancelBlock != nil) { 125 | 126 | // user didn't start the call 127 | self.cancelBlock(); 128 | } 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /ACETelPromptDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8060A7261913079D005544DE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7251913079D005544DE /* Foundation.framework */; }; 11 | 8060A7281913079D005544DE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7271913079D005544DE /* CoreGraphics.framework */; }; 12 | 8060A72A1913079D005544DE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7291913079D005544DE /* UIKit.framework */; }; 13 | 8060A7301913079D005544DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8060A72E1913079D005544DE /* InfoPlist.strings */; }; 14 | 8060A7321913079D005544DE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8060A7311913079D005544DE /* main.m */; }; 15 | 8060A7361913079D005544DE /* ACEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8060A7351913079D005544DE /* ACEAppDelegate.m */; }; 16 | 8060A7391913079D005544DE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8060A7371913079D005544DE /* Main.storyboard */; }; 17 | 8060A73C1913079D005544DE /* ACEViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8060A73B1913079D005544DE /* ACEViewController.m */; }; 18 | 8060A73E1913079D005544DE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8060A73D1913079D005544DE /* Images.xcassets */; }; 19 | 8060A7451913079D005544DE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7441913079D005544DE /* XCTest.framework */; }; 20 | 8060A7461913079D005544DE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7251913079D005544DE /* Foundation.framework */; }; 21 | 8060A7471913079D005544DE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8060A7291913079D005544DE /* UIKit.framework */; }; 22 | 8060A74F1913079D005544DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8060A74D1913079D005544DE /* InfoPlist.strings */; }; 23 | 8060A7511913079D005544DE /* ACETelPromptDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8060A7501913079D005544DE /* ACETelPromptDemoTests.m */; }; 24 | 8060A75D1913086C005544DE /* ACETelPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 8060A75C1913086C005544DE /* ACETelPrompt.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 8060A7481913079D005544DE /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 8060A71A1913079D005544DE /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 8060A7211913079D005544DE; 33 | remoteInfo = ACETelPromptDemo; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 8060A7221913079D005544DE /* ACETelPromptDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ACETelPromptDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 8060A7251913079D005544DE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | 8060A7271913079D005544DE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | 8060A7291913079D005544DE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | 8060A72D1913079D005544DE /* ACETelPromptDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ACETelPromptDemo-Info.plist"; sourceTree = ""; }; 43 | 8060A72F1913079D005544DE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | 8060A7311913079D005544DE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 8060A7331913079D005544DE /* ACETelPromptDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ACETelPromptDemo-Prefix.pch"; sourceTree = ""; }; 46 | 8060A7341913079D005544DE /* ACEAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ACEAppDelegate.h; sourceTree = ""; }; 47 | 8060A7351913079D005544DE /* ACEAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ACEAppDelegate.m; sourceTree = ""; }; 48 | 8060A7381913079D005544DE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 8060A73A1913079D005544DE /* ACEViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ACEViewController.h; sourceTree = ""; }; 50 | 8060A73B1913079D005544DE /* ACEViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ACEViewController.m; sourceTree = ""; }; 51 | 8060A73D1913079D005544DE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 52 | 8060A7431913079D005544DE /* ACETelPromptDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ACETelPromptDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 8060A7441913079D005544DE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 54 | 8060A74C1913079D005544DE /* ACETelPromptDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ACETelPromptDemoTests-Info.plist"; sourceTree = ""; }; 55 | 8060A74E1913079D005544DE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 56 | 8060A7501913079D005544DE /* ACETelPromptDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ACETelPromptDemoTests.m; sourceTree = ""; }; 57 | 8060A75B1913086C005544DE /* ACETelPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACETelPrompt.h; sourceTree = ""; }; 58 | 8060A75C1913086C005544DE /* ACETelPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACETelPrompt.m; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 8060A71F1913079D005544DE /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 8060A7281913079D005544DE /* CoreGraphics.framework in Frameworks */, 67 | 8060A72A1913079D005544DE /* UIKit.framework in Frameworks */, 68 | 8060A7261913079D005544DE /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 8060A7401913079D005544DE /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 8060A7451913079D005544DE /* XCTest.framework in Frameworks */, 77 | 8060A7471913079D005544DE /* UIKit.framework in Frameworks */, 78 | 8060A7461913079D005544DE /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 8060A7191913079D005544DE = { 86 | isa = PBXGroup; 87 | children = ( 88 | 8060A75A19130851005544DE /* ACETelPrompt */, 89 | 8060A72B1913079D005544DE /* ACETelPromptDemo */, 90 | 8060A74A1913079D005544DE /* ACETelPromptDemoTests */, 91 | 8060A7241913079D005544DE /* Frameworks */, 92 | 8060A7231913079D005544DE /* Products */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 8060A7231913079D005544DE /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 8060A7221913079D005544DE /* ACETelPromptDemo.app */, 100 | 8060A7431913079D005544DE /* ACETelPromptDemoTests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 8060A7241913079D005544DE /* Frameworks */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 8060A7251913079D005544DE /* Foundation.framework */, 109 | 8060A7271913079D005544DE /* CoreGraphics.framework */, 110 | 8060A7291913079D005544DE /* UIKit.framework */, 111 | 8060A7441913079D005544DE /* XCTest.framework */, 112 | ); 113 | name = Frameworks; 114 | sourceTree = ""; 115 | }; 116 | 8060A72B1913079D005544DE /* ACETelPromptDemo */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 8060A7341913079D005544DE /* ACEAppDelegate.h */, 120 | 8060A7351913079D005544DE /* ACEAppDelegate.m */, 121 | 8060A73A1913079D005544DE /* ACEViewController.h */, 122 | 8060A73B1913079D005544DE /* ACEViewController.m */, 123 | 8060A72C1913079D005544DE /* Supporting Files */, 124 | ); 125 | path = ACETelPromptDemo; 126 | sourceTree = ""; 127 | }; 128 | 8060A72C1913079D005544DE /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 8060A73D1913079D005544DE /* Images.xcassets */, 132 | 8060A7371913079D005544DE /* Main.storyboard */, 133 | 8060A72D1913079D005544DE /* ACETelPromptDemo-Info.plist */, 134 | 8060A72E1913079D005544DE /* InfoPlist.strings */, 135 | 8060A7311913079D005544DE /* main.m */, 136 | 8060A7331913079D005544DE /* ACETelPromptDemo-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 8060A74A1913079D005544DE /* ACETelPromptDemoTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 8060A7501913079D005544DE /* ACETelPromptDemoTests.m */, 145 | 8060A74B1913079D005544DE /* Supporting Files */, 146 | ); 147 | path = ACETelPromptDemoTests; 148 | sourceTree = ""; 149 | }; 150 | 8060A74B1913079D005544DE /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 8060A74C1913079D005544DE /* ACETelPromptDemoTests-Info.plist */, 154 | 8060A74D1913079D005544DE /* InfoPlist.strings */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 8060A75A19130851005544DE /* ACETelPrompt */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 8060A75B1913086C005544DE /* ACETelPrompt.h */, 163 | 8060A75C1913086C005544DE /* ACETelPrompt.m */, 164 | ); 165 | path = ACETelPrompt; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXNativeTarget section */ 171 | 8060A7211913079D005544DE /* ACETelPromptDemo */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = 8060A7541913079D005544DE /* Build configuration list for PBXNativeTarget "ACETelPromptDemo" */; 174 | buildPhases = ( 175 | 8060A71E1913079D005544DE /* Sources */, 176 | 8060A71F1913079D005544DE /* Frameworks */, 177 | 8060A7201913079D005544DE /* Resources */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | ); 183 | name = ACETelPromptDemo; 184 | productName = ACETelPromptDemo; 185 | productReference = 8060A7221913079D005544DE /* ACETelPromptDemo.app */; 186 | productType = "com.apple.product-type.application"; 187 | }; 188 | 8060A7421913079D005544DE /* ACETelPromptDemoTests */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = 8060A7571913079D005544DE /* Build configuration list for PBXNativeTarget "ACETelPromptDemoTests" */; 191 | buildPhases = ( 192 | 8060A73F1913079D005544DE /* Sources */, 193 | 8060A7401913079D005544DE /* Frameworks */, 194 | 8060A7411913079D005544DE /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | 8060A7491913079D005544DE /* PBXTargetDependency */, 200 | ); 201 | name = ACETelPromptDemoTests; 202 | productName = ACETelPromptDemoTests; 203 | productReference = 8060A7431913079D005544DE /* ACETelPromptDemoTests.xctest */; 204 | productType = "com.apple.product-type.bundle.unit-test"; 205 | }; 206 | /* End PBXNativeTarget section */ 207 | 208 | /* Begin PBXProject section */ 209 | 8060A71A1913079D005544DE /* Project object */ = { 210 | isa = PBXProject; 211 | attributes = { 212 | CLASSPREFIX = ACE; 213 | LastUpgradeCheck = 0510; 214 | ORGANIZATIONNAME = Aceland; 215 | TargetAttributes = { 216 | 8060A7421913079D005544DE = { 217 | TestTargetID = 8060A7211913079D005544DE; 218 | }; 219 | }; 220 | }; 221 | buildConfigurationList = 8060A71D1913079D005544DE /* Build configuration list for PBXProject "ACETelPromptDemo" */; 222 | compatibilityVersion = "Xcode 3.2"; 223 | developmentRegion = English; 224 | hasScannedForEncodings = 0; 225 | knownRegions = ( 226 | en, 227 | Base, 228 | ); 229 | mainGroup = 8060A7191913079D005544DE; 230 | productRefGroup = 8060A7231913079D005544DE /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | 8060A7211913079D005544DE /* ACETelPromptDemo */, 235 | 8060A7421913079D005544DE /* ACETelPromptDemoTests */, 236 | ); 237 | }; 238 | /* End PBXProject section */ 239 | 240 | /* Begin PBXResourcesBuildPhase section */ 241 | 8060A7201913079D005544DE /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 8060A73E1913079D005544DE /* Images.xcassets in Resources */, 246 | 8060A7301913079D005544DE /* InfoPlist.strings in Resources */, 247 | 8060A7391913079D005544DE /* Main.storyboard in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 8060A7411913079D005544DE /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | 8060A74F1913079D005544DE /* InfoPlist.strings in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | /* End PBXResourcesBuildPhase section */ 260 | 261 | /* Begin PBXSourcesBuildPhase section */ 262 | 8060A71E1913079D005544DE /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | 8060A73C1913079D005544DE /* ACEViewController.m in Sources */, 267 | 8060A75D1913086C005544DE /* ACETelPrompt.m in Sources */, 268 | 8060A7361913079D005544DE /* ACEAppDelegate.m in Sources */, 269 | 8060A7321913079D005544DE /* main.m in Sources */, 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | 8060A73F1913079D005544DE /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 8060A7511913079D005544DE /* ACETelPromptDemoTests.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXTargetDependency section */ 284 | 8060A7491913079D005544DE /* PBXTargetDependency */ = { 285 | isa = PBXTargetDependency; 286 | target = 8060A7211913079D005544DE /* ACETelPromptDemo */; 287 | targetProxy = 8060A7481913079D005544DE /* PBXContainerItemProxy */; 288 | }; 289 | /* End PBXTargetDependency section */ 290 | 291 | /* Begin PBXVariantGroup section */ 292 | 8060A72E1913079D005544DE /* InfoPlist.strings */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 8060A72F1913079D005544DE /* en */, 296 | ); 297 | name = InfoPlist.strings; 298 | sourceTree = ""; 299 | }; 300 | 8060A7371913079D005544DE /* Main.storyboard */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 8060A7381913079D005544DE /* Base */, 304 | ); 305 | name = Main.storyboard; 306 | sourceTree = ""; 307 | }; 308 | 8060A74D1913079D005544DE /* InfoPlist.strings */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | 8060A74E1913079D005544DE /* en */, 312 | ); 313 | name = InfoPlist.strings; 314 | sourceTree = ""; 315 | }; 316 | /* End PBXVariantGroup section */ 317 | 318 | /* Begin XCBuildConfiguration section */ 319 | 8060A7521913079D005544DE /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ALWAYS_SEARCH_USER_PATHS = NO; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | GCC_C_LANGUAGE_STANDARD = gnu99; 338 | GCC_DYNAMIC_NO_PIC = NO; 339 | GCC_OPTIMIZATION_LEVEL = 0; 340 | GCC_PREPROCESSOR_DEFINITIONS = ( 341 | "DEBUG=1", 342 | "$(inherited)", 343 | ); 344 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 346 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 347 | GCC_WARN_UNDECLARED_SELECTOR = YES; 348 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 349 | GCC_WARN_UNUSED_FUNCTION = YES; 350 | GCC_WARN_UNUSED_VARIABLE = YES; 351 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 352 | ONLY_ACTIVE_ARCH = YES; 353 | SDKROOT = iphoneos; 354 | }; 355 | name = Debug; 356 | }; 357 | 8060A7531913079D005544DE /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 362 | CLANG_CXX_LIBRARY = "libc++"; 363 | CLANG_ENABLE_MODULES = YES; 364 | CLANG_ENABLE_OBJC_ARC = YES; 365 | CLANG_WARN_BOOL_CONVERSION = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = YES; 375 | ENABLE_NS_ASSERTIONS = NO; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 384 | SDKROOT = iphoneos; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | 8060A7551913079D005544DE /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 394 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 395 | GCC_PREFIX_HEADER = "ACETelPromptDemo/ACETelPromptDemo-Prefix.pch"; 396 | INFOPLIST_FILE = "ACETelPromptDemo/ACETelPromptDemo-Info.plist"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | WRAPPER_EXTENSION = app; 399 | }; 400 | name = Debug; 401 | }; 402 | 8060A7561913079D005544DE /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 407 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 408 | GCC_PREFIX_HEADER = "ACETelPromptDemo/ACETelPromptDemo-Prefix.pch"; 409 | INFOPLIST_FILE = "ACETelPromptDemo/ACETelPromptDemo-Info.plist"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | WRAPPER_EXTENSION = app; 412 | }; 413 | name = Release; 414 | }; 415 | 8060A7581913079D005544DE /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ACETelPromptDemo.app/ACETelPromptDemo"; 419 | FRAMEWORK_SEARCH_PATHS = ( 420 | "$(SDKROOT)/Developer/Library/Frameworks", 421 | "$(inherited)", 422 | "$(DEVELOPER_FRAMEWORKS_DIR)", 423 | ); 424 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 425 | GCC_PREFIX_HEADER = "ACETelPromptDemo/ACETelPromptDemo-Prefix.pch"; 426 | GCC_PREPROCESSOR_DEFINITIONS = ( 427 | "DEBUG=1", 428 | "$(inherited)", 429 | ); 430 | INFOPLIST_FILE = "ACETelPromptDemoTests/ACETelPromptDemoTests-Info.plist"; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | TEST_HOST = "$(BUNDLE_LOADER)"; 433 | WRAPPER_EXTENSION = xctest; 434 | }; 435 | name = Debug; 436 | }; 437 | 8060A7591913079D005544DE /* Release */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ACETelPromptDemo.app/ACETelPromptDemo"; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(SDKROOT)/Developer/Library/Frameworks", 443 | "$(inherited)", 444 | "$(DEVELOPER_FRAMEWORKS_DIR)", 445 | ); 446 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 447 | GCC_PREFIX_HEADER = "ACETelPromptDemo/ACETelPromptDemo-Prefix.pch"; 448 | INFOPLIST_FILE = "ACETelPromptDemoTests/ACETelPromptDemoTests-Info.plist"; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | TEST_HOST = "$(BUNDLE_LOADER)"; 451 | WRAPPER_EXTENSION = xctest; 452 | }; 453 | name = Release; 454 | }; 455 | /* End XCBuildConfiguration section */ 456 | 457 | /* Begin XCConfigurationList section */ 458 | 8060A71D1913079D005544DE /* Build configuration list for PBXProject "ACETelPromptDemo" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 8060A7521913079D005544DE /* Debug */, 462 | 8060A7531913079D005544DE /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | defaultConfigurationName = Release; 466 | }; 467 | 8060A7541913079D005544DE /* Build configuration list for PBXNativeTarget "ACETelPromptDemo" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | 8060A7551913079D005544DE /* Debug */, 471 | 8060A7561913079D005544DE /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | defaultConfigurationName = Release; 475 | }; 476 | 8060A7571913079D005544DE /* Build configuration list for PBXNativeTarget "ACETelPromptDemoTests" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 8060A7581913079D005544DE /* Debug */, 480 | 8060A7591913079D005544DE /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | /* End XCConfigurationList section */ 486 | }; 487 | rootObject = 8060A71A1913079D005544DE /* Project object */; 488 | } 489 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACEAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ACEAppDelegate.h 3 | // ACETelPromptDemo 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ACEAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACEAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ACEAppDelegate.m 3 | // ACETelPromptDemo 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import "ACEAppDelegate.h" 10 | 11 | @implementation ACEAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACETelPromptDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.acerbetti.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACETelPromptDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACEViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ACEViewController.h 3 | // ACETelPromptDemo 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ACEViewController : UIViewController 12 | 13 | @property (strong, nonatomic) IBOutlet UITextField *phoneField; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ACETelPromptDemo/ACEViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ACEViewController.m 3 | // ACETelPromptDemo 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import "ACEViewController.h" 10 | #import "ACETelPrompt.h" 11 | 12 | @interface ACEViewController () 13 | 14 | @end 15 | 16 | @implementation ACEViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning 25 | { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | - (IBAction)callNumber:(id)sender 31 | { 32 | [ACETelPrompt callPhoneNumber:self.phoneField.text 33 | call:^(NSTimeInterval duration) { 34 | NSLog(@"User made a call of %.1f seconds", duration); 35 | 36 | } cancel:^{ 37 | NSLog(@"User cancelled the call"); 38 | }]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ACETelPromptDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ACETelPromptDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ACETelPromptDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ACETelPromptDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ACETelPromptDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ACETelPromptDemo 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ACEAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ACEAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ACETelPromptDemoTests/ACETelPromptDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.acerbetti.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ACETelPromptDemoTests/ACETelPromptDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ACETelPromptDemoTests.m 3 | // ACETelPromptDemoTests 4 | // 5 | // Created by Stefano Acerbetti on 5/1/14. 6 | // Copyright (c) 2014 Aceland. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ACETelPromptDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ACETelPromptDemoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ACETelPromptDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Stefano Acerbetti 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ACETelPrompt 2 | 3 | `ACETelPrompt` is an helper to easily make phone call using the telprompt scheme. 4 | 5 | Using telprompt first gives a prompt asking whether the user wants to make the call or cancel it. If the user selects the call option from the prompt that is displayed, the call is placed and the control returns back to the app after the call is finished. 6 | 7 | The helper uses blocks to get the user choice also logging the phone duration. 8 | 9 | ## Example Usage 10 | 11 | ```objective-c 12 | [ACETelPrompt callPhoneNumber:self.phoneField.text 13 | call:^(NSTimeInterval duration) { 14 | NSLog(@"User made a call of %.1f seconds", duration); 15 | 16 | } cancel:^{ 17 | NSLog(@"User cancelled the call"); 18 | }]; 19 | ``` 20 | 21 | ## CocoaPods 22 | 23 | 1. Add `pod 'ACETelPrompt'` to your Podfile. 24 | 2. Run `pod install` 25 | 26 | ## License 27 | 28 | ACETelPrompt is available under the MIT license. See the LICENSE file for more info. 29 | --------------------------------------------------------------------------------