Skip to content

Commit

Permalink
Folder of the whole code
Browse files Browse the repository at this point in the history
  • Loading branch information
KittenYang committed Dec 18, 2014
1 parent 0b0aa2c commit 7da3b8a
Show file tree
Hide file tree
Showing 954 changed files with 33,679 additions and 0 deletions.
17 changes: 17 additions & 0 deletions KittenYang/BaseModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// BaseModel.h
// KittenYang
//
// Created by Kitten Yang on 14-7-21.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BaseModel : NSObject{

}



@end
13 changes: 13 additions & 0 deletions KittenYang/BaseModel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BaseModel.m
// KittenYang
//
// Created by Kitten Yang on 14-7-21.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

@end
15 changes: 15 additions & 0 deletions KittenYang/BrowseModeController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// BrowseModeController.h
// KittenYang
//
// Created by Kitten Yang on 14-8-14.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "BaseViewController.h"

@interface BrowseModeController :BaseViewController<UITableViewDataSource,UITableViewDelegate>;

@property (strong, nonatomic) IBOutlet UITableView *tableView;

@end
86 changes: 86 additions & 0 deletions KittenYang/BrowseModeController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// BrowseModeController.m
// KittenYang
//
// Created by Kitten Yang on 14-8-14.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "BrowseModeController.h"
#import "CONSTS.h"

@interface BrowseModeController ()

@end

@implementation BrowseModeController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = @"图片浏览模式";
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}


#pragma mark - UITableView delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 2;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

static NSString *identify = @"themeCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];
}
if (indexPath.row == 0) {
cell.textLabel.text = @"大图";
cell.detailTextLabel.text = @"所有网络加载大图";
}else if (indexPath.row == 1){
cell.textLabel.text = @"小图";
cell.detailTextLabel.text = @"所有网络加载小图";
}

return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
int mode = -1;
if (indexPath.row == 0) {
mode = LargeBrowseMode;
}else if(indexPath.row == 1){
mode = SmallBrowseMode;
}

//将浏览模式存储到本地
[[NSUserDefaults standardUserDefaults]setInteger:mode forKey:kBrowseMode];
[[NSUserDefaults standardUserDefaults]synchronize];

//发送刷新微博的通知
[[NSNotificationCenter defaultCenter]postNotificationName:kReloadWeiboNotification object:nil];

[self.navigationController popViewControllerAnimated:YES];

}



@end
32 changes: 32 additions & 0 deletions KittenYang/BrowseModeController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BrowseModeController">
<connections>
<outlet property="tableView" destination="hvD-cg-J3j" id="7wh-ov-cuW"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="hvD-cg-J3j">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="QTI-vM-sOR"/>
<outlet property="delegate" destination="-1" id="QKL-uE-tLR"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
</view>
</objects>
</document>
28 changes: 28 additions & 0 deletions KittenYang/CommentModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// CommentModel.h
// KittenYang
//
// Created by Kitten Yang on 14-8-12.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "WeiboModel.h"
#import "UserModel.h"

//评论返回的数据


@interface CommentModel : NSObject

@property(nonatomic,copy)NSString *created_at;
@property(nonatomic,retain)NSNumber *weiboId;
@property(nonatomic,copy)NSString *text;
@property(nonatomic,copy)NSString *source;
@property(nonatomic,copy)NSString *mid;
@property(nonatomic,copy)NSString *idstr;
@property(nonatomic,retain)UserModel *user;
@property(nonatomic,retain)WeiboModel *weibo;

-(id)initWithCommentDataDic:(NSDictionary*)data;

@end
44 changes: 44 additions & 0 deletions KittenYang/CommentModel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// CommentModel.m
// KittenYang
//
// Created by Kitten Yang on 14-8-12.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "CommentModel.h"

@implementation CommentModel
-(id)initWithCommentDataDic:(NSDictionary*)data{
if (self = [super init]) {
[self setAttributes:data];
}
return self;
}


