Skip to content

Commit

Permalink
Fix some SwiftLint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmx committed Apr 21, 2017
1 parent 0a3682a commit a7008be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Insider.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "Insider"
s.version = "0.2"
s.version = "0.3"
s.summary = "Set a communication channel between your app and external testing environments."

s.description = <<-DESC
Expand Down
8 changes: 4 additions & 4 deletions Insider/Insider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import UIKit

public typealias JSONDictionary = Dictionary<NSObject, AnyObject>
public typealias JSONDictionary = [NSObject: AnyObject]

@objc
public protocol InsiderDelegate: class {
Expand Down Expand Up @@ -151,7 +151,7 @@ final public class Insider: NSObject {
return LocalWebServerResponse(statusCode: .success)
}

server.addHandlerForMethod(.GET, path: Endpoints.systemInfo) { (requestParams) -> (LocalWebServerResponse) in
server.addHandlerForMethod(.GET, path: Endpoints.systemInfo) { _ in
return LocalWebServerResponse(response: self.getSystemInfo())
}
}
Expand Down Expand Up @@ -185,12 +185,12 @@ final public class Insider: NSObject {
}

func getSystemInfo() -> JSONDictionary? {
let systemInfo = self.deviceInfoService.allSystemInfo

defer {
delegate?.insider?(self, didReturnSystemInfo: systemInfo)
}

let systemInfo = self.deviceInfoService.allSystemInfo

return systemInfo
}

Expand Down
15 changes: 8 additions & 7 deletions Insider/LocalWebServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import Foundation
typealias LocalWebServerRequestHandler = (JSONDictionary?) -> (LocalWebServerResponse)

enum LocalWebServerRequestMethod: String {
case GET = "GET"
case POST = "POST"
case PUT = "PUT"
case DELETE = "DELETE"
case GET
case POST
case PUT
case DELETE
}

protocol GCDWebServerDataResponseConvertible {
Expand Down Expand Up @@ -72,8 +72,9 @@ final class LocalWebServer: NSObject {

func addHandlerForMethod(_ method: LocalWebServerRequestMethod, path: String, handler: @escaping LocalWebServerRequestHandler) {

localWebServer?.addHandler(forMethod: method.rawValue, path: path, request: GCDWebServerURLEncodedFormRequest.self) {
(request) -> GCDWebServerResponse! in
localWebServer?.addHandler(forMethod: method.rawValue,
path: path,
request: GCDWebServerURLEncodedFormRequest.self) { (request) -> GCDWebServerResponse! in

let params = self.paramsForRequest(request as? GCDWebServerURLEncodedFormRequest)
var response: LocalWebServerResponse?
Expand All @@ -85,7 +86,7 @@ final class LocalWebServer: NSObject {
}
}

func executeOnMainQueue(_ closure: (() -> ())?) {
func executeOnMainQueue(_ closure: (() -> Void)?) {
DispatchQueue.main.sync { closure?() }
}

Expand Down
4 changes: 2 additions & 2 deletions InsiderUseCases/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
preferredStyle: .alert
)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in }
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)
alertController.addAction(cancelAction)

self.window?.rootViewController!.present(alertController, animated: true) {}
Expand Down Expand Up @@ -77,7 +77,7 @@ extension AppDelegate: InsiderDelegate {
let url = URL(string: "insiderDemo://hello/params")
let response = application(UIApplication.shared, handleOpen: url!)

return ["response" as NSObject : response as AnyObject]
return ["response" as NSObject: response as AnyObject]
}
}

0 comments on commit a7008be

Please sign in to comment.