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[......]
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[......]
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[......]
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[......]
代码如下:
注意priority high是关键
class YYCell: UITableViewCell {
fileprivate var tvHeightConstraint: Constraint? = nil
....
fileprivate func setupUI() {
textView.snp.makeConstraints { (make) in
make.top.equalToSupervi[......]
1、新建Target
2、实现UNNotificationServiceExtension
我这里用的是swift
//
// NotificationService.swift
// NotificationServiceExtension
//
// Created by Heyuan Li on 17/2/26.
// Copyright © 2017年 fenbi. All rights reserved.
//
import Us[......]