Skip to content
Browse files

Switching Twitter example to AppDotNet, as access to the public timel…

…ine is now an authenticated call
  • Loading branch information...
1 parent 018dd17 commit b138589a65ddca1eb4904be57b1b64a089dda9df @mattt mattt committed Oct 11, 2012
Showing with 239 additions and 183 deletions.
  1. +1 −1 AFIncrementalStore.xcworkspace/contents.xcworkspacedata
  2. +51 −51 ...es/Twitter Client/{Twitter Example.xcodeproj → Activity Stream Example.xcodeproj}/project.pbxproj
  3. 0 ...ample.xcodeproj → Activity Stream Example.xcodeproj}/project.xcworkspace/contents.xcworkspacedata
  4. +7 −7 Examples/Twitter Client/AppDelegate.m
  5. +1 −1 Examples/Twitter Client/{Twitter.xcdatamodeld → AppDotNet.xcdatamodeld}/.xccurrentversion
  6. +19 −0 Examples/Twitter Client/AppDotNet.xcdatamodeld/AppDotNet.xcdatamodel/contents
  7. +2 −2 Examples/Twitter Client/Classes/{TwitterAPIClient.h → AppDotNetAPIClient.h}
  8. +13 −13 Examples/Twitter Client/Classes/{TwitterAPIClient.m → AppDotNetAPIClient.m}
  9. +1 −1 Examples/Twitter Client/Classes/{TwitterIncrementalStore.h → AppDotNetIncrementalStore.h}
  10. +5 −5 Examples/Twitter Client/Classes/{TwitterIncrementalStore.m → AppDotNetIncrementalStore.m}
  11. +1 −1 Examples/Twitter Client/Classes/{PublicTimelineViewController.h → GlobalStreamViewController.h}
  12. +12 −12 Examples/Twitter Client/Classes/{PublicTimelineViewController.m → GlobalStreamViewController.m}
  13. +35 −0 Examples/Twitter Client/Classes/Post.h
  14. +33 −0 Examples/Twitter Client/Classes/Post.m
  15. +5 −5 Examples/Twitter Client/Classes/{TweetTableViewCell.h → PostTableViewCell.h}
  16. +14 −14 Examples/Twitter Client/Classes/{TweetTableViewCell.m → PostTableViewCell.m}
  17. +0 −21 Examples/Twitter Client/Classes/Tweet.h
  18. +0 −19 Examples/Twitter Client/Classes/Tweet.m
  19. +19 −5 Examples/Twitter Client/Classes/User.h
  20. +19 −5 Examples/Twitter Client/Classes/User.m
  21. +1 −1 Examples/Twitter Client/Info.plist
  22. +0 −19 Examples/Twitter Client/Twitter.xcdatamodeld/Twitter.xcdatamodel/contents
