Skip to content
Open

nm #6

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
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/VZ.xcworkspace/xcshareddata/VZ.xccheckout
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
!default.xcworkspace
xcuserdata
*.moved-aside
*.mobileprovision
DerivedData
.idea/
# Pods - for those of you who use CocoaPods
Pods
Podfile.lock
13 changes: 6 additions & 7 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
platform :ios, "5.0"
platform :ios, "7.0"

target 'VZ' do
pod 'AVOSCloud', :podspec => 'https://download.avoscloud.com/sdk/iOS/current/AVOSCloud.podspec'
pod 'AVOSCloudSNS', :podspec => 'https://download.avoscloud.com/sdk/iOS/current/AVOSCloudSNS.podspec'

pod 'SIAlertView'
pod 'MMDrawerController'

pod 'AVOSCloud', '3.0.3'
pod 'AVOSCloudSNS', '3.0.3'
pod 'SIAlertView', '1.3'
pod 'MMDrawerController', '0.6.0'
pod 'SDWebImage', '3.7.2'
end

15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

微转是一个基于微博的数码设备平台, 客户端和后台全部基于AVOSCloud服务实现

后台源码地址: [https://github.com/trawor/VZ_Server](https://github.com/trawor/VZ_Server)
![vz4](https://cloud.githubusercontent.com/assets/5022872/7332291/dda0b15c-eb6a-11e4-901a-b1e899382511.gif)

后台源码地址: [https://github.com/avoscloud/VZ_Server](https://github.com/avoscloud/VZ_Server)

AppStore地址: [https://itunes.apple.com/cn/app/wei-zhuan/id768074220?mt=8](https://itunes.apple.com/cn/app/wei-zhuan/id768074220?mt=8)

Expand All @@ -16,14 +18,3 @@ AppStore地址: [https://itunes.apple.com/cn/app/wei-zhuan/id768074220?mt=8](htt
3. 用Xcode打开workspace文件编译并运行

----

###部分截图:

![image](http://a2.mzstatic.com/us/r30/Purple6/v4/21/41/90/21419003-2730-71c0-d9bb-383191acabd1/screen568x568.jpeg)

![image](http://a5.mzstatic.com/us/r30/Purple/v4/83/b6/4a/83b64ae6-ed48-45e5-957c-09a925bb40e3/screen568x568.jpeg)

![image](http://a1.mzstatic.com/us/r30/Purple6/v4/91/ed/ea/91edead0-707a-57e1-9168-279d621a4206/screen568x568.jpeg)

![image](http://a2.mzstatic.com/us/r30/Purple/v4/4f/26/f8/4f26f8b8-dffd-becf-c6ef-bc3315214910/screen568x568.jpeg)

2,909 changes: 2,248 additions & 661 deletions VZ.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions VZ.xcodeproj/project.xcworkspace/xcshareddata/VZ.xccheckout
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>2A7DABDC-95CC-4BC3-9323-5844A39BB99F</string>
<key>IDESourceControlProjectName</key>
<string>VZ</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</key>
<string>github.com:leancloud/VZ.git</string>
<key>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</key>
<string>github.com:avoscloud/avoscloud-demo.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>VZ.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</key>
<string>../..</string>
<key>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:leancloud/VZ.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</string>
<key>IDESourceControlWCCName</key>
<string></string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</string>
<key>IDESourceControlWCCName</key>
<string>VZ</string>
</dict>
</array>
</dict>
</plist>
53 changes: 53 additions & 0 deletions VZ.xcworkspace/xcshareddata/VZ.xccheckout
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>449A3441-DCE2-4F6D-A578-5ED45E1CE56B</string>
<key>IDESourceControlProjectName</key>
<string>VZ</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</key>
<string>github.com:leancloud/VZ.git</string>
<key>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</key>
<string>github.com:avoscloud/avoscloud-demo.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>VZ.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</key>
<string>..</string>
<key>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:leancloud/VZ.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>8ACFE5037BBA7C3DB34C943CA65881B264CE6E1A</string>
<key>IDESourceControlWCCName</key>
<string></string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4C46BAA9091622296DEC91B8E5EA5B4512A1C7C7</string>
<key>IDESourceControlWCCName</key>
<string>VZ</string>
</dict>
</array>
</dict>
</plist>
2 changes: 0 additions & 2 deletions VZ/VZAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
clientKey:@"4es7zmmqsx0xarkp7svkwady8eaipwdz83c2mccoi0z15358"];

[AVOSCloud setLastModifyEnabled:YES];
[AVAnalytics setCrashReportEnabled:YES];


UIStoryboard *board=[UIStoryboard storyboardWithName:@"iPhone" bundle:Nil];

Expand Down
1 change: 1 addition & 0 deletions VZ/VZM.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ - (id)init
}
-(void)login:(AVUserResultBlock)callback{
[AVOSCloudSNS setupPlatform:AVOSCloudSNSSinaWeibo withAppKey:@"2858658895" andAppSecret:@"9d97c1cce2893cbdcdc970f05bc55fe4" andRedirectURI:@"http://vz.avosapps.com/oauth?type=weibo"];
//[AVOSCloudSNS setupPlatform:AVOSCloudSNSSinaWeibo withAppKey:@"507847323" andAppSecret:@"e5504788d22dac7db56100d3fd6becf0" andRedirectURI:@"http://vz.avosapps.com/oauth?type=weibo"];
//[AVOSCloudSNS setupPlatform:AVOSCloudSNSSinaWeibo withAppKey:@"31024382" andAppSecret:@"25c3e6b5763653d1e5b280884b45c51f" andRedirectURI:@"http://"];

[AVOSCloudSNS loginWithCallback:^(NSDictionary* object, NSError *error) {
Expand Down
1 change: 1 addition & 0 deletions VZ/VZMenuC.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import <UIViewController+MMDrawerController.h>
#import <SIAlertView/SIAlertView.h>
#import <AVOSCloudSNS/AVUser+SNS.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import "VZNearC.h"

#import "VZStatusListC.h"
Expand Down
1 change: 1 addition & 0 deletions VZ/VZNearC.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import <AVOSCloud/AVJSONRequestOperation.h>
#import "VZProgressView.h"
#import "VZPostViewC.h"
#import <SDWebImage/UIImageView+WebCache.h>

@interface VZNearC (){
BOOL gotUserLocation;
Expand Down
3 changes: 1 addition & 2 deletions VZ/VZPostCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

@interface UIImageView(Progress)

- (void)setProgressImageWithURLRequest:(NSURLRequest *)urlRequest
placeholderImage:(UIImage *)placeholderImage;
-(void)setProgressImageWithUrl:(NSString*)url placeholderImage:(UIImage*)placeholderImage;

@end

Expand Down
80 changes: 25 additions & 55 deletions VZ/VZPostCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,43 @@
//

#import "VZPostCell.h"
#import <AVOSCloud/AVImageRequestOperation.h>

@interface AFImageCache : NSCache
- (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
- (void)cacheImage:(UIImage *)image
forRequest:(NSURLRequest *)request;
@end

#pragma mark -

@interface UIImageView ()
@property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AVImageRequestOperation *af_imageRequestOperation;
+ (AFImageCache *)af_sharedImageCache;
+(NSOperationQueue*)af_sharedImageRequestOperationQueue;
@end
#import <AVOSCloud/AVOSCloud.h>

#define avatarFrame CGRectMake(8,17,50,50)


@implementation UIImageView(Progress)

- (void)setProgressImageWithURLRequest:(NSURLRequest *)urlRequest
placeholderImage:(UIImage *)placeholderImage

{
[self cancelImageRequestOperation];
-(void)setProgressImageWithUrl:(NSString*)url placeholderImage:(UIImage*)placeholderImage{
//[self cancelImageRequestOperation];
[[self viewWithTag:1000] removeFromSuperview];

UIImage *cachedImage = [[[self class] af_sharedImageCache] cachedImageForRequest:urlRequest];
if (cachedImage) {
self.image = cachedImage;
self.af_imageRequestOperation = nil;
self.image = cachedImage;
} else {
self.image = placeholderImage;

AVImageRequestOperation *requestOperation = [[AVImageRequestOperation alloc] initWithRequest:urlRequest];

requestOperation.queuePriority=NSOperationQueuePriorityLow;
AVFile* file=[AVFile fileWithURL:url];
BOOL hasData=[file isDataAvailable];
if(hasData){
NSData* data=[file getData];
UIImage* image=[UIImage imageWithData:data];
self.image=image;
}else{
self.image=placeholderImage;

VZProgressView *pv=[[VZProgressView alloc] initWithWidth:self.frame.size.width/2];
pv.bgLineColor=[UIColor colorWithWhite:1 alpha:0.4];
pv.fgLineColor=[UIColor whiteColor];
pv.tag=1000;

[requestOperation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
float progress=totalBytesRead*1.0/totalBytesExpectedToRead;
pv.progress=progress;
}];

pv.bgLineColor=[UIColor colorWithWhite:1 alpha:0.4];
pv.fgLineColor=[UIColor whiteColor];
pv.tag=1000;
[self addSubview:pv];

[requestOperation setCompletionBlockWithSuccess:^(AVHTTPRequestOperation *operation, id responseObject) {
if ([[urlRequest URL] isEqual:[[self.af_imageRequestOperation request] URL]]) {
self.image = responseObject;
[file getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if(error){
[pv removeFromSuperview];
}else{
UIImage* image=[UIImage imageWithData:data];
self.image=image;
[pv removeFromSuperview];
self.af_imageRequestOperation = nil;

}

[[[self class] af_sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
} failure:^(AVHTTPRequestOperation *operation, NSError *error) {
[pv removeFromSuperview];
} progressBlock:^(NSInteger percentDone) {
pv.progress=percentDone;
}];

self.af_imageRequestOperation = requestOperation;

[[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation];
}
}
@end
Expand Down Expand Up @@ -101,7 +71,7 @@ -(void)loadPhoto{
NSString *url=pics[0];
url=[url stringByReplacingOccurrencesOfString:@"thumbnail" withString:@"bmiddle"];

[self.photo setProgressImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]] placeholderImage:[UIImage imageNamed:nil]];
[self.photo setProgressImageWithUrl:url placeholderImage:[UIImage imageNamed:nil]];
}

int c=pics.count;
Expand All @@ -115,7 +85,7 @@ -(void)loadPhoto{

}
-(void)stopLoadPhoto{
[self.photo cancelImageRequestOperation];
//[self.photo cancelImageRequestOperation];
}

-(void)awakeFromNib{
Expand Down
2 changes: 2 additions & 0 deletions VZ/VZPostListC.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#import "VZNavView.h"
#import "VZSearchBar.h"

#import <SDWebImage/UIImageView+WebCache.h>


#import <AVOSCloud/AVGlobal.h>

Expand Down
1 change: 1 addition & 0 deletions VZ/VZPostViewC.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "VZPostViewC.h"
#import <AVOSCloud/AVImageRequestOperation.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import <UIViewController+MMDrawerController.h>

#import "VZCommentCell.h"
Expand Down