- (void)_initWithCmtDic:(NSDictionary *)dataDic{
self.created_at = [dataDic objectForKey:@"created_at"];
self.weiboId = [dataDic objectForKey:@"id"];
self.text = [dataDic objectForKey:@"text"];
self.source = [dataDic objectForKey:@"source"];
self.mid = [dataDic objectForKey:@"mid"];
self.idstr = [dataDic objectForKey:@"idstr"];
}

- (void)setAttributes:(NSDictionary *)dataDic {

[self _initWithCmtDic:dataDic];

NSDictionary *userDic = [dataDic objectForKey:@"user"];
NSDictionary *statusDic = [dataDic objectForKey:@"status"];

UserModel *user = [[UserModel alloc] initWithDataDic:userDic];
WeiboModel *weibo = [[WeiboModel alloc] initWithDataDic:statusDic];

self.user = user;
self.weibo = weibo;

}

@end
18 changes: 18 additions & 0 deletions KittenYang/DiscoverViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// DiscoverViewController.h
// KittenYang
//
// Created by Kitten Yang on 14-5-23.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "BaseViewController.h"

@interface DiscoverViewController : BaseViewController
@property (strong, nonatomic) IBOutlet UIButton *nearUser;
@property (strong, nonatomic) IBOutlet UIButton *nearWeibo;


- (IBAction)nearUser:(id)sender;
- (IBAction)nearWeibo:(id)sender;
@end
58 changes: 58 additions & 0 deletions KittenYang/DiscoverViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// DiscoverViewController.m
// KittenYang
//
// Created by Kitten Yang on 14-5-23.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "DiscoverViewController.h"
#import "NearWeiboMapViewController.h"

@interface DiscoverViewController ()

@end

@implementation DiscoverViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = @"广场";
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
for(int i= 100;i<=101;i++){
UIButton *button = (UIButton *)[self.view viewWithTag:i];
button.layer.shadowColor = [UIColor blackColor].CGColor;
button.layer.shadowOffset = CGSizeMake(2, 2); //阴影的大小
button.layer.shadowOpacity = 1; //不透明
button.layer.shadowRadius = 3;
}

}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidDisappear:(BOOL)animated{
UIButton *bt = [self.tabBarController.tabBar.subviews objectAtIndex:9];
bt.selected = NO;
}

- (IBAction)nearUser:(id)sender {

}

- (IBAction)nearWeibo:(id)sender {
NearWeiboMapViewController *nearWeibo = [[NearWeiboMapViewController alloc]init];
[self.navigationController pushViewController:nearWeibo animated:YES];
}
@end
48 changes: 48 additions & 0 deletions KittenYang/DiscoverViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DiscoverViewController">
<connections>
<outlet property="nearUser" destination="sZT-0y-Eod" id="USq-0l-VKf"/>
<outlet property="nearWeibo" destination="w4X-6H-fI9" id="8Qo-5I-8ee"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" tag="100" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sZT-0y-Eod">
<rect key="frame" x="33" y="86" width="70" height="70"/>
<state key="normal" image="附近的人.jpg">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="nearUser:" destination="-1" eventType="touchUpInside" id="wwT-cH-B4F"/>
</connections>
</button>
<button opaque="NO" tag="101" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w4X-6H-fI9">
<rect key="frame" x="147" y="86" width="70" height="70"/>
<state key="normal" image="附近微博.jpg">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="nearWeibo:" destination="-1" eventType="touchUpInside" id="cHK-nH-wwx"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<point key="canvasLocation" x="679" y="460"/>
</view>
</objects>
<resources>
<image name="附近微博.jpg" width="184" height="184"/>
<image name="附近的人.jpg" width="184" height="184"/>
</resources>
</document>
13 changes: 13 additions & 0 deletions KittenYang/FriendTableView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// FriendTableView.h
// KittenYang
//
// Created by Kitten Yang on 14/11/2.
// Copyright (c) 2014年 Kitten Yang. All rights reserved.
//

#import "BaseTableView.h"

@interface FriendTableView : BaseTableView<UITableViewDelegate>

@end
Loading

0 comments on commit 7da3b8a

Please sign in to comment.