What do you want to save?
Add Code snippet
New code examples
-
Swift 2022-02-22 23:40:16
how to recieve hex value from NSData swift
extension NSData { func hexString() -> String { return UnsafeBufferPointer<UInt8>(start: UnsafePointer<UInt8>(bytes), count: length) .reduce("") { $0 + String(format: "%02x", $1) } } } Add solution -
Swift 2021-11-18 04:32:17
register for remote notifications swift
// Import the UserNotifications framework and add the UNUserNotificationCenterDelegate in AppDelegate.swift import UserNotifications // Request user permission func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ... Add solution -
Swift 2021-10-27 10:35:12
localized string format swift
// you should have "account.by_user" = "by %@ and %@"; and take this: let localizedString = NSLocalizedString("account.by_user", comment: "any comment") let wantedString = String(format: localizedString, "Pete... Add solution -
Other 2021-10-21 08:37:13
swift hmac256
import CryptoKit let secretString = "my-secret" let key = SymmetricKey(data: secretString.data(using: .utf8)!) let string = "An apple a day keeps anyone away, if you throw it hard enough" let signature = HMAC<SHA256>.authentic... Add solution