• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

gitリポジトリのurlを貼り付けるだけでアプリケーションのビルドを実行するアプリ。 macOS用


Commit MetaInfo

Révision17ab088f6cc9e89ee435ad1bd91680b34c325d57 (tree)
l'heure2018-04-08 00:46:50
Auteurmasakih <masakih@user...>
Commitermasakih

Message de Log

GUI関連を関数の外に出した

Change Summary

Modification

--- a/AppBuilderWithGit/ViewController.swift
+++ b/AppBuilderWithGit/ViewController.swift
@@ -55,7 +55,12 @@ class ViewController: NSViewController {
5555
5656 @IBAction func doIt(_ sender: Any?) {
5757
58- clone()
58+ cloneButton.isEnabled = false
59+ clone {
60+ DispatchQueue.main.async {
61+ self.cloneButton.isEnabled = true
62+ }
63+ }
5964 }
6065
6166 }
@@ -83,21 +88,17 @@ extension ViewController {
8388
8489 extension ViewController {
8590
86- fileprivate func clone() {
91+ fileprivate func clone(completionHandler: @escaping () -> Void) {
8792
8893 guard let url = URL(string: urlField.stringValue)
8994 else { return }
9095
91- cloneButton.isEnabled = false
92-
9396 DispatchQueue(label: "MMMMM", attributes: .concurrent).async {
9497
9598 self.progress = true
9699 defer {
97100 self.progress = false
98- DispatchQueue.main.async {
99- self.cloneButton.isEnabled = true
100- }
101+ completionHandler()
101102 }
102103
103104 let gitCloner = Git(url)