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
module "ios-ci-arm-xcode-14-2" { | |
source = "../modules/ios-platform" | |
instance_type = "mac2.metal" | |
launch_template_version = 23 | |
ami_filter = "ios-ci-xcode_14_2_0-*" | |
max_num_instances = # redacted | |
max_num_instances_weekends = # redacted | |
buildkite_tags = { |
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
$ time ./make_ami.rb \ | |
--instance-type mac2.metal \ | |
--source-ami macos_arm_autologin_enabled \ | |
--xcode-version 'Xcode 14.2.0 (14C18)' | |
# real 60m21.652s | |
# user 0m41.418s | |
# sys 0m32.152s |
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
// animalsViewController.preferredFocusedView => catButton | |
// animalsViewController.view.preferredFocusedView => pigButton | |
animalsViewController.setNeedsFocusUpdate() | |
animalsViewController.view.setNeedsFocusUpdate() | |
animalsViewController.view.updateFocusIfNeeded() | |
// UIScreen.mainScreen().focusedView => catButton |
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
// animalsViewController.preferredFocusedView => catButton | |
animalsViewController.setNeedsFocusUpdate() | |
animalsViewController.updateFocusIfNeeded() | |
// UIScreen.mainScreen().focusedView => catButton |
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
// catButton.preferredFocusedView => catButton | |
catButton.setNeedsFocusUpdate() | |
catButton.updateFocusIfNeeded() | |
// UIScreen.mainScreen().focusedView => dogButton |
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 AnimalsViewController: UIViewController { | |
let dogButton: UIButton | |
let catButton: UIButton | |
let pigButton: UIButton | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(dogButton) | |
view.addSubview(catButton) |
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 ActionHeroesView: UIView { | |
let stalloneButton: UIButton | |
let vanDammeButton: UIButton | |
// ... | |
override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) { | |
super.didUpdateFocusInContext(context, withAnimationCoordinator: coordinator) | |
// we'll center Stallone when neither is in focus since he's a bigger deal |
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 collectionView(collectionView: UICollectionView, shouldUpdateFocusInContext context: UICollectionViewFocusUpdateContext) -> Bool { | |
guard let indexPaths = collectionView.indexPathsForSelectedItems() else { return true } | |
return indexPaths.isEmpty | |
} | |
func collectionView(collectionView: UICollectionView, shouldSelectItemAtIndexPath indexPath: NSIndexPath) -> Bool { | |
if let indexPath = collectionView.indexPathsForSelectedItems()?.first { | |
collectionView.deselectItemAtIndexPath(indexPath, animated: true) | |
return 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
UIScreen.mainScreen().focusedView // possibly 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
myButton.focused // true or false |
NewerOlder