iOS app running.
Map API key needs to be set in untracked file Config.local.xcconfig Still issues with showing map
This commit is contained in:
@@ -3,5 +3,15 @@ package app.klottr
|
||||
import androidx.compose.ui.window.ComposeUIViewController
|
||||
import platform.UIKit.UIViewController
|
||||
|
||||
fun MainViewController(): UIViewController =
|
||||
ComposeUIViewController { KlottrRoot() }
|
||||
fun MainViewController(
|
||||
onRequestPerms: () -> Unit = {},
|
||||
onLogin: () -> Unit = {},
|
||||
onLogout: () -> Unit = {},
|
||||
): UIViewController =
|
||||
ComposeUIViewController {
|
||||
KlottrAppShell(
|
||||
onRequestPerms = onRequestPerms,
|
||||
onLogin = onLogin,
|
||||
onLogout = onLogout
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,8 +18,11 @@ actual object KLog {
|
||||
private fun log(level: String, tag: String?, text: () -> String) {
|
||||
if (!enabled) return
|
||||
val tg = tagOrDefault(tag)
|
||||
// %@ konverterar Kotlin String -> NSString
|
||||
NSLog("[$level][%@] %@", tg, text())
|
||||
// Build string in kotlin
|
||||
val msg = "[$level][$tg] ${text()}"
|
||||
// Pass a single argument to avoid C-varargs issues
|
||||
val safe = msg.replace("%", "%%") // prevent accidental format parsing
|
||||
NSLog(safe)
|
||||
}
|
||||
|
||||
actual fun d(tag: String?, msg: () -> String) = log("D", tag, msg)
|
||||
@@ -29,10 +32,10 @@ actual object KLog {
|
||||
actual fun e(tag: String?, t: Throwable?, msg: () -> String) {
|
||||
if (!enabled) return
|
||||
val tg = tagOrDefault(tag)
|
||||
if (t != null) {
|
||||
NSLog("[E][%@] %@ — %@", tg, msg(), t.stackTraceToString())
|
||||
} else {
|
||||
NSLog("[E][%@] %@", tg, msg())
|
||||
}
|
||||
val base = "[E][$tg] ${msg()}"
|
||||
val full = if (t != null) "$base — ${t.stackTraceToString()}" else base
|
||||
|
||||
val safe = full.replace("%", "%%") // prevent accidental format parsing
|
||||
NSLog(safe)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user