| Spotify | Apple Music |
|---|---|
| Amazon Echo integration | Offline Apple Watch playback |
| Smart playlists |
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
| /** | |
| * A class that can be part of a tabbed navigational interface (expected to be a `UIViewController` but can also be a | |
| * coordinator that proxies through to an underlying controller). | |
| */ | |
| public protocol TabComponent { | |
| /// The tab metadata | |
| var tabItem: TabItem { get } | |
| var viewController: UIViewController { get } | |
| } |
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
| protocol TextContaining { | |
| var isEmpty: Bool { get } | |
| } | |
| extension String: TextContaining { | |
| } | |
| extension Optional where Wrapped: TextContaining { | |
| var isEmpty: Bool { | |
| switch self { |
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
| protocol Foo { | |
| } | |
| extension Foo { | |
| func bar() -> Self { return self } | |
| } | |
| extension NSObject: Foo {} | |
| let view = UIView().bar() // Value of type `UIView` has no member `bar` |
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 Foundation | |
| /** | |
| Coordinators are a design pattern that encourages decoupling view controllers such that they know as little as possible | |
| about how they are presented, and don’t directly manipulate data or present other view controllers. Coordinators can be | |
| “nested” such that child coordinators encapsulate different flows and present any from becoming too large. | |
| - https://vimeo.com/144116310 | |
| - http://khanlou.com/2015/10/coordinators-redux/ | |
| - http://khanlou.com/2015/01/the-coordinator/ |
-
When volume switch is On, phone both makes noise and vibrates.
-
When volume switch is Off, phone does not make noise or vibrate.
-
Calls should make noise/vibrate in extenuating cirumstances, e.g. a call from a favorite or two calls within three minutes.
Vibrate on Silent accomplishes 1 and 2, but prevents 3 from occurring.
3 could be accomplished by ignoring the volume switch altogether and using Do Not Disturb to solely determine whether my phone is silent or not. In this case, I would have DND turned on almost all of the time. The problem with this is that when the phone is unlocked/in use, notifications will either A) not be shown at all or B) will cause noise/vibration.
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 CenteringView: UIView { | |
| // MARK: - Initialization | |
| init(contentView: UIView) { | |
| super.init(frame: .zero) | |
| addSubview(contentView) | |
| contentView.translatesAutoresizingMaskIntoConstraints = false | |
| NSLayoutConstraint.activateConstraints([ |
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
| struct ViewControllerSequence { | |
| typealias ViewControllerProducer = Void -> UIViewController | |
| private var storage = TypeDictionary<ViewControllerProducer>() | |
| private var producers: [ViewControllerProducer] | |
| init(_ producers: [ViewControllerProducer]) { | |
| self.producers = producers | |
| } |
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
| protocol Validator { | |
| typealias ValidatedType | |
| func isValid(object: ValidatedType) -> Bool | |
| } | |
| struct NonEmptyValidator: Validator { | |
| func isValid(object: String) -> Bool { | |
| return object.isEmpty | |
| } |