View
2 AFIncrementalStore.xcworkspace/contents.xcworkspacedata
@@ -21,7 +21,7 @@
location = "group:Examples/Basic Example/Basic Example.xcodeproj">
</FileRef>
<FileRef
- location = "group:Examples/Twitter Client/Twitter Example.xcodeproj">
+ location = "group:Examples/Twitter Client/Activity Stream Example.xcodeproj">
</FileRef>
<FileRef
location = "group:Examples/CheckIns Example/CheckIns Example.xcodeproj">
View
102 ...Twitter Example.xcodeproj/project.pbxproj → ... Stream Example.xcodeproj/project.pbxproj
@@ -7,15 +7,15 @@
objects = {
/* Begin PBXBuildFile section */
- F87CD18E15DAB2B200E4C166 /* TweetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F87CD18D15DAB2B200E4C166 /* TweetTableViewCell.m */; };
+ F8478A69162729B80026615F /* AppDotNet.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F8874F2115B08CA80048680F /* AppDotNet.xcdatamodeld */; };
+ F87CD18E15DAB2B200E4C166 /* PostTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F87CD18D15DAB2B200E4C166 /* PostTableViewCell.m */; };
F87CD19215DAB45100E4C166 /* profile-image-placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = F87CD19015DAB45100E4C166 /* profile-image-placeholder.png */; };
F87CD19315DAB45100E4C166 /* profile-image-placeholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F87CD19115DAB45100E4C166 /* profile-image-placeholder@2x.png */; };
- F8874F1615B08B770048680F /* PublicTimelineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0915B08B770048680F /* PublicTimelineViewController.m */; };
- F8874F1915B08B770048680F /* TwitterAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0C15B08B770048680F /* TwitterAPIClient.m */; };
- F8874F1A15B08B770048680F /* TwitterIncrementalStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0D15B08B770048680F /* TwitterIncrementalStore.m */; };
+ F8874F1615B08B770048680F /* GlobalStreamViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0915B08B770048680F /* GlobalStreamViewController.m */; };
+ F8874F1915B08B770048680F /* AppDotNetAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0C15B08B770048680F /* AppDotNetAPIClient.m */; };
+ F8874F1A15B08B770048680F /* AppDotNetIncrementalStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F0D15B08B770048680F /* AppDotNetIncrementalStore.m */; };
F8874F1F15B08C2A0048680F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F1E15B08C2A0048680F /* main.m */; };
F8874F2015B08C4B0048680F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8874F1B15B08BD30048680F /* AppDelegate.m */; };
- F8874F2315B08CA80048680F /* Twitter.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F8874F2115B08CA80048680F /* Twitter.xcdatamodeld */; };
F8AD92D815D9A0B400402FE9 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92C415D9A0B400402FE9 /* AFHTTPClient.m */; };
F8AD92D915D9A0B400402FE9 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92C615D9A0B400402FE9 /* AFHTTPRequestOperation.m */; };
F8AD92DA15D9A0B400402FE9 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92C815D9A0B400402FE9 /* AFImageRequestOperation.m */; };
@@ -27,7 +27,7 @@
F8AD92E115D9A0B400402FE9 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92D715D9A0B400402FE9 /* UIImageView+AFNetworking.m */; };
F8AD92E715D9A0BB00402FE9 /* AFIncrementalStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92E415D9A0BB00402FE9 /* AFIncrementalStore.m */; };
F8AD92E815D9A0BB00402FE9 /* AFRESTClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92E615D9A0BB00402FE9 /* AFRESTClient.m */; };
- F8AD92F815D9A2DB00402FE9 /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92F715D9A2DB00402FE9 /* Tweet.m */; };
+ F8AD92F815D9A2DB00402FE9 /* Post.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92F715D9A2DB00402FE9 /* Post.m */; };
F8AD92FB15D9A2E500402FE9 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AD92FA15D9A2E500402FE9 /* User.m */; };
F8AFAFB215AB4F28003FE5BB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8AFAFB115AB4F28003FE5BB /* UIKit.framework */; };
F8AFAFB415AB4F28003FE5BB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8AFAFB315AB4F28003FE5BB /* Foundation.framework */; };
@@ -37,22 +37,22 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- F87CD18C15DAB2B200E4C166 /* TweetTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TweetTableViewCell.h; path = Classes/TweetTableViewCell.h; sourceTree = SOURCE_ROOT; };
- F87CD18D15DAB2B200E4C166 /* TweetTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TweetTableViewCell.m; path = Classes/TweetTableViewCell.m; sourceTree = SOURCE_ROOT; };
+ F87CD18C15DAB2B200E4C166 /* PostTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PostTableViewCell.h; path = Classes/PostTableViewCell.h; sourceTree = SOURCE_ROOT; };
+ F87CD18D15DAB2B200E4C166 /* PostTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PostTableViewCell.m; path = Classes/PostTableViewCell.m; sourceTree = SOURCE_ROOT; };
F87CD19015DAB45100E4C166 /* profile-image-placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "profile-image-placeholder.png"; sourceTree = "<group>"; };
F87CD19115DAB45100E4C166 /* profile-image-placeholder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "profile-image-placeholder@2x.png"; sourceTree = "<group>"; };
F8874E7515B08AD30048680F /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
F8874E7615B08ADB0048680F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
- F8874F0915B08B770048680F /* PublicTimelineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PublicTimelineViewController.m; path = Classes/PublicTimelineViewController.m; sourceTree = SOURCE_ROOT; };
- F8874F0C15B08B770048680F /* TwitterAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TwitterAPIClient.m; path = Classes/TwitterAPIClient.m; sourceTree = SOURCE_ROOT; };
- F8874F0D15B08B770048680F /* TwitterIncrementalStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TwitterIncrementalStore.m; path = Classes/TwitterIncrementalStore.m; sourceTree = SOURCE_ROOT; };
- F8874F1015B08B770048680F /* PublicTimelineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PublicTimelineViewController.h; path = Classes/PublicTimelineViewController.h; sourceTree = SOURCE_ROOT; };
- F8874F1215B08B770048680F /* TwitterAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TwitterAPIClient.h; path = Classes/TwitterAPIClient.h; sourceTree = SOURCE_ROOT; };
- F8874F1315B08B770048680F /* TwitterIncrementalStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TwitterIncrementalStore.h; path = Classes/TwitterIncrementalStore.h; sourceTree = SOURCE_ROOT; };
+ F8874F0915B08B770048680F /* GlobalStreamViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GlobalStreamViewController.m; path = Classes/GlobalStreamViewController.m; sourceTree = SOURCE_ROOT; };
+ F8874F0C15B08B770048680F /* AppDotNetAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDotNetAPIClient.m; path = Classes/AppDotNetAPIClient.m; sourceTree = SOURCE_ROOT; };
+ F8874F0D15B08B770048680F /* AppDotNetIncrementalStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDotNetIncrementalStore.m; path = Classes/AppDotNetIncrementalStore.m; sourceTree = SOURCE_ROOT; };
+ F8874F1015B08B770048680F /* GlobalStreamViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalStreamViewController.h; path = Classes/GlobalStreamViewController.h; sourceTree = SOURCE_ROOT; };
+ F8874F1215B08B770048680F /* AppDotNetAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDotNetAPIClient.h; path = Classes/AppDotNetAPIClient.h; sourceTree = SOURCE_ROOT; };
+ F8874F1315B08B770048680F /* AppDotNetIncrementalStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDotNetIncrementalStore.h; path = Classes/AppDotNetIncrementalStore.h; sourceTree = SOURCE_ROOT; };
F8874F1B15B08BD30048680F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
F8874F1C15B08BD30048680F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
F8874F1E15B08C2A0048680F /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
- F8874F2215B08CA80048680F /* Twitter.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Twitter.xcdatamodel; sourceTree = "<group>"; };
+ F8874F2215B08CA80048680F /* AppDotNet.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = AppDotNet.xcdatamodel; sourceTree = "<group>"; };
F8AD92C315D9A0B400402FE9 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPClient.h; sourceTree = "<group>"; };
F8AD92C415D9A0B400402FE9 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPClient.m; sourceTree = "<group>"; };
F8AD92C515D9A0B400402FE9 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = "<group>"; };
@@ -76,11 +76,11 @@
F8AD92E415D9A0BB00402FE9 /* AFIncrementalStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFIncrementalStore.m; sourceTree = "<group>"; };
F8AD92E515D9A0BB00402FE9 /* AFRESTClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRESTClient.h; sourceTree = "<group>"; };
F8AD92E615D9A0BB00402FE9 /* AFRESTClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRESTClient.m; sourceTree = "<group>"; };
- F8AD92F615D9A2DB00402FE9 /* Tweet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tweet.h; path = Classes/Tweet.h; sourceTree = SOURCE_ROOT; };
- F8AD92F715D9A2DB00402FE9 /* Tweet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Tweet.m; path = Classes/Tweet.m; sourceTree = SOURCE_ROOT; };
+ F8AD92F615D9A2DB00402FE9 /* Post.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Post.h; path = Classes/Post.h; sourceTree = SOURCE_ROOT; };
+ F8AD92F715D9A2DB00402FE9 /* Post.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Post.m; path = Classes/Post.m; sourceTree = SOURCE_ROOT; };
F8AD92F915D9A2E500402FE9 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = User.h; path = Classes/User.h; sourceTree = SOURCE_ROOT; };
F8AD92FA15D9A2E500402FE9 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = User.m; path = Classes/User.m; sourceTree = SOURCE_ROOT; };
- F8AFAFAD15AB4F28003FE5BB /* Twitter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Twitter.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ F8AFAFAD15AB4F28003FE5BB /* App.net.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.net.app; sourceTree = BUILT_PRODUCTS_DIR; };
F8AFAFB115AB4F28003FE5BB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
F8AFAFB315AB4F28003FE5BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
F8AFAFB515AB4F28003FE5BB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -107,8 +107,8 @@
F87CD18A15DAB2A700E4C166 /* Views */ = {
isa = PBXGroup;
children = (
- F87CD18C15DAB2B200E4C166 /* TweetTableViewCell.h */,
- F87CD18D15DAB2B200E4C166 /* TweetTableViewCell.m */,
+ F87CD18C15DAB2B200E4C166 /* PostTableViewCell.h */,
+ F87CD18D15DAB2B200E4C166 /* PostTableViewCell.m */,
);
name = Views;
sourceTree = "<group>";
@@ -133,18 +133,18 @@
F8874E5915AF927D0048680F /* Controllers */ = {
isa = PBXGroup;
children = (
- F8874F1015B08B770048680F /* PublicTimelineViewController.h */,
- F8874F0915B08B770048680F /* PublicTimelineViewController.m */,
+ F8874F1015B08B770048680F /* GlobalStreamViewController.h */,
+ F8874F0915B08B770048680F /* GlobalStreamViewController.m */,
);
name = Controllers;
sourceTree = "<group>";
};
F8874E5B15AF92830048680F /* Models */ = {
isa = PBXGroup;
children = (
- F8874F2115B08CA80048680F /* Twitter.xcdatamodeld */,
- F8AD92F615D9A2DB00402FE9 /* Tweet.h */,
- F8AD92F715D9A2DB00402FE9 /* Tweet.m */,
+ F8874F2115B08CA80048680F /* AppDotNet.xcdatamodeld */,
+ F8AD92F615D9A2DB00402FE9 /* Post.h */,
+ F8AD92F715D9A2DB00402FE9 /* Post.m */,
F8AD92F915D9A2E500402FE9 /* User.h */,
F8AD92FA15D9A2E500402FE9 /* User.m */,
);
@@ -193,7 +193,7 @@
F8AFAFA215AB4F28003FE5BB = {
isa = PBXGroup;
children = (
- F8AFAFB915AB4F28003FE5BB /* Twitter */,
+ F8AFAFB915AB4F28003FE5BB /* AppDotNet */,
F87CD19415DAB45D00E4C166 /* Resources */,
F8AFAFB015AB4F28003FE5BB /* Frameworks */,
F8AFAFAE15AB4F28003FE5BB /* Products */,
@@ -204,7 +204,7 @@
F8AFAFAE15AB4F28003FE5BB /* Products */ = {
isa = PBXGroup;
children = (
- F8AFAFAD15AB4F28003FE5BB /* Twitter.app */,
+ F8AFAFAD15AB4F28003FE5BB /* App.net.app */,
);
name = Products;
sourceTree = "<group>";
@@ -220,21 +220,21 @@
name = Frameworks;
sourceTree = "<group>";
};
- F8AFAFB915AB4F28003FE5BB /* Twitter */ = {
+ F8AFAFB915AB4F28003FE5BB /* AppDotNet */ = {
isa = PBXGroup;
children = (
F8874F1C15B08BD30048680F /* AppDelegate.h */,
F8874F1B15B08BD30048680F /* AppDelegate.m */,
- F8874F1215B08B770048680F /* TwitterAPIClient.h */,
- F8874F0C15B08B770048680F /* TwitterAPIClient.m */,
- F8874F1315B08B770048680F /* TwitterIncrementalStore.h */,
- F8874F0D15B08B770048680F /* TwitterIncrementalStore.m */,
+ F8874F1215B08B770048680F /* AppDotNetAPIClient.h */,
+ F8874F0C15B08B770048680F /* AppDotNetAPIClient.m */,
+ F8874F1315B08B770048680F /* AppDotNetIncrementalStore.h */,
+ F8874F0D15B08B770048680F /* AppDotNetIncrementalStore.m */,
F8874E5B15AF92830048680F /* Models */,
F87CD18A15DAB2A700E4C166 /* Views */,
F8874E5915AF927D0048680F /* Controllers */,
F8AFAFBA15AB4F28003FE5BB /* Supporting Files */,
);
- name = Twitter;
+ name = AppDotNet;
path = IncrementalStoreExample;
sourceTree = "<group>";
};
@@ -270,9 +270,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- F8AFAFAC15AB4F28003FE5BB /* Twitter */ = {
+ F8AFAFAC15AB4F28003FE5BB /* App.net */ = {
isa = PBXNativeTarget;
- buildConfigurationList = F8AFAFCA15AB4F28003FE5BB /* Build configuration list for PBXNativeTarget "Twitter" */;
+ buildConfigurationList = F8AFAFCA15AB4F28003FE5BB /* Build configuration list for PBXNativeTarget "App.net" */;
buildPhases = (
F8AFAFA915AB4F28003FE5BB /* Sources */,
F8AFAFAA15AB4F28003FE5BB /* Frameworks */,
@@ -282,9 +282,9 @@
);
dependencies = (
);
- name = Twitter;
+ name = App.net;
productName = IncrementalStoreExample;
- productReference = F8AFAFAD15AB4F28003FE5BB /* Twitter.app */;
+ productReference = F8AFAFAD15AB4F28003FE5BB /* App.net.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -296,7 +296,7 @@
CLASSPREFIX = AF;
LastUpgradeCheck = 0430;
};
- buildConfigurationList = F8AFAFA715AB4F28003FE5BB /* Build configuration list for PBXProject "Twitter Example" */;
+ buildConfigurationList = F8AFAFA715AB4F28003FE5BB /* Build configuration list for PBXProject "Activity Stream Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -308,7 +308,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
- F8AFAFAC15AB4F28003FE5BB /* Twitter */,
+ F8AFAFAC15AB4F28003FE5BB /* App.net */,
);
};
/* End PBXProject section */
@@ -330,12 +330,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- F8874F1615B08B770048680F /* PublicTimelineViewController.m in Sources */,
- F8874F1915B08B770048680F /* TwitterAPIClient.m in Sources */,
- F8874F1A15B08B770048680F /* TwitterIncrementalStore.m in Sources */,
+ F8478A69162729B80026615F /* AppDotNet.xcdatamodeld in Sources */,
+ F8874F1615B08B770048680F /* GlobalStreamViewController.m in Sources */,
+ F8874F1915B08B770048680F /* AppDotNetAPIClient.m in Sources */,
+ F8874F1A15B08B770048680F /* AppDotNetIncrementalStore.m in Sources */,
F8874F2015B08C4B0048680F /* AppDelegate.m in Sources */,
F8874F1F15B08C2A0048680F /* main.m in Sources */,
- F8874F2315B08CA80048680F /* Twitter.xcdatamodeld in Sources */,
F8AD92D815D9A0B400402FE9 /* AFHTTPClient.m in Sources */,
F8AD92D915D9A0B400402FE9 /* AFHTTPRequestOperation.m in Sources */,
F8AD92DA15D9A0B400402FE9 /* AFImageRequestOperation.m in Sources */,
@@ -347,9 +347,9 @@
F8AD92E115D9A0B400402FE9 /* UIImageView+AFNetworking.m in Sources */,
F8AD92E715D9A0BB00402FE9 /* AFIncrementalStore.m in Sources */,
F8AD92E815D9A0BB00402FE9 /* AFRESTClient.m in Sources */,
- F8AD92F815D9A2DB00402FE9 /* Tweet.m in Sources */,
+ F8AD92F815D9A2DB00402FE9 /* Post.m in Sources */,
F8AD92FB15D9A2E500402FE9 /* User.m in Sources */,
- F87CD18E15DAB2B200E4C166 /* TweetTableViewCell.m in Sources */,
+ F87CD18E15DAB2B200E4C166 /* PostTableViewCell.m in Sources */,
F8B77D8E161E3F5400A88B7F /* ISO8601DateFormatter.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -427,7 +427,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- F8AFAFA715AB4F28003FE5BB /* Build configuration list for PBXProject "Twitter Example" */ = {
+ F8AFAFA715AB4F28003FE5BB /* Build configuration list for PBXProject "Activity Stream Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F8AFAFC815AB4F28003FE5BB /* Debug */,
@@ -436,7 +436,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- F8AFAFCA15AB4F28003FE5BB /* Build configuration list for PBXNativeTarget "Twitter" */ = {
+ F8AFAFCA15AB4F28003FE5BB /* Build configuration list for PBXNativeTarget "App.net" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F8AFAFCB15AB4F28003FE5BB /* Debug */,
@@ -448,13 +448,13 @@
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
- F8874F2115B08CA80048680F /* Twitter.xcdatamodeld */ = {
+ F8874F2115B08CA80048680F /* AppDotNet.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
- F8874F2215B08CA80048680F /* Twitter.xcdatamodel */,
+ F8874F2215B08CA80048680F /* AppDotNet.xcdatamodel */,
);
- currentVersion = F8874F2215B08CA80048680F /* Twitter.xcdatamodel */;
- path = Twitter.xcdatamodeld;
+ currentVersion = F8874F2215B08CA80048680F /* AppDotNet.xcdatamodel */;
+ path = AppDotNet.xcdatamodeld;
sourceTree = SOURCE_ROOT;
versionGroupType = wrapper.xcdatamodel;
};
View
0 ...ject.xcworkspace/contents.xcworkspacedata → ...ject.xcworkspace/contents.xcworkspacedata
File renamed without changes.
View
14 Examples/Twitter Client/AppDelegate.m
@@ -21,8 +21,8 @@
// THE SOFTWARE.
#import "AppDelegate.h"
-#import "TwitterIncrementalStore.h"
-#import "PublicTimelineViewController.h"
+#import "AppDotNetIncrementalStore.h"
+#import "GlobalStreamViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@@ -37,7 +37,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
- PublicTimelineViewController *viewController = [[PublicTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
+ GlobalStreamViewController *viewController = [[GlobalStreamViewController alloc] initWithStyle:UITableViewStylePlain];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
@@ -91,7 +91,7 @@ - (NSManagedObjectModel *)managedObjectModel
return __managedObjectModel;
}
- NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Twitter" withExtension:@"momd"];
+ NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"AppDotNet" withExtension:@"momd"];
__managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
return __managedObjectModel;
@@ -106,9 +106,9 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
__persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
- AFIncrementalStore *incrementalStore = (AFIncrementalStore *)[__persistentStoreCoordinator addPersistentStoreWithType:[TwitterIncrementalStore type] configuration:nil URL:nil options:nil error:nil];
+ AFIncrementalStore *incrementalStore = (AFIncrementalStore *)[__persistentStoreCoordinator addPersistentStoreWithType:[AppDotNetIncrementalStore type] configuration:nil URL:nil options:nil error:nil];
- NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Twitter.sqlite"];
+ NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"AppDotNet.sqlite"];
NSDictionary *options = @{
NSInferMappingModelAutomaticallyOption : @(YES),
@@ -121,7 +121,7 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
abort();
}
- NSLog(@"SQLite URL: %@", [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Twitter.sqlite"]);
+ NSLog(@"SQLite URL: %@", storeURL);
return __persistentStoreCoordinator;
}
View
2 ...nt/Twitter.xcdatamodeld/.xccurrentversion → .../AppDotNet.xcdatamodeld/.xccurrentversion
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
- <string>Twitter.xcdatamodel</string>
+ <string>AppDotNet.xcdatamodel</string>
</dict>
</plist>
View
19 Examples/Twitter Client/AppDotNet.xcdatamodeld/AppDotNet.xcdatamodel/contents
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1810" systemVersion="12B19" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
+ <entity name="Post" syncable="YES">
+ <attribute name="createdAt" optional="YES" attributeType="Date" syncable="YES"/>
+ <attribute name="postID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
+ <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
+ <relationship name="user" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="User" inverseName="posts" inverseEntity="User" syncable="YES"/>
+ </entity>
+ <entity name="User" syncable="YES">
+ <attribute name="avatarImageURLString" optional="YES" attributeType="String" syncable="YES"/>
+ <attribute name="userID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
+ <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
+ <relationship name="posts" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Post" inverseName="user" inverseEntity="Post" syncable="YES"/>
+ </entity>
+ <elements>
+ <element name="Post" positionX="0" positionY="0" width="128" height="105"/>
+ <element name="User" positionX="0" positionY="0" width="128" height="105"/>
+ </elements>
+</model>
View
4 ...Twitter Client/Classes/TwitterAPIClient.h → ...itter Client/Classes/AppDotNetAPIClient.h
@@ -23,8 +23,8 @@
#import "AFRESTClient.h"
#import "AFIncrementalStore.h"
-@interface TwitterAPIClient : AFRESTClient <AFIncrementalStoreHTTPClient>
+@interface AppDotNetAPIClient : AFRESTClient <AFIncrementalStoreHTTPClient>
-+ (TwitterAPIClient *)sharedClient;
++ (AppDotNetAPIClient *)sharedClient;
@end
View
26 ...Twitter Client/Classes/TwitterAPIClient.m → ...itter Client/Classes/AppDotNetAPIClient.m
@@ -20,17 +20,17 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#import "TwitterAPIClient.h"
+#import "AppDotNetAPIClient.h"
-static NSString * const kAFTwitterAPIBaseURLString = @"http://api.twitter.com/1/";
+static NSString * const kAFAppDotNetAPIBaseURLString = @"https://alpha-api.app.net/";
-@implementation TwitterAPIClient
+@implementation AppDotNetAPIClient
-+ (TwitterAPIClient *)sharedClient {
- static TwitterAPIClient *_sharedClient = nil;
++ (AppDotNetAPIClient *)sharedClient {
+ static AppDotNetAPIClient *_sharedClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
- _sharedClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:kAFTwitterAPIBaseURLString]];
+ _sharedClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:kAFAppDotNetAPIBaseURLString]];
});
return _sharedClient;
@@ -54,8 +54,8 @@ - (NSURLRequest *)requestForFetchRequest:(NSFetchRequest *)fetchRequest
withContext:(NSManagedObjectContext *)context
{
NSMutableURLRequest *mutableURLRequest = nil;
- if ([fetchRequest.entityName isEqualToString:@"Tweet"]) {
- mutableURLRequest = [self requestWithMethod:@"GET" path:@"statuses/public_timeline.json" parameters:nil];
+ if ([fetchRequest.entityName isEqualToString:@"Post"]) {
+ mutableURLRequest = [self requestWithMethod:@"GET" path:@"stream/0/posts/stream/global" parameters:nil];
}
return mutableURLRequest;
@@ -66,12 +66,12 @@ - (NSDictionary *)attributesForRepresentation:(NSDictionary *)representation
fromResponse:(NSHTTPURLResponse *)response
{
NSMutableDictionary *mutablePropertyValues = [[super attributesForRepresentation:representation ofEntity:entity fromResponse:response] mutableCopy];
- if ([entity.name isEqualToString:@"Tweet"]) {
- [mutablePropertyValues setValue:[representation valueForKey:@"id"] forKey:@"tweetID"];
+ if ([entity.name isEqualToString:@"Post"]) {
+ [mutablePropertyValues setValue:[NSNumber numberWithInteger:[[representation valueForKey:@"id"] integerValue]] forKey:@"postID"];
} else if ([entity.name isEqualToString:@"User"]) {
- [mutablePropertyValues setValue:[representation valueForKey:@"id"] forKey:@"userID"];
- [mutablePropertyValues setValue:[representation valueForKey:@"screen_name"] forKey:@"username"];
- [mutablePropertyValues setValue:[representation valueForKey:@"profile_image_url"] forKey:@"profileImageURLString"];
+ [mutablePropertyValues setValue:[NSNumber numberWithInteger:[[representation valueForKey:@"id"] integerValue]] forKey:@"userID"];
+ [mutablePropertyValues setValue:[representation valueForKey:@"username"] forKey:@"username"];
+ [mutablePropertyValues setValue:[representation valueForKeyPath:@"avatar_image.url"] forKey:@"avatarImageURLString"];
}
return mutablePropertyValues;
View
2 ... Client/Classes/TwitterIncrementalStore.h → ...lient/Classes/AppDotNetIncrementalStore.h
@@ -22,6 +22,6 @@
#import "AFIncrementalStore.h"
-@interface TwitterIncrementalStore : AFIncrementalStore
+@interface AppDotNetIncrementalStore : AFIncrementalStore
@end
View
10 ... Client/Classes/TwitterIncrementalStore.m → ...lient/Classes/AppDotNetIncrementalStore.m
@@ -20,10 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#import "TwitterIncrementalStore.h"
-#import "TwitterAPIClient.h"
+#import "AppDotNetIncrementalStore.h"
+#import "AppDotNetAPIClient.h"
-@implementation TwitterIncrementalStore
+@implementation AppDotNetIncrementalStore
+ (void)initialize {
[NSPersistentStoreCoordinator registerStoreClass:self forStoreType:[self type]];
@@ -34,11 +34,11 @@ + (NSString *)type {
}
+ (NSManagedObjectModel *)model {
- return [[NSManagedObjectModel alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"Twitter" withExtension:@"xcdatamodeld"]];
+ return [[NSManagedObjectModel alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"AppDotNet" withExtension:@"xcdatamodeld"]];
}
- (id<AFIncrementalStoreHTTPClient>)HTTPClient {
- return [TwitterAPIClient sharedClient];
+ return [AppDotNetAPIClient sharedClient];
}
@end
View
2 ...nt/Classes/PublicTimelineViewController.h → ...ient/Classes/GlobalStreamViewController.h
@@ -22,5 +22,5 @@
#import <UIKit/UIKit.h>
-@interface PublicTimelineViewController : UITableViewController
+@interface GlobalStreamViewController : UITableViewController
@end
View
24 ...nt/Classes/PublicTimelineViewController.m → ...ient/Classes/GlobalStreamViewController.m
@@ -21,24 +21,24 @@
// THE SOFTWARE.
#import <CoreData/CoreData.h>
-#import "PublicTimelineViewController.h"
+#import "GlobalStreamViewController.h"
-#import "Tweet.h"
+#import "Post.h"
#import "User.h"
-#import "TweetTableViewCell.h"
+#import "PostTableViewCell.h"
#import "UIImageView+AFNetworking.h"
-@interface PublicTimelineViewController () <NSFetchedResultsControllerDelegate> {
+@interface GlobalStreamViewController () <NSFetchedResultsControllerDelegate> {
NSFetchedResultsController *_fetchedResultsController;
}
- (void)refetchData;
@end
-@implementation PublicTimelineViewController
+@implementation GlobalStreamViewController
- (void)refetchData {
[_fetchedResultsController performSelectorOnMainThread:@selector(performFetch:) withObject:nil waitUntilDone:YES modes:@[ NSRunLoopCommonModes ]];
@@ -53,10 +53,10 @@ - (void)viewDidLoad {
self.tableView.rowHeight = 70.0f;
- NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Tweet"];
- fetchRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"tweetID" ascending:NO]];
+ NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Post"];
+ fetchRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"postID" ascending:NO]];
fetchRequest.fetchLimit = 50;
- _fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:[(id)[[UIApplication sharedApplication] delegate] managedObjectContext] sectionNameKeyPath:nil cacheName:@"PublicTimeline"];
+ _fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:[(id)[[UIApplication sharedApplication] delegate] managedObjectContext] sectionNameKeyPath:nil cacheName:@"GlobalStream"];
_fetchedResultsController.delegate = self;
[self refetchData];
@@ -76,9 +76,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
- TweetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ PostTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
- cell = [[TweetTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
+ cell = [[PostTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
[self configureCell:cell atIndexPath:indexPath];
@@ -90,7 +90,7 @@ - (void)configureCell:(UITableViewCell *)cell
atIndexPath:(NSIndexPath *)indexPath
{
@try {
- [(TweetTableViewCell *)cell setTweet:(Tweet *)[_fetchedResultsController objectAtIndexPath:indexPath]];
+ [(PostTableViewCell *)cell setPost:(Post *)[_fetchedResultsController objectAtIndexPath:indexPath]];
}
@catch (NSException *exception) {
NSLog(@"Exception: %@", exception);
@@ -100,7 +100,7 @@ - (void)configureCell:(UITableViewCell *)cell
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return [TweetTableViewCell heightForCellWithTweet:(Tweet *)[_fetchedResultsController objectAtIndexPath:indexPath]];
+ return [PostTableViewCell heightForCellWithPost:(Post *)[_fetchedResultsController objectAtIndexPath:indexPath]];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
View
35 Examples/Twitter Client/Classes/Post.h
@@ -0,0 +1,35 @@
+// Post.h
+//
+// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
+//
+// 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.
+
+#import <CoreData/CoreData.h>
+
+@class User;
+
+@interface Post : NSManagedObject
+
+@property NSNumber *postID;
+@property NSString *text;
+@property NSDate *createdAt;
+
+@property User *user;
+
+@end
View
33 Examples/Twitter Client/Classes/Post.m
@@ -0,0 +1,33 @@
+// Post.m
+//
+// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
+//
+// 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.
+
+#import "Post.h"
+
+@implementation Post
+
+@dynamic postID;
+@dynamic text;
+@dynamic createdAt;
+
+@dynamic user;
+
+@end
View
10 ...itter Client/Classes/TweetTableViewCell.h → ...witter Client/Classes/PostTableViewCell.h
@@ -1,4 +1,4 @@
-// TweetTableViewCell.h
+// PostTableViewCell.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
//
@@ -22,12 +22,12 @@
#import <UIKit/UIKit.h>
-@class Tweet;
+@class Post;
-@interface TweetTableViewCell : UITableViewCell
+@interface PostTableViewCell : UITableViewCell
-@property (nonatomic, strong) Tweet *tweet;
+@property (nonatomic, strong) Post *post;
-+ (CGFloat)heightForCellWithTweet:(Tweet *)tweet;
++ (CGFloat)heightForCellWithPost:(Post *)post;
@end
View
28 ...itter Client/Classes/TweetTableViewCell.m → ...witter Client/Classes/PostTableViewCell.m
@@ -1,4 +1,4 @@
-// TweetTableViewCell.m
+// PostTableViewCell.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
//
@@ -20,19 +20,19 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#import "TweetTableViewCell.h"
+#import "PostTableViewCell.h"
-#import "Tweet.h"
+#import "Post.h"
#import "User.h"
#import "UIImageView+AFNetworking.h"
-@implementation TweetTableViewCell {
+@implementation PostTableViewCell {
@private
- __strong Tweet *_tweet;
+ __strong Post *_post;
}
-@synthesize tweet = _tweet;
+@synthesize post = _post;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
@@ -49,18 +49,18 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
return self;
}
-- (void)setTweet:(Tweet *)tweet {
- _tweet = tweet;
+- (void)setPost:(Post *)post {
+ _post = post;
- self.textLabel.text = _tweet.user.username;
- self.detailTextLabel.text = _tweet.text;
- [self.imageView setImageWithURL:[NSURL URLWithString:_tweet.user.profileImageURLString] placeholderImage:[UIImage imageNamed:@"profile-image-placeholder"]];
+ self.textLabel.text = _post.user.username;
+ self.detailTextLabel.text = _post.text;
+ [self.imageView setImageWithURL:[NSURL URLWithString:_post.user.avatarImageURLString] placeholderImage:[UIImage imageNamed:@"profile-image-placeholder"]];
[self setNeedsLayout];
}
-+ (CGFloat)heightForCellWithTweet:(Tweet *)tweet {
- CGSize sizeToFit = [tweet.text sizeWithFont:[UIFont systemFontOfSize:12.0f] constrainedToSize:CGSizeMake(220.0f, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap];
++ (CGFloat)heightForCellWithPost:(Post *)post {
+ CGSize sizeToFit = [post.text sizeWithFont:[UIFont systemFontOfSize:12.0f] constrainedToSize:CGSizeMake(220.0f, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap];
return fmaxf(70.0f, sizeToFit.height + 45.0f);
}
@@ -74,7 +74,7 @@ - (void)layoutSubviews {
self.textLabel.frame = CGRectMake(70.0f, 10.0f, 240.0f, 20.0f);
CGRect detailTextLabelFrame = CGRectOffset(self.textLabel.frame, 0.0f, 25.0f);
- detailTextLabelFrame.size.height = [[self class] heightForCellWithTweet:_tweet] - 45.0f;
+ detailTextLabelFrame.size.height = [[self class] heightForCellWithPost:_post] - 45.0f;
self.detailTextLabel.frame = detailTextLabelFrame;
}
View
21 Examples/Twitter Client/Classes/Tweet.h
@@ -1,21 +0,0 @@
-//
-// Tweet.h
-// Incremental Twitter Example
-//
-// Created by Mattt Thompson on 2012/08/13.
-//
-//
-
-#import <CoreData/CoreData.h>
-
-@class User;
-
-@interface Tweet : NSManagedObject
-
-@property NSNumber *tweetID;
-@property NSString *text;
-@property NSDate *createdAt;
-
-@property User *user;
-
-@end
View
19 Examples/Twitter Client/Classes/Tweet.m
@@ -1,19 +0,0 @@
-//
-// Tweet.m
-// Incremental Twitter Example
-//
-// Created by Mattt Thompson on 2012/08/13.
-//
-//
-
-#import "Tweet.h"
-
-@implementation Tweet
-
-@dynamic tweetID;
-@dynamic text;
-
-@dynamic user;
-@dynamic createdAt;
-
-@end
View
24 Examples/Twitter Client/Classes/User.h
@@ -1,19 +1,33 @@
+// User.h
//
-// User.h
-// Incremental Twitter Example
+// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
//
-// Created by Mattt Thompson on 2012/08/13.
+// 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.
#import <CoreData/CoreData.h>
@interface User : NSManagedObject
@property NSNumber *userID;
@property NSString *username;
-@property NSString *profileImageURLString;
+@property NSString *avatarImageURLString;
-@property NSSet *tweets;
+@property NSSet *posts;
@end
View
24 Examples/Twitter Client/Classes/User.m
@@ -1,19 +1,33 @@
+// User.m
//
-// User.m
-// Incremental Twitter Example
+// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
//
-// Created by Mattt Thompson on 2012/08/13.
+// 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.
#import "User.h"
@implementation User
@dynamic userID;
@dynamic username;
-@dynamic profileImageURLString;
+@dynamic avatarImageURLString;
-@dynamic tweets;
+@dynamic posts;
@end
View
2 Examples/Twitter Client/Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.alamofire.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.alamofire.afincrementalstore.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
View
19 Examples/Twitter Client/Twitter.xcdatamodeld/Twitter.xcdatamodel/contents
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1487" systemVersion="12A269" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
- <entity name="Tweet" syncable="YES">
- <attribute name="createdAt" optional="YES" attributeType="Date" syncable="YES"/>
- <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
- <attribute name="tweetID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
- <relationship name="user" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="User" inverseName="tweets" inverseEntity="User" syncable="YES"/>
- </entity>
- <entity name="User" syncable="YES">
- <attribute name="profileImageURLString" optional="YES" attributeType="String" syncable="YES"/>
- <attribute name="userID" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
- <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
- <relationship name="tweets" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Tweet" inverseName="user" inverseEntity="Tweet" syncable="YES"/>
- </entity>
- <elements>
- <element name="Tweet" positionX="160" positionY="192" width="128" height="105"/>
- <element name="User" positionX="-99" positionY="192" width="128" height="105"/>
- </elements>
-</model>

0 comments on commit b138589

Please sign in to comment.
Something went wrong with that request. Please try again.