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
manager.pausesLocationUpdatesAutomatically = false |
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
manager.activityType = .automotiveNavigation |
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
releaseConfig="Release" | |
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then | |
if [ -z "$FASTLANE_LANE_NAME" ]; then | |
echo "error: This project cannot be archived manually. Releases should only be built using Fastlane." | |
exit -1 | |
fi | |
fi |
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 ExampleViewModel { | |
let title: String | |
let detail: String | |
let message: String | |
} | |
final class ExampleView: UIView { | |
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 PixelTest | |
class DynamicTypeSnapshotTests: PixelTestCase { | |
override func setUp() { | |
super.setUp() | |
mode = .test | |
} | |
func test_simpleData() throws { |
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 ExampleView: UIView { | |
@IBOutlet private var titleLabel: UILabel! | |
@IBOutlet private var detailLabel: UILabel! | |
@IBOutlet private var messageLabel: UILabel! | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
setupDynamicType() | |
} |
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
func test_extraSmallDynamicType() throws { | |
let view = ExampleView.loadFromNib() | |
let viewModel = ExampleViewModel(title: "A short title", detail: "A subtitle", message: "This is the message!") | |
let traitCollection = UITraitCollection(preferredContentSizeCategory: .extraSmall) | |
view.configure(with: viewModel, traitCollection: traitCollection) | |
try verify(view, layoutStyle: .dynamicHeight(fixedWidth: 320)) | |
} | |
func test_accessibilityExtraExtraExtraLarge() throws { | |
let view = ExampleView.loadFromNib() |
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 CellDelegate: class { | |
func cellValueForToggle(_ cell: Cell) -> Bool | |
func cell(_ cell: Cell, didUpdateValueForToggle value: Bool) | |
} | |
class Cell: UITableViewCell { | |
weak var delegate: CellDelegate? |
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
class ViewController: UIViewController, CellDelegate { | |
func cellValueForToggle(_ cell: Cell) -> Bool { | |
// Find the value for that cell somehow | |
} | |
func cell(_ cell: Cell, didUpdateValueForToggle value: Bool) { | |
// Update the value for that cell in your preferences | |
} | |
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
let settings = Settings() | |
var value: Bool = settings[keyPath: \Settings.prefersFahrenheit] | |
settings[keyPath: \Settings.prefersFahrenheit] = true |