Skip to content

Commit

Permalink
refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah37 committed Aug 8, 2017
1 parent e785c5a commit c4c4819
Show file tree
Hide file tree
Showing 34 changed files with 81 additions and 443 deletions.
Binary file modified .DS_Store
Binary file not shown.
88 changes: 46 additions & 42 deletions zhuishushenqi.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file modified zhuishushenqi/.DS_Store
Binary file not shown.
3 changes: 0 additions & 3 deletions zhuishushenqi/Client/QSAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ extension QSAPI:TargetType{
case let .recommend(key):
pathComponent = "/book-list/\(key)/recommend?limit=3"
break
default:
pathComponent = ""

}
return "\(baseURLString)\(pathComponent)"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import Foundation

extension String{

//MARK: - crypto
func md5() ->String{
let str = self.cString(using: String.Encoding.utf8)
let strLen = CUnsignedInt(self.lengthOfBytes(using: String.Encoding.utf8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class QSResource:Resource{
}

public var cacheKey: String{
return "\(self.imageURL)"
return "\(String(describing: self.imageURL))"
}

init(url:URL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ReadHistoryViewController: BaseViewController,UITableViewDataSource,UITabl

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = models[indexPath.row]
self.navigationController?.pushViewController(QSBookDetailRouter.createModule(id: model._id ?? ""), animated: true)
self.navigationController?.pushViewController(QSBookDetailRouter.createModule(id: model._id ), animated: true)

}

Expand Down
1 change: 1 addition & 0 deletions zhuishushenqi/Root/Views/SwipableCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class SwipableCell: UITableViewCell {
imageName = ""
break
}
QSLog(cacheBtnSelected)
stateImage.image = UIImage(named: imageName)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class BookCommentViewController: BaseViewController,UITableViewDataSource,UITabl
}else if indexPath.section == 1 {
return 91
}else {
var height:CGFloat = 0
let height:CGFloat = 0
if (magicComments?.count ?? 0) > 0 {
if indexPath.section == 2 {
// height = BookCommentViewCell.cellHeight(model: magicComments?[indexPath.row])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,23 @@ class QSBookCommentViewController: BaseViewController,UITableViewDataSource,UITa
// }
// }
// return height
var height:CGFloat = 130
if (hotComments?.count ?? 0) > 0 {
if indexPath.section == 2 {
if let model = self.hotComments?[indexPath.row] {
height = BookCommentViewCell.cellHeight(model: model)
}
}else{
if let model = self.normalComments?[indexPath.row] {
height = BookCommentViewCell.cellHeight(model: model)
}
}
}else {
if let model = self.normalComments?[indexPath.row]{
height = BookCommentViewCell.cellHeight(model: model)
}
}
return height
// var height:CGFloat = 130
// if (hotComments?.count ?? 0) > 0 {
// if indexPath.section == 2 {
// if let model = self.hotComments?[indexPath.row] {
// height = BookCommentViewCell.cellHeight(model: model)
// }
// }else{
// if let model = self.normalComments?[indexPath.row] {
// height = BookCommentViewCell.cellHeight(model: model)
// }
// }
// }else {
// if let model = self.normalComments?[indexPath.row]{
// height = BookCommentViewCell.cellHeight(model: model)
// }
// }
// return height
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C68" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="6ck-39-nKb">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="6ck-39-nKb">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -18,11 +18,11 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="67" id="fEf-rP-ih4">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TextReaderIden" rowHeight="67" id="fEf-rP-ih4">
<rect key="frame" x="0.0" y="28" width="375" height="67"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fEf-rP-ih4" id="Nxp-zr-xpv">
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="66.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nZc-JH-P9O">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ class CategoryController: BaseViewController,UITableViewDataSource,UITableViewDe
if index >= titles.count {
return;
}
let localKey:String = "\(index)\(self.resource?.link ?? "")"
let _:String = "\(index)\(self.resource?.link ?? "")"

let url = "\(CHAPTERURL)/\(titles[index].object(forKey: "link") ?? "")?k=19ec78553ec3a169&t=1476188085"
_ = "\(CHAPTERURL)/\(titles[index].object(forKey: "link") ?? "")?k=19ec78553ec3a169&t=1476188085"
// Alamofire.request(url).responseJSON { (response) in
// if let json = response.result.value as? Dictionary<String, Any> {
// QSLog("JSON:\(json)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class QSTextInteractor: QSTextInteractorProtocol {
}
}
QSNetwork.request(url, method: HTTPMethodType.get, parameters: api.parameters, headers: nil) { (response) in
QSLog("JSON:\(response.json)")
QSLog("JSON:\(String(describing: response.json))")
if let chapters = response.json?["chapters"] as? [NSDictionary] {
QSLog("Chapters:\(chapters)")
self.chapters = chapters
Expand Down
4 changes: 2 additions & 2 deletions zhuishushenqi/TXTReader/Models/ChapterInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ class ChapterInfo: Mappable ,NSCoding{
class func updateLocalModel(localModel:ChapterInfo,id:String) -> Void {
let key = "QSTXTReaderKeyAt\(localModel.currentIndex)\(id)".md5()
let jsonString = localModel.toJSON()
let filePath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/\(key ?? "QSSSSSS")")
let filePath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/\(key )")
NSKeyedArchiver.archiveRootObject(jsonString, toFile: filePath!)
}

class func localModelWithKey(key:String) ->ChapterInfo?{
let localKey = "QSTXTReaderKeyAt\(key)".md5()
let filePath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/\(localKey ?? "")")
let filePath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/\(localKey )")
var model:ChapterInfo?
var file:[String:Any]?
file = NSKeyedUnarchiver.unarchiveObject(withFile: filePath!) as? [String : Any]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class QSBookDetailContentView: UIView {
fatalError("init(coder:) has not been implemented")
}

@discardableResult

func setupSubviews(longIntro:String){
let height = contentHeight(longIntro: self.longIntro ?? "")
self.backgroundColor = UIColor.white
Expand Down
Binary file modified zhuishushenqi/Vendor/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion zhuishushenqi/Vendor/QSNetwork/QSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension QSError: LocalizedError {
public var errorDescription: String? {
switch self {
case .invalidURL(let url):
return "URL is not valid: \(url)"
return "URL is not valid: \(String(describing: url))"
case .parameterEncodingFailed(let reason):
return reason.localizedDescription
case .responseValidationFailed(let reason):
Expand Down
2 changes: 1 addition & 1 deletion zhuishushenqi/Vendor/QSNetwork/QSResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ open class QSResponse: NSObject {
func jsonT() -> Void {
do{
if let jsonData = self.data {
let jsonDict:AnyObject? = try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) as? AnyObject
let jsonDict:AnyObject? = try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) as AnyObject
if let jsonD = jsonDict {
self.json = jsonD
}
Expand Down
Binary file removed zhuishushenqi/Vendor/XYCNetwork/.DS_Store
Binary file not shown.
88 changes: 0 additions & 88 deletions zhuishushenqi/Vendor/XYCNetwork/XYCBaseRequest.swift

This file was deleted.

101 changes: 0 additions & 101 deletions zhuishushenqi/Vendor/XYCNetwork/XYCNetworkAgent.swift

This file was deleted.

Loading

0 comments on commit c4c4819

Please sign in to comment.