mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 06:15:59 +00:00
Fix icons for iOS 16, add support for showing tablet icon
This commit is contained in:
1 parent
46c44e800c
commit
c59321edd8
3 files changed
+16
-3
No files matched your search
@@ -48,7 +48,10 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
|||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
self.deviceInfo = EndpointInfo(name: Host.current().localizedName ?? "Mac", deviceType: .computer)
|
self.deviceInfo = EndpointInfo(name: Host.current().localizedName ?? "Mac", deviceType: .computer)
|
||||||
#else
|
#else
|
||||||
self.deviceInfo = EndpointInfo(name: UIDevice.current.marketingName.withoutBracketedContent, deviceType: .phone)
|
let marketingName = UIDevice.current.marketingName.withoutBracketedContent
|
||||||
|
let isiPad = UIDevice.current.model == "iPad"
|
||||||
|
|
||||||
|
self.deviceInfo = EndpointInfo(name: marketingName, deviceType: isiPad ? .tablet : .phone)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tcpListener = try! NWListener(using: NWParameters(tls: .none))
|
tcpListener = try! NWListener(using: NWParameters(tls: .none))
|
||||||
|
|||||||
@@ -94,10 +94,20 @@ public struct RemoteDeviceInfo: Codable, Identifiable, Equatable {
|
|||||||
switch type {
|
switch type {
|
||||||
case .computer:
|
case .computer:
|
||||||
return "laptopcomputer"
|
return "laptopcomputer"
|
||||||
|
case .tablet:
|
||||||
|
return "ipad.landscape"
|
||||||
default:
|
default:
|
||||||
return "smartphone"
|
return getSmartphoneIcon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private func getSmartphoneIcon() -> String {
|
||||||
|
if #available(iOS 17.0, macOS 14.0, *) {
|
||||||
|
return "smartphone"
|
||||||
|
}
|
||||||
|
return "iphone"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
"de" : {
|
"de" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "Immer annehmen"
|
"value" : "Immer akzeptieren"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"en" : {
|
"en" : {
|
||||||
|
|||||||
Reference in new issue
Block a user