Use folder references for all groups and sort files/folders
This commit is contained in:
parent
38b44cedf8
commit
d698f2e3c3
12 changed files with 154 additions and 154 deletions
|
|
@ -1,29 +0,0 @@
|
|||
//
|
||||
// StringExtension.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Yishi Lin on 2018/9/23.
|
||||
// Copyright © 2018 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public extension String {
|
||||
|
||||
var trimmed: String {
|
||||
return trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
|
||||
func stringByAddingPercentEncodingForRFC3986() -> String? {
|
||||
let unreserved = "-._~/?"
|
||||
var allowed = CharacterSet.alphanumerics
|
||||
allowed.insert(charactersIn: unreserved)
|
||||
return addingPercentEncoding(withAllowedCharacters: allowed)
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
public static func | (left: String, right: String) -> String {
|
||||
return right.isEmpty ? left : left + "\n" + right
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
//
|
||||
// UIViewControllerExtionsion.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Yishi Lin on 5/4/17.
|
||||
// Copyright © 2017 Yishi Lin. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
private var kAssociationKeyNextField: UInt8 = 0
|
||||
|
||||
extension UITextField {
|
||||
@IBOutlet var nextField: UITextField? {
|
||||
get {
|
||||
return objc_getAssociatedObject(self, &kAssociationKeyNextField) as? UITextField
|
||||
}
|
||||
set(newField) {
|
||||
objc_setAssociatedObject(self, &kAssociationKeyNextField, newField, .OBJC_ASSOCIATION_RETAIN)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension UIViewController {
|
||||
@objc public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
if textField.nextField != nil {
|
||||
textField.nextField?.becomeFirstResponder()
|
||||
} else {
|
||||
textField.resignFirstResponder()
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// UIViewExtension.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Yishi Lin on 2018/4/11.
|
||||
// Copyright © 2018 Yishi Lin. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension UIView {
|
||||
|
||||
// Save anchors: https://stackoverflow.com/questions/46317061/use-safe-area-layout-programmatically
|
||||
var safeTopAnchor: NSLayoutYAxisAnchor {
|
||||
if #available(iOS 11.0, *) {
|
||||
return self.safeAreaLayoutGuide.topAnchor
|
||||
} else {
|
||||
return self.topAnchor
|
||||
}
|
||||
}
|
||||
|
||||
var safeLeftAnchor: NSLayoutXAxisAnchor {
|
||||
if #available(iOS 11.0, *){
|
||||
return self.safeAreaLayoutGuide.leftAnchor
|
||||
} else {
|
||||
return self.leftAnchor
|
||||
}
|
||||
}
|
||||
|
||||
var safeRightAnchor: NSLayoutXAxisAnchor {
|
||||
if #available(iOS 11.0, *){
|
||||
return self.safeAreaLayoutGuide.rightAnchor
|
||||
} else {
|
||||
return self.rightAnchor
|
||||
}
|
||||
}
|
||||
|
||||
var safeBottomAnchor: NSLayoutYAxisAnchor {
|
||||
if #available(iOS 11.0, *) {
|
||||
return self.safeAreaLayoutGuide.bottomAnchor
|
||||
} else {
|
||||
return self.bottomAnchor
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue