Skip to content

Commit 1ecf07f

Browse files
committed
demo project
1 parent 71a5217 commit 1ecf07f

File tree

97 files changed

+3694
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3694
-78
lines changed

Demo/Demo.gif

228 KB
Loading

Demo/YYWebImageDemo.xcodeproj/project.pbxproj

Lines changed: 623 additions & 0 deletions
Large diffs are not rendered by default.

Demo/YYWebImageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "2B63CCF71525A271478FBA0FCECF929E60AF80A6",
3+
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4+
5+
},
6+
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
7+
"2B63CCF71525A271478FBA0FCECF929E60AF80A6" : 0,
8+
"7D036270E758B4C9CAAD42288C450F2518AF5495" : 0
9+
},
10+
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "C206B33E-2BB5-4703-A85A-81C8A02DF852",
11+
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
12+
"2B63CCF71525A271478FBA0FCECF929E60AF80A6" : "YYWebImage\/",
13+
"7D036270E758B4C9CAAD42288C450F2518AF5495" : "YYImage\/"
14+
},
15+
"DVTSourceControlWorkspaceBlueprintNameKey" : "YYWebImageDemo",
16+
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
17+
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Demo\/YYWebImageDemo.xcodeproj",
18+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
19+
{
20+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/ibireme\/YYWebImage.git",
21+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
22+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "2B63CCF71525A271478FBA0FCECF929E60AF80A6"
23+
},
24+
{
25+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/ibireme\/YYImage.git",
26+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
27+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "7D036270E758B4C9CAAD42288C450F2518AF5495"
28+
}
29+
]
30+
}

Demo/YYWebImageDemo/AppDelegate.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AppDelegate.h
3+
// YYWebImageDemo
4+
//
5+
// Created by guoyaoyuan on 15/10/30.
6+
// Copyright © 2015年 ibireme. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
12+
13+
@property (strong, nonatomic) UIWindow *window;
14+
15+
16+
@end
17+

Demo/YYWebImageDemo/AppDelegate.m

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// AppDelegate.m
3+
// YYWebImageDemo
4+
//
5+
// Created by guoyaoyuan on 15/10/30.
6+
// Copyright © 2015年 ibireme. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
@interface AppDelegate ()
12+
13+
@end
14+
15+
@implementation AppDelegate
16+
17+
18+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19+
// Override point for customization after application launch.
20+
return YES;
21+
}
22+
23+
- (void)applicationWillResignActive:(UIApplication *)application {
24+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25+
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26+
}
27+
28+
- (void)applicationDidEnterBackground:(UIApplication *)application {
29+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31+
}
32+
33+
- (void)applicationWillEnterForeground:(UIApplication *)application {
34+
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35+
}
36+
37+
- (void)applicationDidBecomeActive:(UIApplication *)application {
38+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39+
}
40+
41+
- (void)applicationWillTerminate:(UIApplication *)application {
42+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43+
}
44+
45+
@end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "29x29",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "40x40",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "40x40",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "60x60",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "60x60",
31+
"scale" : "3x"
32+
}
33+
],
34+
"info" : {
35+
"version" : 1,
36+
"author" : "xcode"
37+
}
38+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<animations/>
20+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
</view>
22+
</viewController>
23+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
24+
</objects>
25+
<point key="canvasLocation" x="53" y="375"/>
26+
</scene>
27+
</scenes>
28+
</document>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="tne-QT-ifu">
10+
<objects>
11+
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<animations/>
20+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
</view>
22+
</viewController>
23+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
24+
</objects>
25+
</scene>
26+
</scenes>
27+
</document>

Demo/YYWebImageDemo/CALayer+YYAdd.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//
2+
// CALayer+YYAdd.h
3+
// YYKit <https://github.com/ibireme/YYKit>
4+
//
5+
// Created by ibireme on 14/5/10.
6+
// Copyright (c) 2015 ibireme.
7+
//
8+
// This source code is licensed under the MIT-style license found in the
9+
// LICENSE file in the root directory of this source tree.
10+
//
11+
12+
#import <UIKit/UIKit.h>
13+
#import <QuartzCore/QuartzCore.h>
14+
15+
/**
16+
Provides extensions for `CALayer`.
17+
*/
18+
@interface CALayer (YYAdd)
19+
20+
/**
21+
Take snapshot without transform, image's size equals to bounds.
22+
*/
23+
- (UIImage *)snapshotImage;
24+
25+
/**
26+
Shortcut to set the layer's shadow
27+
28+
@param color Shadow Color
29+
@param offset Shadow offset
30+
@param radius Shadow radius
31+
*/
32+
- (void)setLayerShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;
33+
34+
/**
35+
Remove all sublayers.
36+
*/
37+
- (void)removeAllSublayers;
38+
39+
@property (nonatomic) CGFloat left; ///< Shortcut for frame.origin.x.
40+
@property (nonatomic) CGFloat top; ///< Shortcut for frame.origin.y
41+
@property (nonatomic) CGFloat right; ///< Shortcut for frame.origin.x + frame.size.width
42+
@property (nonatomic) CGFloat bottom; ///< Shortcut for frame.origin.y + frame.size.height
43+
@property (nonatomic) CGFloat width; ///< Shortcut for frame.size.width.
44+
@property (nonatomic) CGFloat height; ///< Shortcut for frame.size.height.
45+
@property (nonatomic) CGPoint center; ///< Shortcut for center.
46+
@property (nonatomic) CGFloat centerX; ///< Shortcut for center.x
47+
@property (nonatomic) CGFloat centerY; ///< Shortcut for center.y
48+
@property (nonatomic) CGPoint origin; ///< Shortcut for frame.origin.
49+
@property (nonatomic, getter=frameSize, setter=setFrameSize:) CGSize size; ///< Shortcut for frame.size.
50+
51+
52+
@property (nonatomic) CGFloat transformRotation; ///< key path "tranform.rotation"
53+
@property (nonatomic) CGFloat transformRotationX; ///< key path "tranform.rotation.x"
54+
@property (nonatomic) CGFloat transformRotationY; ///< key path "tranform.rotation.y"
55+
@property (nonatomic) CGFloat transformRotationZ; ///< key path "tranform.rotation.z"
56+
@property (nonatomic) CGFloat transformScale; ///< key path "tranform.scale"
57+
@property (nonatomic) CGFloat transformScaleX; ///< key path "tranform.scale.x"
58+
@property (nonatomic) CGFloat transformScaleY; ///< key path "tranform.scale.y"
59+
@property (nonatomic) CGFloat transformScaleZ; ///< key path "tranform.scale.z"
60+
@property (nonatomic) CGFloat transformTranslationX; ///< key path "tranform.translation.x"
61+
@property (nonatomic) CGFloat transformTranslationY; ///< key path "tranform.translation.y"
62+
@property (nonatomic) CGFloat transformTranslationZ; ///< key path "tranform.translation.z"
63+
64+
/**
65+
Shortcut for transform.m34, -1/1000 is a good value.
66+
It should be set before other transform shortcut.
67+
*/
68+
@property (nonatomic, assign) CGFloat transformDepth;
69+
70+
/**
71+
Add a fade animation to layer's contents when the contents is changed.
72+
73+
@param duration Animation duration
74+
@param curve Animation curve.
75+
*/
76+
- (void)addFadeAnimationWithDuration:(NSTimeInterval)duration curve:(UIViewAnimationCurve)curve;
77+
78+
/**
79+
Cancel fade animation which is added with "-addFadeAnimationWithDuration:curve:".
80+
*/
81+
- (void)removePreviousFadeAnimation;
82+
83+
@end

0 commit comments

Comments
 (0)