Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

none #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension RepoFileHistoryQuery.Data {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.paragraphSpacing = 12
paragraphStyle.lineSpacing = 2
let attributes: [NSAttributedStringKey: Any] = [
let attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Gray.dark.color,
.paragraphStyle: paragraphStyle,
.backgroundColor: UIColor.white
Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Comments/Html/IssueCommentHtmlCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ final class IssueCommentHtmlCell: IssueCommentBaseCell, ListBindable, UIWebViewD

// MARK: UIWebViewDelegate

func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool {
// if the cell is hidden, its been put back in the reuse pool
guard isHidden == false, let url = request.url else { return true }

Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Comments/Images/IssueCommentImageCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class IssueCommentImageCell: IssueCommentBaseCell, ListBindable {

let imageView = FLAnimatedImageView()

private let spinner = UIActivityIndicatorView(activityIndicatorStyle: .gray)
private let spinner = UIActivityIndicatorView(style: .gray)
private var tapGesture: UITapGestureRecognizer!

override init(frame: CGRect) {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Issues/Comments/IssueCommentBaseCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IssueCommentBaseCell: UICollectionViewCell, UIGestureRecognizerDelegate {

collapseButton.setImage(UIImage(named: "bullets").withRenderingMode(.alwaysTemplate), for: .normal)
collapseButton.backgroundColor = Styles.Colors.Blue.medium.color
collapseButton.accessibilityTraits = UIAccessibilityTraitNone
collapseButton.accessibilityTraits = .none
collapseButton.tintColor = .white
collapseButton.titleLabel?.font = Styles.Text.smallTitle.preferredFont
collapseButton.isHidden = true
Expand All @@ -65,7 +65,7 @@ class IssueCommentBaseCell: UICollectionViewCell, UIGestureRecognizerDelegate {

if collapseLayer.isHidden == false {
contentView.layer.addSublayer(collapseLayer)
contentView.bringSubview(toFront: collapseButton)
contentView.bringSubviewToFront(collapseButton)

let collapseFrame = CGRect(
x: contentBounds.minX,
Expand Down
4 changes: 2 additions & 2 deletions Classes/Issues/Comments/Markdown/CMarkParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ private extension TextElement {
children.build(builder, options: options, context: context)
case .strikethrough(let children):
builder.add(attributes: [
.strikethroughStyle: NSUnderlineStyle.styleSingle.rawValue,
.strikethroughStyle: NSUnderlineStyle.single.rawValue,
.strikethroughColor: builder.tipAttributes?[.foregroundColor] ?? Styles.Colors.Gray.dark.color
])
children.build(builder, options: options, context: context)
case .link(let children, _, let url):
var attributes: [NSAttributedStringKey: Any] = [
var attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Blue.medium.color,
.highlight: true
]
Expand Down
22 changes: 11 additions & 11 deletions Classes/Issues/Comments/Markdown/MarkdownAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
import Foundation

enum MarkdownAttribute {
static let url = NSAttributedStringKey(rawValue: "com.freetime.Markdown.url-name")
static let email = NSAttributedStringKey(rawValue: "com.freetime.Markdown.email-name")
static let username = NSAttributedStringKey(rawValue: "com.freetime.Markdown.username-name")
static let usernameDisabled = NSAttributedStringKey(rawValue: "com.freetime.Markdown.username-disabled-name")
static let linkShorteningDisabled = NSAttributedStringKey(rawValue: "com.freetime.Markdown.link-shortening-disabled-name")
static let issue = NSAttributedStringKey(rawValue: "com.freetime.Markdown.issue")
static let details = NSAttributedStringKey(rawValue: "com.freetime.Markdown.details")
static let label = NSAttributedStringKey(rawValue: "com.freetime.Markdown.label")
static let commit = NSAttributedStringKey(rawValue: "com.freetime.Markdown.commit")
static let checkbox = NSAttributedStringKey(rawValue: "com.freetime.Markdown.checkbox")
static let url = NSAttributedString.Key(rawValue: "com.freetime.Markdown.url-name")
static let email = NSAttributedString.Key(rawValue: "com.freetime.Markdown.email-name")
static let username = NSAttributedString.Key(rawValue: "com.freetime.Markdown.username-name")
static let usernameDisabled = NSAttributedString.Key(rawValue: "com.freetime.Markdown.username-disabled-name")
static let linkShorteningDisabled = NSAttributedString.Key(rawValue: "com.freetime.Markdown.link-shortening-disabled-name")
static let issue = NSAttributedString.Key(rawValue: "com.freetime.Markdown.issue")
static let details = NSAttributedString.Key(rawValue: "com.freetime.Markdown.details")
static let label = NSAttributedString.Key(rawValue: "com.freetime.Markdown.label")
static let commit = NSAttributedString.Key(rawValue: "com.freetime.Markdown.commit")
static let checkbox = NSAttributedString.Key(rawValue: "com.freetime.Markdown.checkbox")

static let all = Set<NSAttributedStringKey>([
static let all = Set<NSAttributedString.Key>([
url,
email,
username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension StyledTextBuilder {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.paragraphSpacing = 12
paragraphStyle.lineSpacing = 2
let attributes: [NSAttributedStringKey: Any] = [
let attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Gray.dark.color,
.paragraphStyle: paragraphStyle,
.backgroundColor: UIColor.white
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

extension UIFont {

func addingTraits(traits: UIFontDescriptorSymbolicTraits) -> UIFont {
func addingTraits(traits: UIFontDescriptor.SymbolicTraits) -> UIFont {
let newTraits = fontDescriptor.symbolicTraits.union(traits)
guard let descriptor = fontDescriptor.withSymbolicTraits(newTraits)
else { return self }
Expand Down
8 changes: 4 additions & 4 deletions Classes/Issues/Comments/Reactions/IssueReactionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class IssueReactionCell: UICollectionViewCell {

override init(frame: CGRect) {
super.init(frame: frame)
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)
isAccessibilityElement = true

emojiLabel.textAlignment = .center
Expand Down Expand Up @@ -122,9 +122,9 @@ final class IssueReactionCell: UICollectionViewCell {
func iterate(add: Bool) {
let animation = CATransition()
animation.duration = 0.25
animation.type = kCATransitionPush
animation.subtype = add ? kCATransitionFromTop : kCATransitionFromBottom
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.type = .push
animation.subtype = add ? .fromTop : .fromBottom
animation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
countLabel.layer.add(animation, forKey: "text-change")
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Commit/IssueCommitCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class IssueCommitCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
isAccessibilityElement = true
accessibilityTraits = UIAccessibilityTraitButton
accessibilityTraits = .button

commitImageView.contentMode = .scaleAspectFit
commitImageView.tintColor = Styles.Colors.Gray.light.color
Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Files/IssueFileCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class IssueFileCell: SelectableCell {

func configure(path: String, additions: Int, deletions: Int, disclosureHidden: Bool) {
let changeString = NSMutableAttributedString()
var attributes: [NSAttributedStringKey: Any] = [
var attributes: [NSAttributedString.Key: Any] = [
.font: Styles.Text.secondaryBold.preferredFont
]

Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Files/IssueViewFilesCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class IssueViewFilesCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
isAccessibilityElement = true
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)

contentView.addSubview(label)
label.snp.makeConstraints { make in
Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/IssueTextActionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final class IssueTextActionsView: UIView, UICollectionViewDataSource, UICollecti
private let sendButtonGradientLayer = CAGradientLayer()
private let sendButton = UIButton()
private let activityIndicator = UIActivityIndicatorView(
activityIndicatorStyle: UIActivityIndicatorViewStyle.gray
style: .gray
)

public var sendButtonEnabled: Bool {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Managing/IssueManagingActionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class IssueManagingActionCell: UICollectionViewCell, ListBindable {

override init(frame: CGRect) {
super.init(frame: frame)
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)
isAccessibilityElement = true

let tint = Styles.Colors.Blue.medium.color
Expand Down
2 changes: 1 addition & 1 deletion Classes/Issues/Managing/IssueManagingExpansionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class IssueManagingExpansionCell: UICollectionViewCell, ListBindable {

override init(frame: CGRect) {
super.init(frame: frame)
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)
isAccessibilityElement = true

backgroundHighlightView.backgroundColor = UIColor(white: 0, alpha: 0.07)
Expand Down
8 changes: 4 additions & 4 deletions Classes/Issues/Merge/MergeButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class MergeButton: UIControl {

private let mergeLabel = UILabel()
private let optionBorder = UIView()
private let activityView = UIActivityIndicatorView(activityIndicatorStyle: .gray)
private let activityView = UIActivityIndicatorView(style: .gray)
private let gradientLayer = CAGradientLayer()

override init(frame: CGRect) {
Expand All @@ -50,7 +50,7 @@ final class MergeButton: UIControl {
optionButton.imageView?.contentMode = .center
optionButton.setImage(image, for: .normal)
optionButton.isAccessibilityElement = true
optionButton.accessibilityTraits = UIAccessibilityTraitButton
optionButton.accessibilityTraits = .button
optionButton.addTarget(self, action: #selector(onOptionsTouch), for: .touchUpInside)
optionButton.snp.makeConstraints { make in
make.top.right.bottom.equalToSuperview()
Expand Down Expand Up @@ -108,7 +108,7 @@ final class MergeButton: UIControl {
layer.addSublayer(gradientLayer)

[mergeLabel, optionButton, optionBorder, activityView].forEach {
bringSubview(toFront: $0)
bringSubviewToFront($0)
}
} else {
gradientLayer.removeFromSuperlayer()
Expand Down Expand Up @@ -147,7 +147,7 @@ final class MergeButton: UIControl {
height: bounds.size.height
)
)
element.accessibilityTraits |= UIAccessibilityTraitButton
element.accessibilityTraits.insert(.button)
return element
}

Expand Down
6 changes: 3 additions & 3 deletions Classes/Issues/Milestone/IssueMilestoneCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class IssueMilestoneCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
isAccessibilityElement = true
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)

titleLabel.backgroundColor = .clear
contentView.addSubview(titleLabel)
Expand Down Expand Up @@ -51,15 +51,15 @@ final class IssueMilestoneCell: UICollectionViewCell {
// MARK: Public API

func configure(milestone: Milestone) {
let milestoneAttributes: [NSAttributedStringKey: Any] = [
let milestoneAttributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Gray.light.color,
.font: Styles.Text.secondary.preferredFont
]
let titleText = NSMutableAttributedString(
string: NSLocalizedString("Milestone: ", comment: ""),
attributes: milestoneAttributes
)
let titleAttributes: [NSAttributedStringKey: Any] = [
let titleAttributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Gray.dark.color,
.font: Styles.Text.secondaryBold.preferredFont
]
Expand Down
12 changes: 6 additions & 6 deletions Classes/Issues/Renamed/IssueRenamedCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ final class IssueRenamedCell: UICollectionViewCell {
// MARK: Public API

func configure(_ model: IssueRenamedModel) {
let actorAttributes = [
NSAttributedStringKey.font: Styles.Text.secondaryBold.preferredFont,
NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.dark.color
let actorAttributes: [NSAttributedString.Key: Any] = [
.font: Styles.Text.secondaryBold.preferredFont,
.foregroundColor: Styles.Colors.Gray.dark.color
]
let actor = NSMutableAttributedString(string: model.actor, attributes: actorAttributes)
let referencedAttributes = [
NSAttributedStringKey.font: Styles.Text.secondary.preferredFont,
NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.medium.color
let referencedAttributes: [NSAttributedString.Key: Any] = [
.font: Styles.Text.secondary.preferredFont,
.foregroundColor: Styles.Colors.Gray.medium.color
]
actor.append(NSAttributedString(
string: NSLocalizedString(" renamed", comment: ""),
Expand Down
8 changes: 4 additions & 4 deletions Classes/Issues/Review/IssueReviewDetailsCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ final class IssueReviewDetailsCell: IssueCommentBaseCell, ListBindable {
icon.tintColor = iconTintColor
icon.image = UIImage(named: iconName)?.withRenderingMode(.alwaysTemplate)

var attributes = [
NSAttributedStringKey.font: Styles.Text.title.preferredFont,
NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.medium.color
var attributes: [NSAttributedString.Key: Any] = [
.font: Styles.Text.title.preferredFont,
.foregroundColor: Styles.Colors.Gray.medium.color
]
let mActorString = NSMutableAttributedString(string: viewModel.actor, attributes: attributes)

attributes[NSAttributedStringKey.font] = Styles.Text.secondary.preferredFont
attributes[.font] = Styles.Text.secondary.preferredFont
mActorString.append(NSAttributedString(string: " \(action)", attributes: attributes))
actorButton.setAttributedTitle(mActorString, for: .normal)
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Issues/StatusEvent/IssueStatusEventCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ final class IssueStatusEventCell: UICollectionViewCell {
// MARK: Public API

func configure(_ model: IssueStatusEventModel) {
let actorAttributes = [
NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.dark.color,
NSAttributedStringKey.font: Styles.Text.secondaryBold.preferredFont
let actorAttributes: [NSAttributedString.Key: Any] = [
.foregroundColor: Styles.Colors.Gray.dark.color,
.font: Styles.Text.secondaryBold.preferredFont
]
actorButton.setAttributedTitle(NSAttributedString(string: model.actor, attributes: actorAttributes), for: .normal)

Expand Down
2 changes: 1 addition & 1 deletion Classes/Labels/LabelMenuCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class LabelMenuCell: SelectableCell {
contentView.backgroundColor = nil

isAccessibilityElement = true
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)

contentView.addSubview(checkedImageView)
checkedImageView.tintColor = Styles.Colors.Blue.menu.color
Expand Down
8 changes: 4 additions & 4 deletions Classes/Login/SplashView/SplashView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ final class SplashView: UIView {
pulseAnimation.fromValue = 1.0
pulseAnimation.toValue = 0.9
pulseAnimation.duration = 2
pulseAnimation.fillMode = kCAFillModeForwards
pulseAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
pulseAnimation.fillMode = .forwards
pulseAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)

birdImageView.layer.add(pulseAnimation, forKey: "scaling")
}
Expand All @@ -71,8 +71,8 @@ final class SplashView: UIView {
rotateAnimation.repeatCount = .infinity
rotateAnimation.byValue = 2 * Double.pi
rotateAnimation.duration = 120
rotateAnimation.fillMode = kCAFillModeForwards
rotateAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
rotateAnimation.fillMode = .forwards
rotateAnimation.timingFunction = CAMediaTimingFunction(name: .linear)

branchesImageView.layer.add(rotateAnimation, forKey: "rotation")
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Milestones/MilestoneCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class MilestoneCell2: SelectableCell {
contentView.backgroundColor = nil

isAccessibilityElement = true
accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)

contentView.addSubview(checkedImageView)
checkedImageView.tintColor = Styles.Colors.Blue.menu.color
Expand Down
8 changes: 4 additions & 4 deletions Classes/Notifications/InboxDashboardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class InboxDashboardCell: SelectableCell {
override init(frame: CGRect) {
super.init(frame: frame)

accessibilityTraits |= UIAccessibilityTraitButton
accessibilityTraits.insert(.button)
isAccessibilityElement = true

backgroundColor = .white
Expand Down Expand Up @@ -84,9 +84,9 @@ final class InboxDashboardCell: SelectableCell {
textView.configure(with: model.text, width: contentView.bounds.width)
dateLabel.setText(date: model.date, format: .short)

var titleAttributes = [
NSAttributedStringKey.font: Styles.Text.title.preferredFont,
NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.light.color
var titleAttributes: [NSAttributedString.Key: Any] = [
.font: Styles.Text.title.preferredFont,
.foregroundColor: Styles.Colors.Gray.light.color
]
let title = NSMutableAttributedString(string: "\(model.owner)/\(model.name) ", attributes: titleAttributes)
titleAttributes[.font] = Styles.Text.secondary.preferredFont
Expand Down
4 changes: 2 additions & 2 deletions Classes/Notifications/NewFeaturesCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ final class NewFeaturesCell: UICollectionViewCell {

override func layoutSubviews() {
super.layoutSubviews()
contentView.frame = UIEdgeInsetsInsetRect(CGRect(
contentView.frame = CGRect(
x: safeAreaInsets.left,
y: bounds.minY,
width: bounds.width - safeAreaInsets.left - safeAreaInsets.right,
height: bounds.height
), NewFeaturesCell.inset)
).inset(by: NewFeaturesCell.inset)
}

@objc private func onCloseButton() {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Notifications/NoNewNotificationsCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class NoNewNotificationsCell: UICollectionViewCell {
NotificationCenter.default
.addObserver(self,
selector: #selector(resetAnimations),
name: .UIApplicationWillEnterForeground,
name: UIApplication.willEnterForegroundNotification,
object: nil
)

Expand Down Expand Up @@ -132,7 +132,7 @@ final class NoNewNotificationsCell: UICollectionViewCell {

@objc private func resetAnimations() {
guard trueUnlessReduceMotionEnabled else { return }
let timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
let timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
let duration: TimeInterval = 1

let emojiBounce = CABasicAnimation(keyPath: "transform.translation.y")
Expand Down
Loading