代码拉取完成,页面将自动刷新
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>源码理解 · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="Code-management.html" />
<link rel="prev" href="Performance-optimization.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
关于
</a>
</li>
<li class="header">Part I</li>
<li class="chapter " data-level="2.1" data-path="Data-structure.html">
<a href="Data-structure.html">
数据结构
</a>
</li>
<li class="chapter " data-level="2.2" data-path="Arithmetic.html">
<a href="Arithmetic.html">
算法
</a>
</li>
<li class="header">Part II</li>
<li class="chapter " data-level="3.1" data-path="Foundation.html">
<a href="Foundation.html">
Foundation
</a>
</li>
<li class="chapter " data-level="3.2" data-path="UIKit.html">
<a href="UIKit.html">
UIKit
</a>
</li>
<li class="chapter " data-level="3.3" data-path="WebView.html">
<a href="WebView.html">
WebView
</a>
</li>
<li class="chapter " data-level="3.4" data-path="Memory-management.html">
<a href="Memory-management.html">
内存管理
</a>
</li>
<li class="chapter " data-level="3.5" data-path="Message-passing.html">
<a href="Message-passing.html">
消息传递的方式
</a>
</li>
<li class="chapter " data-level="3.6" data-path="Network.html">
<a href="Network.html">
网络
</a>
</li>
<li class="chapter " data-level="3.7" data-path="Data-storage.html">
<a href="Data-storage.html">
数据存储
</a>
</li>
<li class="chapter " data-level="3.8" data-path="Multi-thread.html">
<a href="Multi-thread.html">
多线程
</a>
</li>
<li class="chapter " data-level="3.9" data-path="Animation.html">
<a href="Animation.html">
动画
</a>
</li>
<li class="chapter " data-level="3.10" data-path="Image-processing.html">
<a href="Image-processing.html">
图像处理
</a>
</li>
<li class="chapter " data-level="3.11" data-path="Data-encryption.html">
<a href="Data-encryption.html">
数据安全及加密
</a>
</li>
<li class="chapter " data-level="3.12" data-path="Runtime.html">
<a href="Runtime.html">
Runtime
</a>
</li>
<li class="chapter " data-level="3.13" data-path="Runloop.html">
<a href="Runloop.html">
Runloop
</a>
</li>
<li class="header">Part III</li>
<li class="chapter " data-level="4.1" data-path="Project-organization.html">
<a href="Project-organization.html">
项目架构
</a>
</li>
<li class="chapter " data-level="4.2" data-path="Design-patterns.html">
<a href="Design-patterns.html">
设计模式
</a>
</li>
<li class="chapter " data-level="4.3" data-path="Component-based.html">
<a href="Component-based.html">
组件化
</a>
</li>
<li class="chapter " data-level="4.4" data-path="Debug-tips.html">
<a href="Debug-tips.html">
调试技巧
</a>
</li>
<li class="chapter " data-level="4.5" data-path="Performance-optimization.html">
<a href="Performance-optimization.html">
性能优化
</a>
</li>
<li class="chapter active" data-level="4.6" data-path="Source-code.html">
<a href="Source-code.html">
源码理解
</a>
</li>
<li class="chapter " data-level="4.7" data-path="Code-management.html">
<a href="Code-management.html">
代码管理
</a>
</li>
<li class="chapter " data-level="4.8" data-path="Continuous-integration.html">
<a href="Continuous-integration.html">
持续集成
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >源码理解</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="源码理解">源码理解</h1>
<h2 id="1yykit">1.YYKit</h2>
<p>YYKit 是一组庞大、功能丰富的 iOS 组件。</p>
<p>我们需要从组件架构,源码,设计思路,解决问题的方案策略等多方面去学习。</p>
<h2 id="2sdwebimage加载图片过程">2.SDWebImage加载图片过程</h2>
<ul>
<li><p>0、首先显示占位图</p>
</li>
<li><p>1、在webimagecache中寻找图片对应的缓存,它是以url为数据索引先在内存中查找是否有缓存;</p>
</li>
<li><p>2、如果没有缓存,就通过md5处理过的key来在磁盘中查找对应的数据,如果找到就会把磁盘中的数据加到内存中,并显示出来;</p>
</li>
<li><p>3、如果内存和磁盘中都没有找到,就会向远程服务器发送请求,开始下载图片;</p>
</li>
<li><p>4、下载完的图片加入缓存中,并写入到磁盘中;</p>
</li>
<li><p>5、整个获取图片的过程是在子线程中进行,在主线程中显示。</p>
</li>
</ul>
<h2 id="3yywebimage和sdwebimage对比">3.YYWebImage和SDWebImage对比</h2>
<p>。。。</p>
<h2 id="4afnetworking-底层原理分析">4.AFNetworking 底层原理分析</h2>
<p>AFNetworking是封装的NSURLSession的网络请求,由五个模块组成:分别由NSURLSession,Security,Reachability,Serialization,UIKit五部分组成</p>
<ul>
<li><p>NSURLSession:网络通信模块(核心模块) 对应 AFNetworking中的 AFURLSessionManager和对HTTP协议进行特化处理的AFHTTPSessionManager,AFHTTPSessionManager是继承于AFURLSessionmanager的</p>
</li>
<li><p>Security:网络通讯安全策略模块 对应 AFSecurityPolicy</p>
</li>
<li><p>Reachability:网络状态监听模块 对应AFNetworkReachabilityManager</p>
</li>
<li><p>Seriaalization:网络通信信息序列化、反序列化模块 对应 AFURLResponseSerialization</p>
</li>
<li><p>UIKit:对于iOS UIKit的扩展库</p>
</li>
</ul>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="Performance-optimization.html" class="navigation navigation-prev " aria-label="Previous page: 性能优化">
<i class="fa fa-angle-left"></i>
</a>
<a href="Code-management.html" class="navigation navigation-next " aria-label="Next page: 代码管理">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"源码理解","level":"4.6","depth":1,"next":{"title":"代码管理","level":"4.7","depth":1,"path":"Code-management.md","ref":"Code-management.md","articles":[]},"previous":{"title":"性能优化","level":"4.5","depth":1,"path":"Performance-optimization.md","ref":"Performance-optimization.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Source-code.md","mtime":"2020-04-13T10:23:32.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-27T09:12:21.691Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。