Skip to content

Commit

Permalink
- fix SwiftLint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schwarz committed Aug 29, 2023
1 parent 72e9873 commit 40dfc92
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ios-sdk
4 changes: 2 additions & 2 deletions ownCloudAppShared/AppLock/PasscodeSetupCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ public class PasscodeSetupCoordinator {
public func showDigitsCountSelectionUI() {
var title = "Passcode option".localized
var message = "Please choose how many digits you want to use for the passcode lock?".localized

if AppLockSettings.shared.isPasscodeEnforced {
title = "Passcode setup".localized
message = "To use the app, you need to create a passcode.".localized + "\n\n" + message
}

let alertController = ThemedAlertController(title: title, message: message, preferredStyle: .alert)

if let popoverController = alertController.popoverPresentationController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ extension OCShare: DataItemSelectionInteraction {
// Single share
editViewController = ShareViewController(mode: .edit, share: self, clientContext: context, completion: { _ in })
}

if let editViewController {
let navigationController = ThemeNavigationController(rootViewController: editViewController)
context.present(navigationController, animated: true)
Expand Down
16 changes: 8 additions & 8 deletions ownCloudAppShared/Client/Sharing/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ open class ShareViewController: CollectionViewController, SearchViewControllerDe
self.item = (item != nil) ? item! : ((location != nil) ? try? clientContext.core?.cachedItem(at: location!) : nil)
self.mode = mode
self.completionHandler = completion

// Item section
if let item = item {
let itemSectionContext = ClientContext(with: clientContext, modifier: { context in
context.permissions = []
})
var itemSectionDatasource = OCDataSourceArray(items: [item])
var itemSection = CollectionViewSection(identifier: "item", dataSource: itemSectionDatasource, cellStyle: .init(with: .header), cellLayout: .list(appearance: .plain, contentInsets: NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)), clientContext: itemSectionContext)
let itemSectionDatasource = OCDataSourceArray(items: [item])
let itemSection = CollectionViewSection(identifier: "item", dataSource: itemSectionDatasource, cellStyle: .init(with: .header), cellLayout: .list(appearance: .plain, contentInsets: NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)), clientContext: itemSectionContext)
sections.append(itemSection)
}

Expand Down Expand Up @@ -231,19 +231,19 @@ open class ShareViewController: CollectionViewController, SearchViewControllerDe

// Set navigation bar title
var navigationTitle: String?

switch mode {
case .create:
navigationTitle = (type == .link) ? "Create link".localized : "Invite".localized

case .edit:
navigationTitle = "Edit".localized
}
navigationItem.titleLabelText = navigationTitle

// Add bottom button bar
let title = (mode == .create) ? ((type == .link) ? "Create link".localized : "Invite".localized) : "Save changes".localized

bottomButtonBar = BottomButtonBar(selectButtonTitle: title, cancelButtonTitle: "Cancel".localized, hasCancelButton: true, selectAction: UIAction(handler: { [weak self] _ in
self?.save()
}), cancelAction: UIAction(handler: { [weak self] _ in
Expand All @@ -258,7 +258,7 @@ open class ShareViewController: CollectionViewController, SearchViewControllerDe
if mode == .edit {
let unshare = UIBarButtonItem(title: "Unshare".localized, style: .plain, target: self, action: #selector(deleteShare))
unshare.tintColor = .red

self.navigationItem.rightBarButtonItem = unshare
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ extension ClientSidebarViewController {
// Keep aspect ratio + scale logo to 90% of available height
logoImageView.widthAnchor.constraint(equalTo: logoImageView.heightAnchor, multiplier: (logoImage.size.width / logoImage.size.height) * 0.9).isActive = true
}

let logoLabel = ThemeCSSLabel()
logoLabel.translatesAutoresizingMaskIntoConstraints = false
logoLabel.text = VendorServices.shared.appName
logoLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold)
logoLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
logoLabel.setContentCompressionResistancePriority(.required, for: .vertical)

let logoContainer = ThemeCSSView(withSelectors: [.logo])
logoContainer.translatesAutoresizingMaskIntoConstraints = false
logoContainer.addSubview(logoImageView)
Expand Down

0 comments on commit 40dfc92

Please sign in to comment.