diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index 04e7da745..18a992023 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -3843,7 +3843,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -3851,7 +3851,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3870,7 +3870,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -3878,7 +3878,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4198,7 +4198,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -4206,7 +4206,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4312,7 +4312,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4320,7 +4320,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4431,7 +4431,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -4439,7 +4439,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4545,7 +4545,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4553,7 +4553,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4599,7 +4599,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4607,7 +4607,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4622,7 +4622,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4630,7 +4630,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.8.1; + MARKETING_VERSION = 0.8.2; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/Mastodon/Diffiable/Section/StatusSection.swift b/Mastodon/Diffiable/Section/StatusSection.swift index c59951242..35dd535c5 100644 --- a/Mastodon/Diffiable/Section/StatusSection.swift +++ b/Mastodon/Diffiable/Section/StatusSection.swift @@ -101,14 +101,18 @@ extension StatusSection { cell.isAccessibilityElement = true // FIXME: cell.accessibilityLabel = { - [ - cell.statusView.headerInfoLabel.accessibilityLabel, - cell.statusView.nameLabel.accessibilityLabel, - cell.statusView.dateLabel.accessibilityLabel, - cell.statusView.contentMetaText.textView.accessibilityLabel, - ] - .compactMap { $0 } - .joined(separator: " ") + var accessibilityViews: [UIView?] = [] + if !cell.statusView.headerContainerView.isHidden { + accessibilityViews.append(cell.statusView.headerInfoLabel) + } + accessibilityViews.append(contentsOf: [ + cell.statusView.nameLabel, + cell.statusView.dateLabel, + cell.statusView.contentMetaText.textView, + ]) + return accessibilityViews + .compactMap { $0?.accessibilityLabel } + .joined(separator: " ") }() return cell case .status(let objectID, let attribute), @@ -255,6 +259,7 @@ extension StatusSection { // set timestamp let createdAt = (status.reblog ?? status).createdAt cell.statusView.dateLabel.text = createdAt.slowedTimeAgoSinceNow + cell.statusView.dateLabel.accessibilityValue = createdAt.timeAgoSinceNow AppContext.shared.timestampUpdatePublisher .receive(on: RunLoop.main) // will be paused when scrolling (on purpose) .sink { [weak cell] _ in @@ -514,6 +519,7 @@ extension StatusSection { cell.statusView.headerInfoLabel.configure(contentParseResult: parseResult) } .store(in: &cell.disposeBag) + cell.statusView.headerInfoLabel.accessibilityLabel = headerText cell.statusView.headerInfoLabel.isAccessibilityElement = true } else if status.inReplyToID != nil { cell.statusView.headerContainerView.isHidden = false @@ -533,7 +539,8 @@ extension StatusSection { cell.statusView.headerInfoLabel.configure(contentParseResult: parseResult) } .store(in: &cell.disposeBag) - cell.statusView.headerInfoLabel.isAccessibilityElement = true + cell.statusView.headerInfoLabel.accessibilityLabel = headerText + cell.statusView.headerInfoLabel.isAccessibilityElement = status.replyTo != nil } else { cell.statusView.headerContainerView.isHidden = true cell.statusView.headerInfoLabel.isAccessibilityElement = false @@ -554,6 +561,7 @@ extension StatusSection { cell.statusView.nameLabel.configure(contentParseResult: parseResult) } .store(in: &cell.disposeBag) + cell.statusView.nameLabel.accessibilityLabel = nameContent // username cell.statusView.usernameLabel.text = "@" + author.acct // avatar diff --git a/Mastodon/Info.plist b/Mastodon/Info.plist index 1a9dadce9..cbb93eabf 100644 --- a/Mastodon/Info.plist +++ b/Mastodon/Info.plist @@ -2,17 +2,6 @@ - CFBundleURLTypes - - - CFBundleURLSchemes - - mastodon - - CFBundleURLName - org.joinmastodon.app - - CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -27,6 +16,17 @@ $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString $(MARKETING_VERSION) + CFBundleURLTypes + + + CFBundleURLName + org.joinmastodon.app + CFBundleURLSchemes + + mastodon + + + CFBundleVersion $(CURRENT_PROJECT_VERSION) ITSAppUsesNonExemptEncryption diff --git a/Mastodon/Scene/MediaPreview/Paging/Image/MediaPreviewImageViewController.swift b/Mastodon/Scene/MediaPreview/Paging/Image/MediaPreviewImageViewController.swift index 5ec82db97..1bc8fdb2a 100644 --- a/Mastodon/Scene/MediaPreview/Paging/Image/MediaPreviewImageViewController.swift +++ b/Mastodon/Scene/MediaPreview/Paging/Image/MediaPreviewImageViewController.swift @@ -70,35 +70,35 @@ extension MediaPreviewImageViewController { let previewImageViewContextMenuInteraction = UIContextMenuInteraction(delegate: self) previewImageView.addInteraction(previewImageViewContextMenuInteraction) - switch viewModel.item { - case .local(let meta): - self.previewImageView.imageView.image = meta.image - self.previewImageView.setup(image: meta.image, container: self.previewImageView, forceUpdate: true) - self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText - case .status(let meta): - Nuke.loadImage( - with: meta.url, - into: self.previewImageView.imageView - ) { result in - switch result { - case .failure(let error): - break - case .success(let response): - self.previewImageView.setup(image: response.image, container: self.previewImageView, forceUpdate: true) - self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText - } - } - } -// viewModel.image -// .receive(on: RunLoop.main) // use RunLoop prevent set image during zooming (TODO: handle transitioning state) -// .sink { [weak self] image in -// guard let self = self else { return } -// guard let image = image else { return } -// self.previewImageView.imageView.image = image -// self.previewImageView.setup(image: image, container: self.previewImageView, forceUpdate: true) -// self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText +// switch viewModel.item { +// case .local(let meta): +// self.previewImageView.imageView.image = meta.image +// self.previewImageView.setup(image: meta.image, container: self.previewImageView, forceUpdate: true) +// self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText +// case .status(let meta): +// Nuke.loadImage( +// with: meta.url, +// into: self.previewImageView.imageView +// ) { result in +// switch result { +// case .failure(let error): +// break +// case .success(let response): +// self.previewImageView.setup(image: response.image, container: self.previewImageView, forceUpdate: true) +// self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText +// } // } -// .store(in: &disposeBag) +// } + viewModel.image + .receive(on: RunLoop.main) // use RunLoop prevent set image during zooming (TODO: handle transitioning state) + .sink { [weak self] image in + guard let self = self else { return } + guard let image = image else { return } + self.previewImageView.imageView.image = image + self.previewImageView.setup(image: image, container: self.previewImageView, forceUpdate: true) + self.previewImageView.imageView.accessibilityLabel = self.viewModel.altText + } + .store(in: &disposeBag) } }