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
private let worker = ProfileViewModelWorker() | |
private var viewModel: ProfileViewModel! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
profileViewModel = ProfileViewModel(viewModelWorkable: worker) | |
profileViewModel.fetchAndTag() | |
} |
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 | |
protocol ProfileViewModelWorkable { | |
func fetchProfileAndTagIt(completion: @escaping (Bool) -> Void) | |
} | |
class ProfileViewModelWorker: ProfileViewModelWorkable { | |
func fetchProfileAndTagIt(completion: @escaping (Bool) -> Void) { | |
fetchProfile { [weak self] result in | |
guard let self = self else {return} |
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 | |
protocol ProfileViewModelWorkable { | |
func fetchProfileAndTagIt(completion: @escaping (Bool) -> Void) | |
} | |
class ProfileViewModelWorker: ProfileViewModelWorkable { | |
func fetchProfileAndTagIt(completion: @escaping (Bool) -> Void) { | |
fetchProfile { [weak self] result in | |
guard let self = self else {return} |
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
private let networker = ProfileNetworker() | |
private let tagger = ProfileAnalytic() | |
private var profileViewModel: ProfileViewModel! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
profileViewModel = ProfileViewModel(profileNetwork: networker, profileTagger: tagger) | |
profileViewModel.fetch() | |
} |
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 | |
struct Profile: Codable {} | |
protocol ProfileNetworkFetchable { | |
func fetchProfile(completion: @escaping (Result<Profile,NSError>) -> Void) | |
} | |
protocol ProfileAnalyticTaggable { | |
func tagAnalytics(result: Result<Profile,NSError>) |
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 | |
class MarkdownPreviewViewController: UIViewController { | |
@IBOutlet weak var markdownTextView: UITextView! | |
private var markdownPreviewer = MarkdownPreviewer() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
Task { | |
let url = "https://www.awesomemarkdownresource.com" |
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 | |
class MarkdownPreviewViewController: UIViewController { | |
@IBOutlet weak var markdownTextView: UITextView! | |
private var markdownPreviewer = MarkdownPreviewer() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
Task { | |
await prepareMarkdown(from: "https://www.awesomemarkdownresourcetouse.com") |
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 | |
class MarkdownPreviewViewController: UIViewController { | |
@IBOutlet weak var markdownTextView: UITextView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
Task { | |
await prepareMarkdown(from: "https://www.awesomemarkdownsource.com") | |
} |
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
Notes for Creating a Cocoa Pod | |
Pod Version: 0.39.0 | |
OS: OS X El Capitain (10.11.3) | |
- - - - - - - - - - - - - - - - - - - - - - - | |
1. Install CocoaPods (https://guides.cocoapods.org/using/getting-started.html) | |
2. Create Xcode project to author the Pod |
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
class BookListViewController: UIViewController { } | |
class CommentsViewController: UIViewController { | |
var productId: Int? | |
} |
NewerOlder