首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)
host github
hostname github.com
Port 22
host gitlab.zjut.com
import sys | |
import os | |
import xml.etree.ElementTree as ET | |
import logging | |
import re | |
from shutil import copyfile | |
from optparse import OptionParser | |
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this. | |
### It is copied here for other people to use on its own. |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView
and UICollectionView
. Well, that is if you don’t use Storyboards, of course.
Both UITableView
and UICollectionView
offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
//UITableView的tableHeaderView高度自适应 | |
extension UITableView { | |
//set the tableHeaderView so that the required height can be determined, update the header's frame and set it again | |
func setAndLayoutTableHeaderView(header: UIView) { | |
self.tableHeaderView = header | |
for view in header.subviews { | |
guard let label = view as? UILabel where label.numberOfLines == 0 else { continue } | |
label.preferredMaxLayoutWidth = CGRectGetWidth(label.frame) | |
} |
import LocalAuthentication | |
class BiometricAuthenticationManager { | |
enum BiometricAuthenticationType { | |
case faceID(permitted: Bool) | |
case touchID | |
case none | |
} | |
// accessing the window and changing the root view controller property | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// getting access to the window object from SceneDelegate | |
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | |
let sceneDelegate = windowScene.delegate as? SceneDelegate | |
else { | |
return | |
} | |
let viewcontroller = UIViewController() |