Skip to content

Commit

Permalink
use YepNetworking framework
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed May 19, 2016
1 parent bceba97 commit d0d6499
Show file tree
Hide file tree
Showing 45 changed files with 67 additions and 22 deletions.
1 change: 1 addition & 0 deletions Yep/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Fabric
import AVFoundation
import RealmSwift
Expand Down
1 change: 1 addition & 0 deletions Yep/Caches/ImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking
import MapKit
import Kingfisher

Expand Down
1 change: 1 addition & 0 deletions Yep/Extensions/UIViewController+Yep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import SafariServices

// MAKR: - Heights
Expand Down
1 change: 1 addition & 0 deletions Yep/Operations/UploadAttachmentOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import YepNetworking

final class UploadAttachmentOperation: ConcurrentOperation {

Expand Down
5 changes: 3 additions & 2 deletions Yep/Realm/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
//

import UIKit
import RealmSwift
import MapKit
import RealmSwift
import YepNetworking

// 总是在这个队列里使用 Realm
//let realmQueue = dispatch_queue_create("com.Yep.realmQueue", DISPATCH_QUEUE_SERIAL)
Expand Down Expand Up @@ -1800,7 +1801,7 @@ func videoMetaOfMessage(message: Message) -> (width: CGFloat, height: CGFloat)?
// MARK: Update with info
func updateUserWithUserID(userID: String, useUserInfo userInfo: JSONDictionary, inRealm realm: Realm) {
func updateUserWithUserID(userID: String, useUserInfo userInfo: [String: AnyObject], inRealm realm: Realm) {
if let user = userWithUserID(userID, inRealm: realm) {
Expand Down
1 change: 1 addition & 0 deletions Yep/Services/OpenGraphService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2016年 Catch Inc. All rights reserved.
//

import YepNetworking
import Alamofire
import Kanna

Expand Down
7 changes: 4 additions & 3 deletions Yep/Services/SocialWorkService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

import Foundation
import RealmSwift
import YepNetworking

private let githubBaseURL = NSURL(string: "https://api.github.com")!
private let dribbbleBaseURL = NSURL(string: "https://api.dribbble.com")!
private let instagramBaseURL = NSURL(string: "https://api.instagram.com")!

private func githubResource<A>(token token: String, path: String, method: Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {
private func githubResource<A>(token token: String, path: String, method: YepNetworking.Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {

let jsonParse: NSData -> A? = { data in
if let json = decodeJSON(data) {
Expand All @@ -32,7 +33,7 @@ private func githubResource<A>(token token: String, path: String, method: Method
return Resource(path: path, method: method, requestBody: jsonBody, headers: headers, parse: jsonParse)
}

private func dribbbleResource<A>(token token: String, path: String, method: Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {
private func dribbbleResource<A>(token token: String, path: String, method: YepNetworking.Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {

let jsonParse: NSData -> A? = { data in
if let json = decodeJSON(data) {
Expand All @@ -51,7 +52,7 @@ private func dribbbleResource<A>(token token: String, path: String, method: Meth
return Resource(path: path, method: method, requestBody: jsonBody, headers: headers, parse: jsonParse)
}

private func instagramResource<A>(token token: String, path: String, method: Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {
private func instagramResource<A>(token token: String, path: String, method: YepNetworking.Method, requestParameters: JSONDictionary, parse: JSONDictionary -> A?) -> Resource<A> {

let jsonParse: NSData -> A? = { data in
if let json = decodeJSON(data) {
Expand Down
1 change: 1 addition & 0 deletions Yep/Services/YepFayeService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import RealmSwift
import YepNetworking

protocol YepFayeServiceDelegate: class {

Expand Down
3 changes: 2 additions & 1 deletion Yep/Services/YepNetworking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2015年 Catch Inc. All rights reserved.
//

/*
import UIKit
public enum Method: String, CustomStringConvertible {
Expand Down Expand Up @@ -358,4 +359,4 @@ public func jsonResource<A>(token token: String?, path: String, method: Method,
return Resource(path: path, method: method, requestBody: jsonBody, headers: headers, parse: jsonParse)
}

*/
1 change: 1 addition & 0 deletions Yep/Services/YepService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import YepNetworking
import RealmSwift
import CoreLocation
import Alamofire
Expand Down
1 change: 1 addition & 0 deletions Yep/Services/YepServiceSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import YepNetworking
import RealmSwift

enum MessageAge: String {
Expand Down
1 change: 1 addition & 0 deletions Yep/Services/YepStorageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import MobileCoreServices.UTType
import YepNetworking
import Alamofire

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class ChangeMobileViewController: UIViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking

extension ConversationViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking
import AVFoundation
import MobileCoreServices
import MapKit
Expand Down
1 change: 1 addition & 0 deletions Yep/ViewControllers/Discover/DiscoverViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking

enum DiscoverUserMode: Int {
case Normal = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking

final class DoNotDisturbPeriodViewController: UIViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class EditNicknameAndBadgeViewController: UITableViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking
import TPKeyboardAvoiding
import Proposer
import Navi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler
import RealmSwift

Expand Down
1 change: 1 addition & 0 deletions Yep/ViewControllers/Feedback/FeedbackViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import KeyboardMan
import DeviceGuru

Expand Down
1 change: 1 addition & 0 deletions Yep/ViewControllers/Feeds/FeedsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking
import AVFoundation
import MapKit
import Ruler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking

final class FriendsInContactsViewController: BaseViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class LoginByMobileViewController: BaseViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class LoginVerifyMobileViewController: UIViewController {
Expand Down
1 change: 1 addition & 0 deletions Yep/ViewControllers/NewFeed/NewFeedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import CoreLocation
import MobileCoreServices
import Photos
import YepNetworking
import Proposer
import RealmSwift
import Kingfisher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import RealmSwift

struct DoNotDisturbPeriod {
Expand Down
1 change: 1 addition & 0 deletions Yep/ViewControllers/OAuth/OAuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import OnePasswordExtension

final class OAuthViewController: BaseViewController {
Expand Down
5 changes: 3 additions & 2 deletions Yep/ViewControllers/Profile/ProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
//

import UIKit
import SafariServices
import CoreLocation
import RealmSwift
import YepNetworking
import MonkeyKing
import Navi
import SafariServices
import Kingfisher
import Proposer
import CoreLocation

let profileAvatarAspectRatio: CGFloat = 12.0 / 16.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import AVFoundation
import YepNetworking
import Proposer
import Navi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class RegisterPickMobileViewController: SegueViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking

final class RegisterPickSkillsViewController: BaseViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import pop

final class RegisterSelectSkillsViewController: UIViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class RegisterVerifyMobileViewController: SegueViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import RealmSwift
import YepNetworking
import AVFoundation
import MapKit
import Ruler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking

final class SearchedUsersViewController: BaseViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import UIKit
import MobileCoreServices
import RealmSwift
import YepNetworking
import Proposer
import Navi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Kingfisher
import MonkeyKing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import MonkeyKing
import Navi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import MonkeyKing

final class SocialWorkInstagramViewController: BaseViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Ruler

final class VerifyChangedMobileViewController: UIViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking

final class ProfileSocialAccountGithubCell: UICollectionViewCell {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import YepNetworking
import Kingfisher

final class ProfileSocialAccountImagesCell: UICollectionViewCell {
Expand Down
Loading

0 comments on commit d0d6499

Please sign in to comment.