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
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 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 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 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 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 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 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 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; | |
} |
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
import UIKit | |
final class Transition: NSObject, UIViewControllerAnimatedTransitioning { | |
enum Direction { | |
case present | |
case dismiss | |
} | |
var direction: Direction = .present | |
private var presentedConstraints: [NSLayoutConstraint] = [] |
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
import UIKit | |
final class Presenter: NSObject, UIViewControllerTransitioningDelegate { | |
private let transition = Transition() | |
func present(_ viewController: UIViewController, from parent: UIViewController) { | |
viewController.modalPresentationStyle = .overFullScreen | |
viewController.transitioningDelegate = self | |
parent.present(viewController, animated: true) | |
} |
NewerOlder