Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 63 additions & 9 deletions DEComposeView.xib
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1926</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
Expand Down Expand Up @@ -316,11 +316,48 @@
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="1057276005">
<reference key="NSNextResponder" ref="947069124"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{0, 9}, {312, 24}}</string>
<reference key="NSSuperview" ref="947069124"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="721475442"/>
<string key="NSReuseIdentifierKey">_NS:328</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">3</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Title</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC40NjgyMzIzMDQyAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<double key="pointSize">20</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">20</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
</array>
<string key="NSFrame">{{4, 25}, {312, 189}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="721475442"/>
<reference key="NSNextKeyView" ref="1057276005"/>
<string key="NSReuseIdentifierKey">_NS:196</string>
<reference key="IBUIBackgroundColor" ref="379362525"/>
<bool key="IBUIAutoresizesSubviews">NO</bool>
Expand All @@ -332,6 +369,7 @@
<string key="NSFrame">{{244, 68}, {79, 34}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
Expand Down Expand Up @@ -484,6 +522,14 @@
</object>
<int key="connectionID">69</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">titleLabel</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1057276005"/>
</object>
<int key="connectionID">73</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">cancel</string>
Expand Down Expand Up @@ -564,6 +610,7 @@
<reference ref="1044352878"/>
<reference ref="360140327"/>
<reference ref="153600401"/>
<reference ref="1057276005"/>
</array>
<reference key="parent" ref="191373211"/>
</object>
Expand Down Expand Up @@ -648,6 +695,11 @@
<reference key="object" ref="153600401"/>
<reference key="parent" ref="947069124"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">72</int>
<reference key="object" ref="1057276005"/>
<reference key="parent" ref="947069124"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
Expand All @@ -674,12 +726,14 @@
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="62.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="64.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="72.CustomClassName">DEEmbossedLabel</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">70</int>
<int key="maxID">73</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -828,6 +882,6 @@
<string key="DEPaperClip.png">{78, 34}</string>
<string key="DESendButtonPortrait.png">{12, 30}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1926</string>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
1 change: 1 addition & 0 deletions DEComposeViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
@property (retain, nonatomic) NSString *latString;
@property (retain, nonatomic) NSString *lonString;
@property BOOL showCoordinates;
@property BOOL useLocation;


- (IBAction)send;
Expand Down
11 changes: 8 additions & 3 deletions DEComposeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ @implementation DEComposeViewController
// Public
@synthesize completionHandler = _completionHandler;
@synthesize alwaysUseDETwitterCredentials = _alwaysUseDETwitterCredentials;
@synthesize useLocation = _useLocation;

// Private
@synthesize text = _text;
Expand Down Expand Up @@ -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;
}
}


Expand Down Expand Up @@ -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;
Expand Down
21 changes: 21 additions & 0 deletions DEComposeViewController.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# 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.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"
end
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.