diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 72a740bb9..1ad368e43 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -48,12 +48,12 @@ struct AppAssets { return UIImage(systemName: "circle")! }() - static var chevronDownImage: UIImage = { - return UIImage(systemName: "chevron.down")! + static var chevronSmallImage: UIImage = { + return UIImage(named: "chevronSmall")! }() - static var chevronRightImage: UIImage = { - return UIImage(systemName: "chevron.right")! + static var chevronBaseImage: UIImage = { + return UIImage(named: "chevronBase")! }() static var copyImage: UIImage = { diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift index 662f39903..6b82c7bd7 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift @@ -152,15 +152,18 @@ private extension MasterFeedTableViewCell { func addDisclosureView() { disclosureButton = NonIntrinsicButton(type: .roundedRect) disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside) + disclosureButton?.setImage(AppAssets.chevronBaseImage, for: .normal) updateDisclosureImage() addSubviewAtInit(disclosureButton!) } func updateDisclosureImage() { - if disclosureExpanded { - disclosureButton?.setImage(AppAssets.chevronDownImage, for: .normal) - } else { - disclosureButton?.setImage(AppAssets.chevronRightImage, for: .normal) + UIView.animate(withDuration: 0.3) { + if self.disclosureExpanded { + self.disclosureButton?.imageView?.transform = CGAffineTransform(rotationAngle: 1.570796) + } else { + self.disclosureButton?.imageView?.transform = CGAffineTransform(rotationAngle: 0) + } } } diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift index 78762da1c..901184ec6 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift @@ -66,6 +66,8 @@ class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView { private let unreadCountView = MasterFeedUnreadCountView(frame: CGRect.zero) private var disclosureView: UIImageView = { let iView = NonIntrinsicImageView() + iView.tintColor = UIColor.tertiaryLabel + iView.image = AppAssets.chevronSmallImage iView.contentMode = .center return iView }() @@ -131,11 +133,12 @@ private extension MasterFeedTableViewSectionHeader { } func updateDisclosureImage() { - disclosureView.tintColor = UIColor.tertiaryLabel - if disclosureExpanded { - disclosureView.image = AppAssets.chevronDownImage - } else { - disclosureView.image = AppAssets.chevronRightImage + UIView.animate(withDuration: 0.3) { + if self.disclosureExpanded { + self.disclosureView.transform = CGAffineTransform(rotationAngle: 1.570796) + } else { + self.disclosureView.transform = CGAffineTransform(rotationAngle: 0) + } } } diff --git a/iOS/Resources/Assets.xcassets/chevronBase.imageset/Contents.json b/iOS/Resources/Assets.xcassets/chevronBase.imageset/Contents.json new file mode 100644 index 000000000..19c2e918a --- /dev/null +++ b/iOS/Resources/Assets.xcassets/chevronBase.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "chevron-base.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/chevronBase.imageset/chevron-base.pdf b/iOS/Resources/Assets.xcassets/chevronBase.imageset/chevron-base.pdf new file mode 100644 index 000000000..610968af4 Binary files /dev/null and b/iOS/Resources/Assets.xcassets/chevronBase.imageset/chevron-base.pdf differ diff --git a/iOS/Resources/Assets.xcassets/chevronSmall.imageset/Contents.json b/iOS/Resources/Assets.xcassets/chevronSmall.imageset/Contents.json new file mode 100644 index 000000000..6ffaf1016 --- /dev/null +++ b/iOS/Resources/Assets.xcassets/chevronSmall.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "chevron-small.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/chevronSmall.imageset/chevron-small.pdf b/iOS/Resources/Assets.xcassets/chevronSmall.imageset/chevron-small.pdf new file mode 100644 index 000000000..7f9873a86 Binary files /dev/null and b/iOS/Resources/Assets.xcassets/chevronSmall.imageset/chevron-small.pdf differ