mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
Swift v1.2
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import Orion
|
||||
import UIKit
|
||||
|
||||
class UITabBarHook: ClassHook<UITabBar> {
|
||||
|
||||
// there is only one UITabBar, so no problem
|
||||
func items() -> [UITabBarItem] {
|
||||
return Array(orig.items().prefix(3))
|
||||
}
|
||||
}
|
||||
|
||||
class UITabBarButtonLabelHook: ClassHook<UIView> {
|
||||
|
||||
static let targetName = "UITabBarButtonLabel"
|
||||
|
||||
func text() -> String {
|
||||
|
||||
let text = orig.text()
|
||||
|
||||
if text == "Premium" {
|
||||
target.superview?.removeFromSuperview()
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
}
|
||||
@@ -60,19 +60,18 @@ struct EeveeSpotify: Tweak {
|
||||
|
||||
try blankData.write(to: filePath)
|
||||
NSLog("[EeveeSpotify] Successfully applied")
|
||||
|
||||
Timer.scheduledTimer(withTimeInterval: 20, repeats: true) { _ in
|
||||
do {
|
||||
try blankData.write(to: filePath)
|
||||
NSLog("[EeveeSpotify] Successfully reapplied")
|
||||
}
|
||||
catch {
|
||||
NSLog("[EeveeSpotify] Unable to reapply (write data): \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch {
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
|
||||
|
||||
WindowHelper.shared.showPopup(
|
||||
message: "Unable to apply tweak: \(error)",
|
||||
buttonText: "OK"
|
||||
)
|
||||
}
|
||||
|
||||
NSLog("[EeveeSpotify] Unable to apply tweak: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user