Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Layout button and default image

  • Loading branch information...
commit 90ec2dac7e1baa90533e1a8d488c0eb96cf17668 1 parent d1af135
@lucascorrea authored
View
BIN  Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
37 SCTwitter.xcodeproj/project.pbxproj
@@ -39,8 +39,9 @@
F99448F014FFF99F0017A5D8 /* twitter_load.png in Resources */ = {isa = PBXBuildFile; fileRef = F99448DC14FFF99F0017A5D8 /* twitter_load.png */; };
F99448F5150119510017A5D8 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = F99448F4150119500017A5D8 /* icon.png */; };
F99448F71501195D0017A5D8 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F99448F61501195B0017A5D8 /* icon@2x.png */; };
- F9A4ACC9150142C500D73407 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F9A4ACC8150142C500D73407 /* Default@2x.png */; };
- F9A4ACCC150142CC00D73407 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = F9A4ACCB150142CC00D73407 /* Default.png */; };
+ F9A4ACD01501474500D73407 /* backgroundButton.png in Resources */ = {isa = PBXBuildFile; fileRef = F9A4ACCF1501474500D73407 /* backgroundButton.png */; };
+ F9A4ACD2150149A200D73407 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = F9A4ACD1150149A200D73407 /* Default.png */; };
+ F9A4ACD4150149AB00D73407 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F9A4ACD3150149AB00D73407 /* Default@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -117,8 +118,9 @@
F99448DC14FFF99F0017A5D8 /* twitter_load.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = twitter_load.png; sourceTree = "<group>"; };
F99448F4150119500017A5D8 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
F99448F61501195B0017A5D8 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = "<group>"; };
- F9A4ACC8150142C500D73407 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
- F9A4ACCB150142CC00D73407 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+ F9A4ACCF1501474500D73407 /* backgroundButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backgroundButton.png; path = Resources/images/backgroundButton.png; sourceTree = "<group>"; };
+ F9A4ACD1150149A200D73407 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+ F9A4ACD3150149AB00D73407 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -140,11 +142,12 @@
F99446DE14FEF6370017A5D8 = {
isa = PBXGroup;
children = (
- F9A4ACCB150142CC00D73407 /* Default.png */,
- F9A4ACC8150142C500D73407 /* Default@2x.png */,
+ F9A4ACD3150149AB00D73407 /* Default@2x.png */,
+ F9A4ACD1150149A200D73407 /* Default.png */,
F99448F61501195B0017A5D8 /* icon@2x.png */,
F99448F4150119500017A5D8 /* icon.png */,
F99446F314FEF6370017A5D8 /* SCTwitter */,
+ F9A4ACCD1501472300D73407 /* Resources */,
F994471114FEFB840017A5D8 /* Other Sources */,
);
sourceTree = "<group>";
@@ -315,6 +318,23 @@
name = Classes;
sourceTree = "<group>";
};
+ F9A4ACCD1501472300D73407 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ F9A4ACCE1501473300D73407 /* images */,
+ );
+ name = Resources;
+ path = SCTwitter;
+ sourceTree = "<group>";
+ };
+ F9A4ACCE1501473300D73407 /* images */ = {
+ isa = PBXGroup;
+ children = (
+ F9A4ACCF1501474500D73407 /* backgroundButton.png */,
+ );
+ name = images;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -373,8 +393,9 @@
F99448F014FFF99F0017A5D8 /* twitter_load.png in Resources */,
F99448F5150119510017A5D8 /* icon.png in Resources */,
F99448F71501195D0017A5D8 /* icon@2x.png in Resources */,
- F9A4ACC9150142C500D73407 /* Default@2x.png in Resources */,
- F9A4ACCC150142CC00D73407 /* Default.png in Resources */,
+ F9A4ACD01501474500D73407 /* backgroundButton.png in Resources */,
+ F9A4ACD2150149A200D73407 /* Default.png in Resources */,
+ F9A4ACD4150149AB00D73407 /* Default@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN  SCTwitter/Resources/images/backgroundButton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1  SCTwitter/SCTwitter/SCTwitter.h
@@ -49,6 +49,7 @@ typedef void(^SCTwitterDirectCallback)(BOOL success, id result);
@property (nonatomic, copy) SCTwitterUserCallback userCallback;
@property (nonatomic, copy) SCTwitterDirectCallback directCallback;
+
+ (SCTwitter *)shared;
+ (void)loginViewControler:(UIViewController *)aViewController callback:(void (^)(BOOL success))aCallback;
+ (void)logoutCallback:(void(^)(BOOL success))aCallback;
View
2  SCTwitter/SCTwitter/SCTwitter.m
@@ -323,7 +323,6 @@ - (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionId
}
}
-
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier
{
if (self.userCallback) {
@@ -332,7 +331,6 @@ - (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionId
}
}
-
- (void)directMessagesReceived:(NSArray *)messages forRequest:(NSString *)connectionIdentifier
{
if (self.directCallback) {
View
2  SCTwitter/SCTwitterViewController.h
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
-@interface SCTwitterViewController : UIViewController
+@interface SCTwitterViewController : UIViewController <UITextFieldDelegate>
@property (retain, nonatomic) IBOutlet UITextField *messageText;
View
14 SCTwitter/SCTwitterViewController.m
@@ -151,10 +151,22 @@ - (IBAction)directMessageButtonAction:(id)sender
if (success) {
//Return array NSDictonary
NSLog(@"%@", result);
- }
+ }else{
+ NSLog(@"Error : %@", result);
+ }
}];
}
+#pragma mark -
+#pragma mark - UITextFieldDelegate methods
+
+- (BOOL)textFieldShouldReturn:(UITextField *)textField
+{
+ [textField resignFirstResponder];
+ return YES;
+}
+
+
- (void)dealloc {
[messageText release];
[super dealloc];
View
64 SCTwitter/en.lproj/MainStoryboard.storyboard
@@ -17,12 +17,12 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="XDM-n1-1r6">
- <rect key="frame" x="69" y="86" width="81" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="XDM-n1-1r6">
+ <rect key="frame" x="35" y="86" width="120" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="Login">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="Login" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -32,12 +32,12 @@
<action selector="loginButtonAction:" destination="2" eventType="touchUpInside" id="9QK-Y5-wTG"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="YwI-AH-qCi">
- <rect key="frame" x="176" y="86" width="75" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="YwI-AH-qCi">
+ <rect key="frame" x="165" y="86" width="120" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="Logout">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="Logout" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -47,12 +47,12 @@
<action selector="logoutButtonAction:" destination="2" eventType="touchUpInside" id="Unf-E0-Vje"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="JGh-7j-SFl">
- <rect key="frame" x="71" y="145" width="180" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="JGh-7j-SFl">
+ <rect key="frame" x="35" y="160" width="250" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="PostBackground">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="PostBackground" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -62,12 +62,12 @@
<action selector="postBackgroundButtonAction:" destination="2" eventType="touchUpInside" id="m8b-ri-c0p"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="3qC-jx-6RK">
- <rect key="frame" x="71" y="206" width="180" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="3qC-jx-6RK">
+ <rect key="frame" x="35" y="221" width="250" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="PublicTimeline">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="PublicTimeline" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -77,12 +77,12 @@
<action selector="publicTimelineButtonAction:" destination="2" eventType="touchUpInside" id="aPg-bD-Ah1"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="OVU-lo-pSV">
- <rect key="frame" x="71" y="265" width="180" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="OVU-lo-pSV">
+ <rect key="frame" x="35" y="280" width="250" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="User Timeline">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="User Timeline" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -92,12 +92,12 @@
<action selector="userTimelineButtonAction:" destination="2" eventType="touchUpInside" id="cfI-Ex-5m0"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="GA8-eT-F86">
- <rect key="frame" x="71" y="322" width="180" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="GA8-eT-F86">
+ <rect key="frame" x="35" y="337" width="250" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="User Information">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="User Information" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -107,12 +107,12 @@
<action selector="userInformationButtonAction:" destination="2" eventType="touchUpInside" id="SXY-38-MB0"/>
</connections>
</button>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="GRP-17-fqR">
- <rect key="frame" x="71" y="379" width="180" height="37"/>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="GRP-17-fqR">
+ <rect key="frame" x="35" y="395" width="250" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
- <state key="normal" title="Direct Message">
- <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <state key="normal" title="Direct Message" backgroundImage="backgroundButton.png">
+ <color key="titleColor" red="0.37819006910000003" green="0.62873935010000004" blue="0.78667868590000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
@@ -123,13 +123,16 @@
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="This message in SCTwitter Framework #ios #dev" borderStyle="roundedRect" minimumFontSize="17" id="87G-El-0gU">
- <rect key="frame" x="31" y="25" width="258" height="31"/>
+ <rect key="frame" x="31" y="34" width="260" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<textInputTraits key="textInputTraits"/>
+ <connections>
+ <outlet property="delegate" destination="2" id="Az1-aT-Jng"/>
+ </connections>
</textField>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Message" lineBreakMode="tailTruncation" minimumFontSize="10" id="66S-CT-kle">
- <rect key="frame" x="33" y="5" width="93" height="21"/>
+ <rect key="frame" x="34" y="12" width="93" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" name="TrebuchetMS" family="Trebuchet MS" pointSize="13"/>
@@ -149,6 +152,7 @@
</scenes>
<resources>
<image name="Default.png" width="640" height="960"/>
+ <image name="backgroundButton.png" width="342" height="50"/>
</resources>
<classes>
<class className="SCTwitterViewController" superclassName="UIViewController">
Please sign in to comment.
Something went wrong with that request. Please try again.