-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from appwrite/dev
Fix msg91 params
- Loading branch information
Showing
12 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-swift.svg?color=green&style=flat-square) | ||
![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.5.4-blue.svg?style=flat-square) | ||
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) | ||
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) | ||
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) | ||
|
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: | |
|
||
```swift | ||
dependencies: [ | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "5.0.0"), | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "5.0.1"), | ||
], | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...pwrite/DeviceInfo/iOS/iOSDeviceInfo.swift → ...pwrite/DeviceInfo/iOS/IOSDeviceInfo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#if os(iOS) || os(tvOS) | ||
#if os(iOS) || os(tvOS) || os(visionOS) | ||
import Foundation | ||
import UIKit | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import Foundation | ||
|
||
public class ID { | ||
// Generate an hex ID based on timestamp | ||
// Recreated from https://www.php.net/manual/en/function.uniqid.php | ||
private static func hexTimestamp() -> String { | ||
let now = Date() | ||
let secs = Int(now.timeIntervalSince1970) | ||
let usec = Int((now.timeIntervalSince1970 - Double(secs)) * 1_000_000) | ||
let hexTimestamp = String(format: "%08x%05x", secs, usec) | ||
return hexTimestamp | ||
} | ||
|
||
public static func custom(_ id: String) -> String { | ||
return id | ||
} | ||
|
||
public static func unique() -> String { | ||
return "unique()" | ||
// Generate a unique ID with padding to have a longer ID | ||
public static func unique(padding: Int = 7) -> String { | ||
let baseId = Self.hexTimestamp() | ||
let randomPadding = (1...padding).map { | ||
_ in String(format: "%x", Int.random(in: 0..<16)) | ||
}.joined() | ||
return baseId + randomPadding | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters