Skip to content
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div align="center">
<h1><b>StikJIT</b></h1>
<p><i> A on-device JIT enabler for iOS versions 17.4+ (excluding iOS 18.4 beta 1), powered by <a href="https://github.com/jkcoxson/idevice">idevice</a> </i></p>
<p><i> An on-device JIT enabler for iOS versions 17.4+ (excluding iOS 18.4 beta 1), powered by <a href="https://github.com/jkcoxson/idevice">idevice</a> </i></p>
</div>
<h6 align="center">

Expand Down
4 changes: 3 additions & 1 deletion StikJIT/StikJITApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ func startHeartbeatInBackground() {
showAlert(
title: "Heartbeat Error",
message: "Failed to connect to Heartbeat (\(result))",
solutionText: "Create a new pairing file",
showOk: false,
showTryAgain: true
) { shouldTryAgain in
Expand Down Expand Up @@ -496,7 +497,7 @@ struct LoadingView: View {
}
}

public func showAlert(title: String, message: String, showOk: Bool, showTryAgain: Bool = false, completion: @escaping (Bool) -> Void) {
public func showAlert(title: String, message: String, solutionText: String? = nil, showOk: Bool, showTryAgain: Bool = false, completion: @escaping (Bool) -> Void) {
DispatchQueue.main.async {
let rootViewController = UIApplication.shared.windows.last?.rootViewController

Expand All @@ -505,6 +506,7 @@ public func showAlert(title: String, message: String, showOk: Bool, showTryAgain
let customErrorView = CustomErrorView(
title: title,
message: message,
solutionText: solutionText,
onDismiss: {
// Called when tapped outside
completion(false)
Expand Down
26 changes: 19 additions & 7 deletions StikJIT/Views/Custom Error View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftUI
struct CustomErrorView: View {
var title: String
var message: String
var solutionText: String? = nil
var onDismiss: () -> Void
var showButton: Bool = true
@State private var opacity: Double = 0
Expand Down Expand Up @@ -68,13 +69,24 @@ struct CustomErrorView: View {
.padding(.horizontal, 12)

// Message
Text(message)
.font(.system(size: 15, design: .rounded))
.foregroundColor(colorScheme == .dark ? .white.opacity(0.9) : .black.opacity(0.9))
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, 12)

VStack(spacing: 8) {
Text(message)
.font(.system(size: 15, design: .rounded))
.foregroundColor(colorScheme == .dark ? .white.opacity(0.9) : .black.opacity(0.9))
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)

// Solution text with underline
if let solution = solutionText {
Text(solution)
.font(.system(size: 15, design: .rounded))
.foregroundColor(colorScheme == .dark ? .white : .blue)
.multilineTextAlignment(.center)
.underline()
.fixedSize(horizontal: false, vertical: true)
}
}
.padding(.horizontal, 12)

// Dismiss button (only shown when showButton is true)
if showButton {
Expand Down