diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 1d74f64..c1443af 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 1d74f647aaeec653a3ab55d7c06a0b3c0dc95069 +Subproject commit c1443afa0ede9100a0cc64a9d985636b6384af01 diff --git a/Delta/Game Selection/GameCollectionViewController.swift b/Delta/Game Selection/GameCollectionViewController.swift index 830b770..ac90b02 100644 --- a/Delta/Game Selection/GameCollectionViewController.swift +++ b/Delta/Game Selection/GameCollectionViewController.swift @@ -340,7 +340,7 @@ private extension GameCollectionViewController func rename(_ game: Game, with name: String) { - guard name.characters.count > 0 else { return } + guard name.count > 0 else { return } DatabaseManager.shared.performBackgroundTask { (context) in let game = context.object(with: game.objectID) as! Game @@ -401,7 +401,7 @@ private extension GameCollectionViewController @objc func textFieldTextDidChange(_ textField: UITextField) { let text = textField.text ?? "" - self._renameAction?.isEnabled = text.characters.count > 0 + self._renameAction?.isEnabled = text.count > 0 } @objc func handleLongPressGesture(_ gestureRecognizer: UILongPressGestureRecognizer) diff --git a/Delta/Pause Menu/Cheats/CheatTextView.swift b/Delta/Pause Menu/Cheats/CheatTextView.swift index 8c55458..0cf9966 100644 --- a/Delta/Pause Menu/Cheats/CheatTextView.swift +++ b/Delta/Pause Menu/Cheats/CheatTextView.swift @@ -49,7 +49,7 @@ extension CheatTextView { let characterWidth = ("A" as NSString).size(withAttributes: [.font: font]).width - let width = characterWidth * CGFloat(format.format.characters.count) + let width = characterWidth * CGFloat(format.format.count) self.textContainer.size = CGSize(width: width, height: 0) } } @@ -134,7 +134,7 @@ extension CheatTextView: NSLayoutManagerDelegate if let prefix = attributedFormat.attributes(at: characterIndex, effectiveRange: nil)[.cheatPrefix] as? String { // If there is a prefix string, we insert the glyphs (and associated properties/character indexes) first - let prefixCount = prefix.characters.count + let prefixCount = prefix.count for j in 0 ..< prefixCount { diff --git a/Delta/Pause Menu/Cheats/CheatValidator.swift b/Delta/Pause Menu/Cheats/CheatValidator.swift index 19d8440..6c38128 100644 --- a/Delta/Pause Menu/Cheats/CheatValidator.swift +++ b/Delta/Pause Menu/Cheats/CheatValidator.swift @@ -51,7 +51,7 @@ struct CheatValidator // Remove newline characters (code should already be formatted) let sanitizedCode = (cheat.code as NSString).replacingOccurrences(of: "\n", with: "") - if sanitizedCode.characters.count % self.format.format.characters.count != 0 + if sanitizedCode.count % self.format.format.count != 0 { throw Error.invalidCode } diff --git a/Delta/Pause Menu/Cheats/EditCheatViewController.swift b/Delta/Pause Menu/Cheats/EditCheatViewController.swift index dca907d..616555b 100644 --- a/Delta/Pause Menu/Cheats/EditCheatViewController.swift +++ b/Delta/Pause Menu/Cheats/EditCheatViewController.swift @@ -132,7 +132,7 @@ extension EditCheatViewController // Update UI - if name.characters.count == 0 + if name.count == 0 { self.title = NSLocalizedString("Cheat", comment: "") } @@ -224,7 +224,7 @@ private extension EditCheatViewController @IBAction func updateCheatName(_ sender: UITextField) { var title = sender.text ?? "" - if title.characters.count == 0 + if title.count == 0 { title = NSLocalizedString("Cheat", comment: "") } diff --git a/Delta/Pause Menu/Save States/SaveStatesViewController.swift b/Delta/Pause Menu/Save States/SaveStatesViewController.swift index 0d1a960..588c3b9 100644 --- a/Delta/Pause Menu/Save States/SaveStatesViewController.swift +++ b/Delta/Pause Menu/Save States/SaveStatesViewController.swift @@ -377,7 +377,7 @@ private extension SaveStatesViewController func rename(_ saveState: SaveState, with name: String?) { var name = name - if (name ?? "").characters.count == 0 + if (name ?? "").count == 0 { // When text is nil, we know to show the timestamp instead name = nil