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 | |
| import CloudFiles | |
| import SwiftyDropbox | |
| public struct Dropbox { | |
| typealias DownloadCompletion = (Result<Data?, Swift.Error>) -> Void | |
| typealias FetchCompletion = (Result<Fetch.Metadata?, Swift.Error>) -> Void | |
| typealias UploadCompletion = (Result<Upload.Metadata, Swift.Error>) -> Void | |
| public enum Error: Swift.Error { |
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 | |
| import GoogleSignIn | |
| import GoogleAPIClientForREST_Drive | |
| public struct Drive { | |
| typealias SignInCompletion = (Result<Void, Swift.Error>) -> Void | |
| typealias RestoreCompletion = (Result<Void, Swift.Error>) -> Void | |
| typealias DownloadCompletion = (Result<Data?, Swift.Error>) -> Void | |
| typealias AuthorizeCompletion = (Result<Void, Swift.Error>) -> Void | |
| typealias FetchCompletion = (Result<Fetch.Metadata?, Swift.Error>) -> Void |
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
| git_release() { | |
| # 1 | |
| git=$(sh /etc/profile; which git) | |
| number_of_commits=$("$git" rev-list HEAD --count) | |
| # 2 | |
| latest_tag=$(git describe --abbrev=0) | |
| commits_diff=$(git log --pretty="%h - %s (%an)" $latest_tag..HEAD) | |
| git tag -a b$number_of_commits -m "$commits_diff" |
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 XCTest | |
| import SnapshotTesting | |
| @testable import myapp | |
| final class ScreenTests: XCTestCase { | |
| var sut: Screen! | |
| override func setup() { | |
| sut = Screen() |
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 XCTest | |
| @testable import DataBindings | |
| final class DataBindingsTests: XCTestCase { | |
| var sut: ViewModel! | |
| override func setUp() { | |
| sut = ViewModel() | |
| } |
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 ViewController: UIViewController { | |
| // MARK: UI | |
| let label = UILabel() | |
| let incrementButton = UIButton() | |
| let decrementButton = UIButton() | |
| // MARK: Properties |
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
| final class ViewModel { | |
| let countBox: Box<Int> = Box(0) | |
| @objc func increment() { | |
| countBox.value += 1 | |
| } | |
| @objc func decrement() { | |
| countBox.value -= 1 | |
| } |
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
| final class Box<T> { | |
| var listener: ((T) -> Void)? | |
| var value: T { | |
| didSet { listener?(value) } | |
| } | |
| init(_ value: T) { | |
| self.value = value | |
| } |
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
| - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo | |
| fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {} |
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
| - (BOOL)application:(UIApplication *)application | |
| didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); | |
| UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil]; | |
| [application registerUserNotificationSettings:settings]; | |
| [application registerForRemoteNotifications]; | |
| return YES; | |
| } |
NewerOlder