Skip to content

四号程序员

Keep It Simple and Stupid

  • Home
  • 读过的书
  • 从0到1实战微服务架构(第2版)

使用keyframe实现UIView的组合动画

Leave a reply

当我们需要组合多个UIView动画的时候,可以使用UIView.animate嵌套,也可以使用keyframe完成,这个是ios7+支持的。
self.badgeView.transform = CGAffineTransform(scaleX: 0.01, y: 0.01)
self.badgeView.alpha = 0
UIView.animateKeyframes(withDuration: 5, delay: 0.0, option[......]

继续阅读

This entry was posted in iOS and tagged ios, keyframe, 动画 on 2017-03-10 by coder4.

H5如何访问ios本地图片

Leave a reply

import UIKit

class NSLocalImageURLProtocol: URLProtocol {

static let schemaName = "myapp"

override class func canInit(with request: URLRequest) -> Bool {
if let schema = request.url?.scheme?.lowercased(),
sch[......]

继续阅读

This entry was posted in iOS and tagged H5, ios, 沙箱, 访问本地文件 on 2017-03-09 by coder4.

Swift中,如何等到多个回调都完成后再执行

Leave a reply

var myGroup = DispatchGroup()

override func viewDidLoad() {
super.viewDidLoad()

for i in 0 ..< 5 {
myGroup.enter()

Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"]).responseJSON { response[......]

继续阅读

This entry was posted in iOS and tagged swift, 回调, 等待 on 2017-03-08 by coder4.

Swift的Array如何过滤数组中的nil数据 - 用flatMap

Leave a reply

As of Swift 2.0, you don't need to write your own extension to filter nil values from an Array, you can use flatMap, which flattens the Array and filters nils:
let optionals : [String?] = ["a", "b", nil, "d"]
let nonOptionals = optionals.flatMap{$0[......]

继续阅读

This entry was posted in iOS and tagged ios, swift, 过滤nil on 2017-03-07 by coder4.

YYTextView与AutoLayout混用Demo

Leave a reply

import UIKit
import YYText
import SnapKit

class YYCell: UITableViewCell {

fileprivate static let fontSize: CGFloat = 24
fileprivate static let font = UIFont.systemFont(ofSize: YYCell.fontSize)

fileprivate lazy var wrapView: UI[......]

继续阅读

This entry was posted in iOS and tagged autolayout, YYTextView on 2017-03-03 by coder4.

Post navigation

← Older posts
Newer posts →

Categories

  • Android
  • C && C++
  • Go
  • iOS
  • Java
  • Linux
  • Mac
  • NLP
  • opencv
  • Perl
  • PHP
  • Python
  • RPC
  • Ruby
  • Visual C++ && C#
  • Windows
  • Wordpress
  • 前端技术
  • 大数据技术
  • 心情随笔
  • 搜索技术
  • 数据库技术
  • 未分类
  • 机器学习
  • 笔面题
  • 算法&数据结构
  • 网络&网络模拟
  • 计算机技术
  • 设计

Tags

  • Android
  • C
  • CentOS
  • c语言
  • Debian
  • docker
  • go
  • gtk
  • Hadoop
  • Hive
  • ios
  • Java && J2EE
  • Java && J2EE
  • Java核心技术
  • KVM
  • Linux
  • MySQL
  • nginx
  • Oracle
  • PHP
  • Python
  • Python Essential Reference
  • shell
  • socket
  • Ubuntu
  • VC
  • windows
  • 严蔚敏
  • 中文
  • 乱码
  • 卷2
  • 字符串
  • 安装
  • 实现
  • 排序
  • 教程
  • 数据结构
  • 核心技术
  • 算法
  • 算法技术手册
  • 编译
  • 读书笔记
  • 递归
  • 配置
  • 重读
Proudly powered by WordPress