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 Combine | |
let numbers: [Int?] = [1, 2, nil, 3, 4] | |
numbers.publisher | |
.filter { $0 != nil } | |
.sink { print($0) } | |
numbers.publisher | |
.compactMap { $0 } |
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 CloudinaryURLBuilder { | |
// MARK: - Properties | |
private let source: URL | |
// MARK: - | |
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 | |
extension UIColor { | |
enum Cocoacasts { | |
static let green = UIColor(red: 0.40, green: 0.36, blue: 0.28, alpha: 1.0) | |
} | |
} |
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
// Fetch Video | |
playbackService.findVideo(withVideoID: id, parameters: nil, completion: { [weak self] (video, _, error) in | |
if let error = error { | |
// Handle Error | |
} else if let video = video { | |
// Use Video | |
} | |
}) | |
// The `playbackService` object is an instance of the `BCOVPlaybackService` class. |
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
var imagesFromCoreData: [Image]? { | |
guard let _imagesFromCoreData = toImages as? Set<Image> else { return nil } | |
return Array(_imagesFromCoreData) | |
} |
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
[managedObjectContext save: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
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
if segue.identifier == addItemViewController { | |
if let navigationController = segue.destinationViewController as? UINavigationController, | |
let addItemViewController = navigationController.viewControllers.first as? AddItemViewController { | |
addItemViewController.delegate = self | |
} | |
} | |
} |
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
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
if segue.identifier == viewController { | |
let navigationController = segue.destinationViewController as! UINavigationController | |
let addViewController = navigationController.viewControllers.first as! AddViewController | |
addViewController.delegate = self | |
} | |
} |
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
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
if let cell = tableView.dequeueReusableCell(withIdentifier: SettingsTableViewCell.reuseIdentifier, for: indexPath) as? SettingsTableViewCell { | |
// Configure Cell | |
cell.textLabel?.text = "Some Setting" | |
return cell | |
} else { | |
return UITableViewCell() | |
} |
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 | |
enum Section: Int { | |
case news | |
case profile | |
case settings | |
var title: String { | |
switch self { |
NewerOlder