Skip to content

Commit

Permalink
refs #整理可播放代码
Browse files Browse the repository at this point in the history
  • Loading branch information
lihongli committed Feb 17, 2017
1 parent aaf50fa commit 92e84f2
Show file tree
Hide file tree
Showing 377 changed files with 39,138 additions and 799 deletions.
Binary file modified .DS_Store
Binary file not shown.
114 changes: 97 additions & 17 deletions MVideo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions MVideo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog(@"%@", NSHomeDirectory());
return YES;
}

Expand Down
62 changes: 47 additions & 15 deletions MVideo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1713" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="FWr-cS-U44">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<!--主页-->
<scene sceneID="9aX-U4-Am2">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<tableViewController id="adz-j6-XHd" customClass="MHomeViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="j7g-yf-NJo">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="wTU-O5-3nx">
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wTU-O5-3nx" id="qnP-e8-WTG">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="adz-j6-XHd" id="18h-uT-bzs"/>
<outlet property="delegate" destination="adz-j6-XHd" id="FjF-ET-r3M"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="主页" id="smW-ve-1el"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7SQ-FU-uCP" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-570" y="-87"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="cjT-vK-k00">
<objects>
<navigationController id="FWr-cS-U44" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="sSe-wa-Q3d">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="adz-j6-XHd" kind="relationship" relationship="rootViewController" id="mBj-Ys-Vn0"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lYb-eW-mNV" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1522" y="-87"/>
</scene>
</scenes>
</document>
17 changes: 17 additions & 0 deletions MVideo/ListTableViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// ListTableViewCell.h
// MVideo
//
// Created by LHL on 17/2/15.
// Copyright © 2017年 LHL. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ListTableViewCell : UITableViewCell

@property (nonatomic, strong) UILabel *canPlayLabel;

- (void)checkIsCanPlay:(NSString *)url fileName:(NSString *)fileName;

@end
53 changes: 53 additions & 0 deletions MVideo/ListTableViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// ListTableViewCell.m
// MVideo
//
// Created by LHL on 17/2/15.
// Copyright © 2017年 LHL. All rights reserved.
//

#import "ListTableViewCell.h"

@implementation ListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleBlue;
[self createUI];
}
return self;
}

- (void)awakeFromNib {
[super awakeFromNib];
[self createUI];
}

- (void)createUI{
self.canPlayLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width - 50, 0, 50, 22)];
self.canPlayLabel.backgroundColor = [UIColor greenColor];
self.canPlayLabel.textAlignment = NSTextAlignmentCenter;
self.canPlayLabel.text = @"可播";
self.canPlayLabel.font = [UIFont systemFontOfSize:14];
self.canPlayLabel.hidden = YES;
[self addSubview:self.canPlayLabel];
}

- (void)checkIsCanPlay:(NSString *)url fileName:(NSString *)fileName{
NSDictionary *canPlaylistDict = [[NSUserDefaults standardUserDefaults] objectForKey:fileName];
NSString *tmpUrl = [canPlaylistDict objectForKey:url];
self.canPlayLabel.hidden = !tmpUrl;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

- (void)layoutSubviews{
[super layoutSubviews];
self.canPlayLabel.frame = CGRectMake(self.frame.size.width - 50, 0, 50, 22);
}

@end
5 changes: 3 additions & 2 deletions MVideo/ViewController.h → MVideo/ListViewController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// ViewController.h
// ListViewController.h
// MVideo
//
// Created by LiHongli on 16/6/18.
Expand All @@ -8,8 +8,9 @@

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController
@interface ListViewController : UIViewController

@property (nonatomic, strong) NSDictionary *dict;

@end

Loading

0 comments on commit 92e84f2

Please sign in to comment.