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 Foundation | |
import UIKit | |
protocol Coordinator { | |
var parentCoordinator: Coordinator? { get set } | |
var children: [Coordinator] { get set } | |
var navigationController: UINavigationController { get set } | |
func start() | |
} |
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
let bryan = "Bryan Bolivar" | |
print("%@", bryan) |
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
/* | |
QUICK network requests using Combine and Generics, Don't forget to import combibe | |
let url = URL(string: "https://www.hackingwithswift.com/samples/user-24601.json")! | |
fetch(url, defaultValue: User.default) { | |
print($0.name) | |
} | |
*/ |
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 | |
enum State { | |
case go | |
case stay | |
} | |
func calculateGroupCompatibility(groupName: String, shipName: String) -> State { | |
var dict: [String: Int] = [:] | |
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
func countSteps(from value: String, _ target: String) -> Int? { | |
guard | |
value.count == target.count | |
else { return nil } | |
var count = 0 | |
var newValue = value | |
var index = 0 | |
var found = false |
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 SwiftUI | |
struct BounceEffect: GeometryEffect{ | |
var height: CGFloat | |
var times: CGFloat | |
init(height: CGFloat = 50, times: Int) { | |
self.height = height | |
self.times = CGFloat(times) |
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 PlaygroundSupport | |
precedencegroup SingleTypeComposition { | |
associativity: right | |
} | |
infix operator <>: SingleTypeComposition | |
func <> <A: AnyObject>(f: @escaping (A) -> Void, g: @escaping (A) -> Void) -> (A) -> 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
import UIKit | |
import PlaygroundSupport | |
class Stack: CustomStringConvertible { | |
var tag: String | |
var open: Int | |
var close: Int | |
init(tag: String, open: Int, close: Int) { |
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 RxCocoa | |
import RxSwift | |
import SnapKit | |
class GridCollectionViewCell: UICollectionViewCell { | |
static let idenfifier = "UICollectionViewCellIdentifier" | |
var value: Variable<String?> = Variable(nil) |
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 | |
var json = """ | |
{ | |
"results": [ | |
{ | |
"vote_average": 7.4, | |
"vote_count": 6066, | |
"id": 284053, |
NewerOlder