Swift 3现在提供了内置方法,可以做个简单的封装:
extension String {
/// 假设string是url,抽取key&value对
func tt_urlQueryDict() -> [String: String] {
var dict = [String:String]()
guard let queryItems = URLComponents(string: self)?.queryItems[......]
Category Archives: iOS
Leave a reply
iOS的UITableView常见问题总结
1、如何设置headerView以及其高度
tableView.tableHeaderView = myHeaderView
let height = headerView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize).height
var frame = headerView.frame
frame.size.height = height
headerView.frame = frame
2、去掉多余ce[......]
iOS绘制五角能力图的Demo
只贴VC了:
//
// ViewController.swift
// AbilityDiagramDemo
//
// Created by Heyuan Li on 17/2/8.
// Copyright © 2017年 Heyuan Li. All rights reserved.
//
import UIKit
import SnapKit
class ViewController: UIViewController {
privat[......]
[转]没有UIViewController时如何使用UIAlertController(让UIAlertController总展示在App最上面)
转载自:《How To Present An Alert View Using UIAlertController When You Don't Have A View Controller》
Over the summer I updated a number of apps to iOS 9. A common tasks for me was replacing the deprecated UIAlertView with new UIAlertController class.[......]