Commit 82c07a7a authored by pete谢兆麟's avatar pete谢兆麟

Merge commit 'ac3312fd' into xiezhaolin

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents f06eda08 ac3312fd
......@@ -205,7 +205,7 @@
047294E82B988A19008E0B84 /* YHNewWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047294E72B988A19008E0B84 /* YHNewWebViewController.swift */; };
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */; };
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047619E82BA9867100F45358 /* YHCountryHotView.swift */; };
047619EB2BA9A85900F45358 /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 047619EA2BA9A85900F45358 /* area.plist */; };
047619ED2BA9B9C900F45358 /* area.plist in Resources */ = {isa = PBXBuildFile; fileRef = 047619EC2BA9B9C900F45358 /* area.plist */; };
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E1792BA41C7E00436346 /* YHCertificateModel.swift */; };
0477E17C2BA4238400436346 /* YHMaterialListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E17B2BA4238400436346 /* YHMaterialListViewController.swift */; };
0477E17E2BA4362A00436346 /* YHCustomNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */; };
......@@ -579,7 +579,7 @@
047294E72B988A19008E0B84 /* YHNewWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNewWebViewController.swift; sourceTree = "<group>"; };
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = "<group>"; };
047619E82BA9867100F45358 /* YHCountryHotView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryHotView.swift; sourceTree = "<group>"; };
047619EA2BA9A85900F45358 /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = "<group>"; };
047619EC2BA9B9C900F45358 /* area.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = area.plist; sourceTree = "<group>"; };
0477E1792BA41C7E00436346 /* YHCertificateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateModel.swift; sourceTree = "<group>"; };
0477E17B2BA4238400436346 /* YHMaterialListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMaterialListViewController.swift; sourceTree = "<group>"; };
0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCustomNavigationBar.swift; sourceTree = "<group>"; };
......@@ -1360,7 +1360,7 @@
045EEE6A2B9F171A0022A143 /* YHAddressPicker */ = {
isa = PBXGroup;
children = (
047619EA2BA9A85900F45358 /* area.plist */,
047619EC2BA9B9C900F45358 /* area.plist */,
045EEE6C2B9F171A0022A143 /* YHAddressModel.swift */,
045EEE6D2B9F171A0022A143 /* YHAddressViewController.swift */,
045EEE6E2B9F171A0022A143 /* YHAddressPickViewTableViewCell.swift */,
......@@ -2109,7 +2109,7 @@
A51044182B493675006B60BB /* README.md in Resources */,
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */,
A5E69D512BA304D400411932 /* DIN Alternate Bold.ttf in Resources */,
047619EB2BA9A85900F45358 /* area.plist in Resources */,
047619ED2BA9B9C900F45358 /* area.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -2663,7 +2663,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2705,7 +2705,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
......@@ -49,7 +49,7 @@ class YHAddressPickView: UIView {
// self.underLine.center = CGPoint(x: self.buttonArr[1].center.x, y: self.underLine.center.y)
self.dataArray = locationModel?.provincesArray.map({ model in
model.provincesName
})
}) ?? []
self.tableView.reloadData()
case .city:
/// 选择城市时没有热门城市view,并将titleSV显示出来
......@@ -77,7 +77,7 @@ class YHAddressPickView: UIView {
})
self.dataArray = provincesModel?.cityArray.map({ model in
model.cityName
})
}) ?? []
self.tableView.reloadData()
}
}
......@@ -110,7 +110,7 @@ class YHAddressPickView: UIView {
/// 城市数据
private var cityModel: YHCityModel?
/// 当前tableView使用的数据源
private var dataArray: [String]?
private var dataArray: [String] = []
private let titleLabel: UILabel = {
let label = UILabel(frame: CGRect(x: (UIScreen.main.bounds.width - 150) / 2, y: 16, width: 150, height: 24))
label.textColor = UIColor.mainTextColor
......@@ -291,10 +291,15 @@ class YHAddressPickView: UIView {
/// 从area.plist获取全部地区数据
private func initLocationData() {
guard let dic = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "area", ofType: "plist") ?? "") as? [String:[String]] else {
locationModel = nil
dataArray = []
return
}
locationModel = YHCountryModel(dic: dic)
dataArray = locationModel?.provincesArray.map({$0.provincesName})
if let model = locationModel {
dataArray = model.provincesArray.map({$0.provincesName})
}
}
}
// MARK: - tableViewDelegate
......@@ -303,7 +308,7 @@ extension YHAddressPickView: UITableViewDelegate,UITableViewDataSource {
return 40
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return (self.dataArray?.count)! + 1
return self.dataArray.count + 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
......@@ -316,7 +321,7 @@ extension YHAddressPickView: UITableViewDelegate,UITableViewDataSource {
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHAddressPickViewTableViewCell.identifier) as? YHAddressPickViewTableViewCell else {
return YHAddressPickViewTableViewCell()
}
cell.label.text = self.dataArray?[indexPath.row - 1]
cell.label.text = self.dataArray[indexPath.row - 1]
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment