forked from Noah37/zhuishushenqi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
caonongyun
authored and
caonongyun
committed
Apr 19, 2017
1 parent
3b6c5f2
commit 52b1df9
Showing
92 changed files
with
3,977 additions
and
234 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
21 changes: 21 additions & 0 deletions
21
zhuishushenqi/Assets.xcassets/loadside.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
zhuishushenqi/Assets.xcassets/zhuishushenqi/brightess_white_high.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.47 KB
...cassets/zhuishushenqi/brightess_white_high.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.3 KB
...cassets/zhuishushenqi/brightess_white_high.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
zhuishushenqi/Assets.xcassets/zhuishushenqi/brightess_white_low.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.35 KB
....xcassets/zhuishushenqi/brightess_white_low.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.1 KB
....xcassets/zhuishushenqi/brightess_white_low.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// | ||
// QSLoadingView.swift | ||
// zhuishushenqi | ||
// | ||
// Created by caonongyun on 2017/4/13. | ||
// Copyright © 2017年 QS. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
typealias CloseAction = ()->Void | ||
|
||
class QSLoadingView: UIView { | ||
|
||
var tipStr:String? { | ||
didSet{ | ||
tip.text = tipStr | ||
} | ||
} | ||
var tip:UILabel! | ||
var closeClosure:CloseAction? | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setupSubviews() | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
func setupSubviews(){ | ||
self.backgroundColor = UIColor.clear | ||
let bgView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | ||
bgView.backgroundColor = UIColor(red: 1/255.0, green: 1/255.0, blue: 1/255.0, alpha: 0.8) | ||
bgView.center = self.center | ||
let loadView = UIImageView(frame: CGRect(x: 0, y: 0, width: 30, height: 30)) | ||
loadView.center = CGPoint(x: bgView.bounds.width/2, y: bgView.bounds.height/2 - 10) | ||
loadView.image = UIImage(named: "loadside") | ||
bgView.addSubview(loadView) | ||
bgView.layer.cornerRadius = 10 | ||
addSubview(bgView) | ||
tip = UILabel(frame: CGRect(x: 0, y: bgView.bounds.height - 30, width: 100, height: 20)) | ||
tip.font = UIFont.systemFont(ofSize: 11) | ||
tip.textColor = UIColor.white | ||
tip.textAlignment = .center | ||
tip.text = "正在加载..." | ||
bgView.addSubview(tip) | ||
|
||
let close = UIButton(type: .custom) | ||
close.setImage(UIImage(named:"g_close"), for: .normal) | ||
close.frame = CGRect(x: bgView.bounds.width - 20, y: -10, width: 30, height: 30) | ||
close.addTarget(self, action: #selector(closeAction(btn:)), for: .touchUpInside) | ||
bgView.addSubview(close) | ||
|
||
let animation = CABasicAnimation(keyPath: "transform.rotation.z") | ||
animation.toValue = M_PI*2 | ||
animation.duration = 1.0 | ||
animation.repeatCount = MAXFLOAT | ||
loadView.layer.add(animation, forKey: "rotate") | ||
} | ||
|
||
@objc func closeAction(btn:UIButton){ | ||
if let close = closeClosure{ | ||
close() | ||
} | ||
} | ||
} | ||
|
||
extension IndicatableView where Self:UIViewController{ | ||
func showActivityView(){ | ||
let loadView:QSLoadingView = QSLoadingView(frame: UIScreen.main.bounds) | ||
loadView.closeClosure = { | ||
self.hideActivityView() | ||
} | ||
KeyWindow?.insertSubview(loadView, at: KeyWindow?.subviews.count ?? 0) | ||
} | ||
|
||
func hideActivityView(){ | ||
if let subviews = KeyWindow?.subviews { | ||
for item in subviews { | ||
if item.isKind(of: QSLoadingView.self) { | ||
item.removeFromSuperview() | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.