Commit a8d54916 authored by lujunye's avatar lujunye

添加swiftNotice

parent 4f67617f
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03BE2445B96500211A51 /* FgPassViewController.swift */; }; E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03BE2445B96500211A51 /* FgPassViewController.swift */; };
E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E09B03BF2445B96500211A51 /* FgPassViewController.xib */; }; E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E09B03BF2445B96500211A51 /* FgPassViewController.xib */; };
E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03C22445BD9500211A51 /* NavViewController.swift */; }; E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03C22445BD9500211A51 /* NavViewController.swift */; };
E09B03C62445BF6700211A51 /* NavBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03C52445BF6700211A51 /* NavBarView.swift */; };
E09B03C82445BF9300211A51 /* SwiftNotice.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09B03C72445BF9300211A51 /* SwiftNotice.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -75,6 +77,8 @@ ...@@ -75,6 +77,8 @@
E09B03BE2445B96500211A51 /* FgPassViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FgPassViewController.swift; sourceTree = "<group>"; }; E09B03BE2445B96500211A51 /* FgPassViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FgPassViewController.swift; sourceTree = "<group>"; };
E09B03BF2445B96500211A51 /* FgPassViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FgPassViewController.xib; sourceTree = "<group>"; }; E09B03BF2445B96500211A51 /* FgPassViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FgPassViewController.xib; sourceTree = "<group>"; };
E09B03C22445BD9500211A51 /* NavViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavViewController.swift; sourceTree = "<group>"; }; E09B03C22445BD9500211A51 /* NavViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavViewController.swift; sourceTree = "<group>"; };
E09B03C52445BF6700211A51 /* NavBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavBarView.swift; sourceTree = "<group>"; };
E09B03C72445BF9300211A51 /* SwiftNotice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftNotice.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -198,6 +202,7 @@ ...@@ -198,6 +202,7 @@
E09B039F2445AF4D00211A51 /* Define */ = { E09B039F2445AF4D00211A51 /* Define */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E09B03C72445BF9300211A51 /* SwiftNotice.swift */,
E09B03A22445AF9500211A51 /* NetworkRequest.swift */, E09B03A22445AF9500211A51 /* NetworkRequest.swift */,
E09B03A02445AF7100211A51 /* Define.swift */, E09B03A02445AF7100211A51 /* Define.swift */,
); );
...@@ -225,6 +230,7 @@ ...@@ -225,6 +230,7 @@
E09B03AC2445B0B200211A51 /* View */ = { E09B03AC2445B0B200211A51 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E09B03C42445BF4600211A51 /* NavBarView */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -273,6 +279,14 @@ ...@@ -273,6 +279,14 @@
path = "忘记密码"; path = "忘记密码";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E09B03C42445BF4600211A51 /* NavBarView */ = {
isa = PBXGroup;
children = (
E09B03C52445BF6700211A51 /* NavBarView.swift */,
);
path = NavBarView;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
...@@ -455,11 +469,13 @@ ...@@ -455,11 +469,13 @@
E09B03B62445B85A00211A51 /* LoginViewController.swift in Sources */, E09B03B62445B85A00211A51 /* LoginViewController.swift in Sources */,
E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */, E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */,
E00D85DF244561FD00F5F816 /* AppDelegate.swift in Sources */, E00D85DF244561FD00F5F816 /* AppDelegate.swift in Sources */,
E09B03C62445BF6700211A51 /* NavBarView.swift in Sources */,
E00D85E1244561FD00F5F816 /* SceneDelegate.swift in Sources */, E00D85E1244561FD00F5F816 /* SceneDelegate.swift in Sources */,
E09B03A12445AF7100211A51 /* Define.swift in Sources */, E09B03A12445AF7100211A51 /* Define.swift in Sources */,
E09B03A82445B04E00211A51 /* BaseView.swift in Sources */, E09B03A82445B04E00211A51 /* BaseView.swift in Sources */,
E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */, E09B03C02445B96500211A51 /* FgPassViewController.swift in Sources */,
E09B03AB2445B0A300211A51 /* LoginModel.swift in Sources */, E09B03AB2445B0A300211A51 /* LoginModel.swift in Sources */,
E09B03C82445BF9300211A51 /* SwiftNotice.swift in Sources */,
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */, E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */, E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
); );
......
...@@ -112,7 +112,7 @@ extension NetworkRequest { ...@@ -112,7 +112,7 @@ extension NetworkRequest {
case .success(let value): case .success(let value):
let json = JSON(value) let json = JSON(value)
print(json) print(json)
//SwiftNotice.clear() SwiftNotice.clear()
if json["code"].intValue == 200 { if json["code"].intValue == 200 {
success(Mapper<T>().map(JSONObject: value)) success(Mapper<T>().map(JSONObject: value))
...@@ -128,7 +128,7 @@ extension NetworkRequest { ...@@ -128,7 +128,7 @@ extension NetworkRequest {
failture(DogError.DataInvalidError) failture(DogError.DataInvalidError)
} }
case .failure(let error): case .failure(let error):
//SwiftNotice.clear() SwiftNotice.clear()
let alt = UIAlertView(title: "提示", message: "网络错误", delegate: nil, cancelButtonTitle: "确定") let alt = UIAlertView(title: "提示", message: "网络错误", delegate: nil, cancelButtonTitle: "确定")
...@@ -196,7 +196,7 @@ extension NetworkRequest { ...@@ -196,7 +196,7 @@ extension NetworkRequest {
case .success(let value): case .success(let value):
let json = JSON(value) let json = JSON(value)
print(json) print(json)
//SwiftNotice.clear() SwiftNotice.clear()
UserDefaults.standard.setValue(json["message"].stringValue, forKey: "jsonMessage") UserDefaults.standard.setValue(json["message"].stringValue, forKey: "jsonMessage")
...@@ -216,7 +216,7 @@ extension NetworkRequest { ...@@ -216,7 +216,7 @@ extension NetworkRequest {
} }
} }
case .failure(let error): case .failure(let error):
//SwiftNotice.clear() SwiftNotice.clear()
failture(error) failture(error)
} }
} }
......
This diff is collapsed.
//
// NavBarView.swift
// GeLiLaiGeWan
//
// Created by geli on 2018/7/20.
// Copyright © 2018年 geli. All rights reserved.
//
import UIKit
@objc protocol NavBarViewDelegate {
@objc optional func backAction()
@objc optional func rightBtnClick()
}
class NavBarView: BaseView {
var deleagte:NavBarViewDelegate?
var title:String?{
didSet{
titleLbl.text = title
}
}
var rightImg:UIImage?{
didSet{
rightBtn.setImage(rightImg, for: .normal)
rightBtn.snp.makeConstraints { (make) in
make.right.equalTo(-12)
make.bottom.equalTo(-14)
}
}
}
var rightTitle:String?{
didSet{
rightBtn.setTitle(rightTitle, for: .normal)
rightBtn.titleLabel?.font = setFont(15)
rightBtn.sizeToFit()
rightBtn.setTitleColor(UIColor.black, for: UIControlState(rawValue: 0))
rightBtn.snp.makeConstraints { (make) in
make.right.equalTo(-12)
make.bottom.equalTo(-14)
}
}
}
var leftImg:UIImage?{
didSet{
leftImgV.image = leftImg
}
}
var leftTitle:String?{
didSet{
leftBtn.setTitle(leftTitle, for: .normal)
leftBtn.sizeToFit()
leftBtn.snp.makeConstraints { (make) in
make.left.equalTo(12)
make.bottom.equalTo(-14)
}
}
}
var lineView:UIView!
var leftImgV:UIImageView!
var titleLbl:UILabel!
private
var rightBtn:UIButton!
var leftBtn:UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.white
titleLbl = UILabel()
titleLbl.font = setFont(18)
titleLbl.textAlignment = .center
self.addSubview(titleLbl)
titleLbl.snp.makeConstraints { (make) in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(44)
}
leftImgV = UIImageView()
leftImgV.image = UIImage(named: "icon_fanhui")
self.addSubview(leftImgV)
leftImgV.snp.makeConstraints { (make) in
make.left.equalTo(12)
make.bottom.equalTo(-14)
make.width.equalTo(10)
make.height.equalTo(17)
}
leftBtn = UIButton(frame: CGRect(x: 0, y: 0, width: 60, height: frame.size.height))
leftBtn.addTarget(self, action: #selector(backAction), for: .touchUpInside)
self.addSubview(leftBtn)
rightBtn = UIButton()
rightBtn.addTarget(self, action: #selector(rightClick), for: .touchUpInside)
self.addSubview(rightBtn)
lineView = UIView(frame: CGRect(x: 0, y: frame.size.height-1, width: frame.size.width, height: 1))
lineView.backgroundColor = RGB(r: 244, g: 244, b: 244)
self.addSubview(lineView)
}
@objc func backAction(){
deleagte?.backAction!()
if leftImgV.isHidden == false {
self.superview?.inputViewController?.navigationController?.popViewController(animated: true)
}
}
@objc func rightClick(){
deleagte?.rightBtnClick!()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
...@@ -21,4 +21,5 @@ pod 'Dollar' ...@@ -21,4 +21,5 @@ pod 'Dollar'
pod 'ViewAnimator' pod 'ViewAnimator'
pod 'SkeletonView' pod 'SkeletonView'
pod 'RealmSwift' pod 'RealmSwift'
pod 'SnapKit'
end end
\ No newline at end of file
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