This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PosixErrorCode | |
{ | |
const EPERM = 1; /* Operation not permitted */ | |
const ENOENT = 2; /* No such file or directory */ | |
const ESRCH = 3; /* No such process */ | |
const EINTR = 4; /* Interrupted system call */ | |
const EIO = 5; /* Input/output error */ | |
const ENXIO = 6; /* Device not configured */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UISearchBar+Extension.swift | |
// | |
import UIKit | |
extension UISearchBar { | |
var dtXcode: Int { | |
if let dtXcodeString = Bundle.main.infoDictionary?["DTXcode"] as? String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://forums.developer.apple.com/thread/50302 | |
func getSSID() -> [String] { | |
guard let interfacesName = CNCopySupportedInterfaces() as? [String] else { return [String()] } | |
return interfacesName.compactMap({ (name) in | |
guard let info = CNCopyCurrentNetworkInfo(name as CFString) as? [String: AnyObject] else { return nil } | |
guard let ssid = info[kCNNetworkInfoKeySSID as String] as? String else { return nil } | |
return ssid | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
This is flexible to deal the completion handler. | |
* gist: https://gist.github.com/joshua24322/2b48a026452e1184fce85ef68f18014e | |
*/ | |
import Foundation | |
import UIKit | |
extension UIViewController { |