Skip to content

Commit

Permalink
Minor code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Köhnke committed Sep 20, 2016
1 parent 05dd60b commit cbde336
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Example/main.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import WKZombie

// Parameters
let url = URL(string: "https://developer.apple.com/membercenter/index.action")!
let arguments = CommandLine.arguments
let user = arguments[1]
Expand All @@ -15,6 +16,7 @@ func handleResult(_ result: Result<[HTMLTableRow]>) {
}
}

// Result handling
func handleSuccess(result: [HTMLTableRow]?) {
print("\n")
print("PROVISIONING PROFILES:")
Expand All @@ -35,6 +37,7 @@ func handleError(error: ActionError) {
print(error)
}

// WKZombie Actions
open(url)
>>> get(by: .id("accountname"))
>>> setAttribute("value", value: user)
Expand All @@ -47,5 +50,6 @@ func handleError(error: ActionError) {
>>> getAll(by: .contains("class", "row-"))
=== handleResult

// Keep script running until actions are finished
let theRL = RunLoop.current
while shouldKeepRunning && theRL.run(mode: .defaultRunLoopMode, before: .distantFuture) { }

0 comments on commit cbde336

Please sign in to comment.