Skip to content

Commit

Permalink
version 2.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangqian committed Jul 7, 2020
1 parent 641c1ed commit ae20a74
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 10 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions SoHow.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "SoHow"
s.version = "2.2.3"
s.version = "2.2.4"
s.summary = "持续升级"

s.description = <<-DESC
Expand All @@ -37,7 +37,7 @@ Pod::Spec.new do |s|
s.author = { "Brandy" => "" }
s.authors = { "Brandy" => "[email protected]" }
s.platform = :ios, "13.0"
s.source = { :git => "https://github.com/brandy2015/SoHow.git", :tag => "2.2.3"}
s.source = { :git => "https://github.com/brandy2015/SoHow.git", :tag => "2.2.4"}
s.source_files = "SoHow/Source/*"
# s.dependency 'MBProgressHUD' #HUD支持

Expand Down
20 changes: 12 additions & 8 deletions SoHow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -51,6 +51,7 @@
D6D6456322388AAB00A9BD1A /* XYZWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D6456222388AAB00A9BD1A /* XYZWeb.swift */; };
D6D6456722388BB200A9BD1A /* XYZSpeech.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D6456622388BB200A9BD1A /* XYZSpeech.swift */; };
D6D645692238C52400A9BD1A /* XYZDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D645682238C52400A9BD1A /* XYZDevice.swift */; };
D6D8F1C924B4140300AC9C5C /* XYZString_XYZMoney_Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D8F1C824B4140300AC9C5C /* XYZString_XYZMoney_Ex.swift */; };
D6EACA6323A099920060EB65 /* XYZDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6EACA6223A099920060EB65 /* XYZDictionary.swift */; };
D6EACA6523A09AAE0060EB65 /* XYZVolumizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6EACA6423A09AAE0060EB65 /* XYZVolumizer.swift */; };
D6F47BE322B1225700180CE6 /* XYZUTIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6F47BE222B1225700180CE6 /* XYZUTIs.swift */; };
Expand Down Expand Up @@ -103,6 +104,7 @@
D6D6456222388AAB00A9BD1A /* XYZWeb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZWeb.swift; sourceTree = "<group>"; };
D6D6456622388BB200A9BD1A /* XYZSpeech.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZSpeech.swift; sourceTree = "<group>"; };
D6D645682238C52400A9BD1A /* XYZDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZDevice.swift; sourceTree = "<group>"; };
D6D8F1C824B4140300AC9C5C /* XYZString_XYZMoney_Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZString_XYZMoney_Ex.swift; sourceTree = "<group>"; };
D6EACA6223A099920060EB65 /* XYZDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZDictionary.swift; sourceTree = "<group>"; };
D6EACA6423A09AAE0060EB65 /* XYZVolumizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XYZVolumizer.swift; sourceTree = "<group>"; };
D6F47BE222B1225700180CE6 /* XYZUTIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYZUTIs.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -189,12 +191,12 @@
D6B63DEF21C7E7590087B44D /* Source */ = {
isa = PBXGroup;
children = (
D695973B2473C19100856B24 /* DatePickerDialog.swift */,
D69407CD224C6F98009A2489 /* LearnX.swift */,
D653F36C21F70C1A00E6A990 /* UIDevice_Extension.swift */,
D6116E8B230BC1D600962BCD /* WeakProxy.swift */,
D619756C22FA4D3200A97B53 /* XYZ3DTouch.swift */,
D63C5A2E22B3B09D0064C34E /* XYZAirPrint.swift */,
D693A50323E7AA7100BB2031 /* XYZWebView.swift */,
D65D7F6D22390DE600FC316E /* XYZAlert.swift */,
D6D6456022388A8100A9BD1A /* XYZArrayAndDic.swift */,
D6C92DFB22F9202C008E5A91 /* XYZAudio.swift */,
Expand All @@ -204,26 +206,27 @@
D6CBCEEE227173640033A91A /* XYZEnum.swift */,
D695A164226EFBAA00871AAC /* XYZExample.swift */,
D653F36E21F711A200E6A990 /* XYZGCD.swift */,
D693A4FE23E7A9E000BB2031 /* XYZShadowKit.swift */,
D653F37421F7175D00E6A990 /* XYZImageView.swift */,
D653F36A21F6F30E00E6A990 /* XYZJump.swift */,
D6A1D3272282CBB7000F6C96 /* XYZLearn.swift */,
D6CC9DEC239789CA004F7EF4 /* XYZNaviController.swift */,
D6947D4523A7B5E300EBDF12 /* XYZNotification.swift */,
D6D6455E2238888600A9BD1A /* XYZNumberAndString.swift */,
D6B5AB732239138E00E01695 /* XYZPodX.swift */,
D693A4FE23E7A9E000BB2031 /* XYZShadowKit.swift */,
D6D6456622388BB200A9BD1A /* XYZSpeech.swift */,
D6D8F1C824B4140300AC9C5C /* XYZString_XYZMoney_Ex.swift */,
D6CC9DEA239789BA004F7EF4 /* XYZTabBarController.swift */,
D65D7F6522390CCD00FC316E /* XYZTableView.swift */,
D6A02B3623E666ED00DEF883 /* XYZToCircle.swift */,
D6947D4923A7B61B00EBDF12 /* XYZTVCell.swift */,
D6947D4023A7B3C700EBDF12 /* XYZUILabel.swift */,
D69597362473C0F200856B24 /* XYZUIView.swift */,
D6947D4523A7B5E300EBDF12 /* XYZNotification.swift */,
D6F47BE222B1225700180CE6 /* XYZUTIs.swift */,
D69597322473BF1000856B24 /* XYZVCX_Extension.swift */,
D6D6456222388AAB00A9BD1A /* XYZWeb.swift */,
D693A50323E7AA7100BB2031 /* XYZWebView.swift */,
D66A8C3922A0960C00375126 /* XYZXib.swift */,
D6947D4023A7B3C700EBDF12 /* XYZUILabel.swift */,
D6A02B3623E666ED00DEF883 /* XYZToCircle.swift */,
D69597322473BF1000856B24 /* XYZVCX_Extension.swift */,
D695973B2473C19100856B24 /* DatePickerDialog.swift */,
);
path = Source;
sourceTree = "<group>";
Expand Down Expand Up @@ -343,6 +346,7 @@
D6B5AB742239138E00E01695 /* XYZPodX.swift in Sources */,
D619756722F9D5BF00A97B53 /* XYZButton.swift in Sources */,
D6CBCEEF227173640033A91A /* XYZEnum.swift in Sources */,
D6D8F1C924B4140300AC9C5C /* XYZString_XYZMoney_Ex.swift in Sources */,
D6C92DFC22F9202C008E5A91 /* XYZAudio.swift in Sources */,
D65D7F6622390CCD00FC316E /* XYZTableView.swift in Sources */,
D6F47BE322B1225700180CE6 /* XYZUTIs.swift in Sources */,
Expand Down
Binary file not shown.
12 changes: 12 additions & 0 deletions SoHow/Source/XYZImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ import UIKit
import MobileCoreServices //picker.mediaTypes的类型
import PhotosUI //LivePhoto使用的依赖库

//从字符串用作照片名字获取照片UIImage
public extension String{
var ToImg:UIImage?{
return UIImage(named: self)
}

var ToColor:UIColor?{
return UIColor(named: self)
}
}


//取圆头像
public extension UIImageView{
func ToCircle() {
Expand Down
176 changes: 176 additions & 0 deletions SoHow/Source/XYZString_XYZMoney_Ex.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
//
// XYZString_XYZMoney_Ex.swift
// SoHow
//
// Created by 张子豪 on 2020/7/7.
// Copyright © 2020 张子豪. All rights reserved.
//

import UIKit

public extension String{
func 找出数字算法() -> Double {
let 输入 = self.花了后面字符串()

var double结果 = 0.0
var 结果字符串准备输出 = ""

if Double(输入) == nil{

for i in 输入{
if i != "."{
if let dd = Int("\(i)"){
结果字符串准备输出 += "\(dd)"
}}else{
结果字符串准备输出 += "."
}}
double结果 = Double(结果字符串准备输出) ?? 0

}else{ double结果 = Double(输入)!}
return Double(String(format: "%.2f", double结果)) ?? 0.0
}


func w文字转数字() -> String{
let m = self

var 暂时数字 = ""
for i in m {
switch i {
case "","0": 暂时数字 += "0"
case "","1":暂时数字 += "1"
case "","2":暂时数字 += "2"
case "","3":暂时数字 += "3"
case "","4":暂时数字 += "4"
case "","5":暂时数字 += "5"
case "","6":暂时数字 += "6"
case "","7":暂时数字 += "7"
case "","8":暂时数字 += "8"
case "","9":暂时数字 += "9"
case "",".":暂时数字 += "."

default: break

}

}
return 暂时数字
}


func 花了后面字符串(关键字:String = "花了") -> String{
let 输入 = self
// 输入.rep输入
var 输出 = 输入.replacingOccurrences(of: "", with: "")

输出 = 输出.replacingOccurrences(of: "", with: "")
输出 = 输出.replacingOccurrences(of: "", with: "")

if 输出.contains(关键字){

let 找位置 = 输出.range(of: 关键字)
let 起始位置 = (找位置?.upperBound)!

let 终止位置 = 输入.endIndex
let 范围 = 起始位置..<终止位置
输出 = String(输入[范围])//.substring(with: 范围)
}
return 输出
}

}















public func 买东西条目名称整理(输入:String,关键字:String = "花了") -> String{
var 输出 = 输入
if 输入.contains(关键字){

let 找位置 = 输出.range(of: 关键字)
let 起始位置 = 输入.startIndex
let 终止位置 = (找位置?.lowerBound)!
let 范围 = 起始位置..<终止位置

输出 = String(输入[范围])
}
return 输出
}















public func 有汉字时间格式的调整(date:Date,format:String = "yyyy年MM月dd日 HH:mm:ss") -> String {
// 创建一个日期格式器
let dformatter = DateFormatter()
// 为日期格式器设置格式字符串
dformatter.dateFormat = format
// 使用日期格式器格式化日期、时间
let datestr = dformatter.string(from: date)
let message = "\(datestr)"
return message
}

public func 时间格式的调整2只剩年月日时间创建录音(date:Date) -> String {
// 创建一个日期格式器
let dformatter = DateFormatter()
// 为日期格式器设置格式字符串
dformatter.dateFormat = "yyyyMMddHHmmss"
// 使用日期格式器格式化日期、时间
let datestr = dformatter.string(from: date)
let message = "\(datestr)"
return message
}


public func 返回整数月份(时间:Date) -> Int {

let 时间格式 = DateFormatter()
时间格式.dateFormat = "M"
let t = 时间格式.string(from: 时间)


return Int(t) ?? 0
}


public func Date转String不加区域(date:Date) -> String {
// 创建一个日期格式器
let dformatter = DateFormatter()
// 为日期格式器设置格式字符串
dformatter.dateFormat = "yyyyMMddHHmmss"
// 使用日期格式器格式化日期、时间
let datestr = dformatter.string(from: date)
let message = "\(datestr)"
return message
}

//
////添加一个+=的方法让两个词典可以融合
//func += <KeyType, ValueType> ( left: inout Dictionary<KeyType, ValueType>, right: Dictionary<KeyType, ValueType>) {
// for (k, v) in right {
// left.updateValue(v, forKey: k)
// }
//}

0 comments on commit ae20a74

Please sign in to comment.