-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from mac-gallagher/develop
Add storyboard support
- Loading branch information
Showing
26 changed files
with
815 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// DemoViewController.swift | ||
// MultiProgressViewExample | ||
// | ||
// Created by Mac Gallagher on 4/26/19. | ||
// Copyright © 2019 Mac Gallagher. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class DemoViewController: UITableViewController { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
navigationItem.title = "Demo" | ||
tableView.tableFooterView = UIView() | ||
} | ||
|
||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
let cell = UITableViewCell() | ||
cell.textLabel?.font = UIFont.systemFont(ofSize: 14) | ||
switch indexPath.row { | ||
case 0: | ||
cell.textLabel?.text = "Single Progress View (Programmatic)" | ||
case 1: | ||
cell.textLabel?.text = "Multiple Progress Views (Storyboard)" | ||
default: | ||
break | ||
} | ||
return cell | ||
} | ||
|
||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
switch indexPath.row { | ||
case 0: | ||
navigationController?.pushViewController(StorageExampleViewController(), animated: true) | ||
case 1: | ||
let storyboard = UIStoryboard(name: "LanguageExample", bundle: nil) | ||
let viewController = storyboard.instantiateViewController(withIdentifier: "LanguageExampleViewController") | ||
navigationController?.pushViewController(viewController, animated: true) | ||
default: | ||
break | ||
} | ||
} | ||
|
||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
return 2 | ||
} | ||
|
||
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
return 50 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// CodingLanguage.swift | ||
// MultiProgressViewExample | ||
// | ||
// Created by Mac Gallagher on 4/26/19. | ||
// Copyright © 2019 Mac Gallagher. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
enum CodingLanguage: Int { | ||
case none, html, net, java, javascript, css | ||
|
||
var description: String { | ||
switch self { | ||
case .none: | ||
return "Language" | ||
case .html: | ||
return "HTML/HTML5" | ||
case .net: | ||
return "ASP.Net" | ||
case .java: | ||
return "Java" | ||
case .javascript: | ||
return "JavaScript/jQuery" | ||
case .css: | ||
return "CSS/CSS3" | ||
} | ||
} | ||
|
||
var darkColor: UIColor { | ||
switch self { | ||
case .none: | ||
return .black | ||
case .html: | ||
return UIColor.LanguageExample.progressBlueDark | ||
case .net: | ||
return UIColor.LanguageExample.progressGreenDark | ||
case .java: | ||
return UIColor.LanguageExample.progressCyanDark | ||
case .javascript: | ||
return UIColor.LanguageExample.progressYellowDark | ||
case .css: | ||
return UIColor.LanguageExample.progressRedDark | ||
} | ||
} | ||
|
||
var lightColor: UIColor { | ||
switch self { | ||
case .none: | ||
return .black | ||
case .html: | ||
return UIColor.LanguageExample.progressBlueLight | ||
case .net: | ||
return UIColor.LanguageExample.progressGreenLight | ||
case .java: | ||
return UIColor.LanguageExample.progressCyanLight | ||
case .javascript: | ||
return UIColor.LanguageExample.progressYellowLight | ||
case .css: | ||
return UIColor.LanguageExample.progressRedLight | ||
} | ||
} | ||
} |
Oops, something went wrong.