From 06a3e3071f9cc1e32d8cb42401194ba4dd252f3f Mon Sep 17 00:00:00 2001 From: Roberto Estrada Casarrubios Date: Wed, 6 Mar 2013 12:59:58 +0100 Subject: [PATCH 1/5] Added podspec and license --- DEComposeViewController.podspec | 20 ++++++++++++++++++++ LICENSE | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 DEComposeViewController.podspec create mode 100644 LICENSE diff --git a/DEComposeViewController.podspec b/DEComposeViewController.podspec new file mode 100644 index 0000000..ec0652e --- /dev/null +++ b/DEComposeViewController.podspec @@ -0,0 +1,20 @@ +# +# Be sure to run `pod spec lint DEComposeViewController.podspec' to ensure this is a +# valid spec. +# +# Remove all comments before submitting the spec. Optional attributes are commented. +# +# For details see: https://github.com/CocoaPods/CocoaPods/wiki/The-podspec-format +# +Pod::Spec.new do |s| + s.name = "DEComposeViewController" + s.version = "1.0.0" + s.summary = "A generic message entry view controller using the style of iOS compose view controllers (like tweet sheets)." + s.description = "A generic message entry view controller using the style of iOS compose view controllers (like tweet sheets). Based on the excellent tweet sheet based control DETweetComposeViewController from DoubleEncore." + s.homepage = "https://github.com/pj4533/DEComposeViewController" + s.author = 'PJ Gray' + s.source = { :git => "git://github.com/RobertoEstrada/DEComposeViewController.git", :tag => "1.0.0" } + s.platform = :ios + s.source_files = '*.{h,m}' + s.resources = "*.xib", "Resources/*.png" +end diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a5ad7b --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright (c) 2011 Double Encore, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the distribution. Neither the name of the Double Encore Inc. nor the names of its +contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 35c706258ca41797c2c7581345713b78db7718ab Mon Sep 17 00:00:00 2001 From: Roberto Estrada Casarrubios Date: Wed, 6 Mar 2013 13:07:54 +0100 Subject: [PATCH 2/5] Corrections to Podspec --- DEComposeViewController.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DEComposeViewController.podspec b/DEComposeViewController.podspec index ec0652e..55d2569 100644 --- a/DEComposeViewController.podspec +++ b/DEComposeViewController.podspec @@ -13,7 +13,8 @@ Pod::Spec.new do |s| s.description = "A generic message entry view controller using the style of iOS compose view controllers (like tweet sheets). Based on the excellent tweet sheet based control DETweetComposeViewController from DoubleEncore." s.homepage = "https://github.com/pj4533/DEComposeViewController" s.author = 'PJ Gray' - s.source = { :git => "git://github.com/RobertoEstrada/DEComposeViewController.git", :tag => "1.0.0" } + s.license = "BSD" + s.source = { :git => "https://github.com/RobertoEstrada/DEComposeViewController.git", :tag => "1.0.0" } s.platform = :ios s.source_files = '*.{h,m}' s.resources = "*.xib", "Resources/*.png" From faa46056b4c8bf3c5562aeee322375817b3f8044 Mon Sep 17 00:00:00 2001 From: Roberto Estrada Casarrubios Date: Wed, 6 Mar 2013 13:39:17 +0100 Subject: [PATCH 3/5] Added property to avoid the use of the location feature if an user does not want it. --- DEComposeViewController.h | 1 + DEComposeViewController.m | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DEComposeViewController.h b/DEComposeViewController.h index 20a1c80..0d901a5 100755 --- a/DEComposeViewController.h +++ b/DEComposeViewController.h @@ -47,6 +47,7 @@ @property (retain, nonatomic) NSString *latString; @property (retain, nonatomic) NSString *lonString; @property BOOL showCoordinates; +@property BOOL useLocation; - (IBAction)send; diff --git a/DEComposeViewController.m b/DEComposeViewController.m index 32f8f4b..b2e61aa 100755 --- a/DEComposeViewController.m +++ b/DEComposeViewController.m @@ -75,6 +75,7 @@ @implementation DEComposeViewController // Public @synthesize completionHandler = _completionHandler; @synthesize alwaysUseDETwitterCredentials = _alwaysUseDETwitterCredentials; +@synthesize useLocation = _useLocation; // Private @synthesize text = _text; @@ -281,8 +282,12 @@ - (void)viewDidLoad self.lonString = nil; // default to add current location - self.locationManager = [[CLLocationManager alloc] init]; - [self startUpdatingLocation]; + if (_useLocation) { + self.locationManager = [[CLLocationManager alloc] init]; + [self startUpdatingLocation]; + } else { + self.locButton.hidden = YES; + } } @@ -466,7 +471,7 @@ - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLoca self.lonString = [NSString stringWithFormat:@"%f", self.bestEffortAtLocation.coordinate.longitude]; } --(void)startUpdatingLocation { +-(void)startUpdatingLocation { self.locationManager.delegate = self; self.locationManager.distanceFilter = kCLDistanceFilterNone; self.locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; From 87f9566c93514a3072c94c9aa949392a35d3b989 Mon Sep 17 00:00:00 2001 From: Roberto Estrada Casarrubios Date: Thu, 7 Mar 2013 10:50:01 +0100 Subject: [PATCH 4/5] Added title view to the compose view --- DEComposeView.xib | 71 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/DEComposeView.xib b/DEComposeView.xib index 10f9f9b..dd8adee 100755 --- a/DEComposeView.xib +++ b/DEComposeView.xib @@ -1,14 +1,14 @@ - 1536 - 11E53 - 2840 - 1138.47 - 569.00 + 1552 + 12C60 + 3084 + 1187.34 + 625.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1926 + 2083 IBProxyObject @@ -316,11 +316,48 @@ NO + + + 290 + {{0, 9}, {312, 24}} + + + + _NS:328 + + 3 + MCAwAA + + NO + YES + 3 + NO + IBCocoaTouchFramework + Title + + 3 + MC40NjgyMzIzMDQyAA + + + 1 + 10 + 1 + + 2 + 20 + + + Helvetica-Bold + 20 + 16 + + NO + {{4, 25}, {312, 189}} - + _NS:196 NO @@ -332,6 +369,7 @@ {{244, 68}, {79, 34}} + _NS:567 NO IBCocoaTouchFramework @@ -484,6 +522,14 @@ 69 + + + titleLabel + + + + 73 + cancel @@ -564,6 +610,7 @@ + @@ -648,6 +695,11 @@ + + 72 + + + @@ -674,12 +726,13 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 70 + 73 @@ -828,6 +881,6 @@ {78, 34} {12, 30} - 1926 + 2083 From 36bb58d5dac2c4196752b5ce0ed9493c9df8b0a2 Mon Sep 17 00:00:00 2001 From: Roberto Estrada Casarrubios Date: Thu, 7 Mar 2013 11:00:50 +0100 Subject: [PATCH 5/5] Title label now uses embossed label --- DEComposeView.xib | 1 + 1 file changed, 1 insertion(+) diff --git a/DEComposeView.xib b/DEComposeView.xib index dd8adee..1703f85 100755 --- a/DEComposeView.xib +++ b/DEComposeView.xib @@ -726,6 +726,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + DEEmbossedLabel com.apple.InterfaceBuilder.IBCocoaTouchPlugin