This file contains hidden or 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
| import Foundation | |
| extension Formatter { | |
| //var localTimeZoneName: String { return TimeZone.current.identifier } | |
| static let iso8601: DateFormatter = { | |
| let formatter = DateFormatter() | |
| formatter.calendar = Calendar(identifier: .iso8601) |
This file contains hidden or 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
| /// Request to fetch and store new XApp token if the current token is missing or expired. | |
| func XAppTokenRequest(_ defaults: UserDefaults) -> Observable<String?> { | |
| var appToken = XAppToken(defaults: defaults) | |
| // If we have a valid token, return it and forgo a request for a fresh one. | |
| if appToken.isValid { | |
| return Observable.just(appToken.token) | |
| } | |
This file contains hidden or 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
| import UIKit | |
| extension UITextField { | |
| func flashForError() { | |
| self.layer.borderWidth = 1 | |
| self.layer.borderColor = UIColor.red.cgColor | |
| delayToMainThread(2) { | |
| self.layer.borderWidth = 0 | |
| self.layer.borderColor = UIColor.clear.cgColor |
This file contains hidden or 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
| import UIKit | |
| final class VCActivityIndicator { | |
| static let sharedInstance = VCActivityIndicator() | |
| let container: UIView = { | |
| let view = UIView() | |
| view.backgroundColor = .clear | |
| return view |
This file contains hidden or 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
| // | |
| // RepositoriesViewModel.swift | |
| // | |
| // Created by Douglas Taquary on 03/06/17. | |
| // Copyright © 2017 Douglas Taquary. All rights reserved. | |
| // | |
| import Foundation | |
| import RxSwift | |
| import RxCocoa |
This file contains hidden or 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
| // | |
| // LoadMoreReposActivityIndicator.swift | |
| // | |
| // Created by Douglas Taquary on 05/06/17. | |
| // Copyright © 2017 Douglas Taquary. All rights reserved. | |
| // | |
| import UIKit | |
| class LoadMoreReposActivityIndicator { |
This file contains hidden or 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
| func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
| let currentOffset = scrollView.contentOffset.y | |
| let maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height | |
| let deltaOffset = maximumOffset - currentOffset | |
| if deltaOffset <= -64 { | |
| if ( !loadMoreStatus ) { | |
| self.loadMoreStatus = true |
This file contains hidden or 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
| ```cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/``` |
This file contains hidden or 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
| class PullRequestsTableViewControllerTests: QuickSpec { | |
| override func spec() { | |
| describe("pullrequests TableViewController") { | |
| var controller : PullRequestsTableViewController! | |
| beforeEach { | |
| let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) |