-
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 #8 from appwrite/dev
update to appwrite 1.3.0
- Loading branch information
Showing
50 changed files
with
1,433 additions
and
936 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
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,12 +2,12 @@ | |
|
||
![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.2.0-blue.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.3.0-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) | ||
|
||
**This SDK is compatible with Appwrite server version 1.2.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).** | ||
**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).** | ||
|
||
> This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple) | ||
|
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: | |
|
||
```swift | ||
dependencies: [ | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "1.2.2"), | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "2.0.0"), | ||
], | ||
``` | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
#if os(macOS) | ||
import Foundation | ||
|
||
class MacOSDeviceInfo : DeviceInfo { | ||
let computerName = Sysctl.hostName | ||
let hostName = Sysctl.osType | ||
let arch = Sysctl.machine | ||
let model = Sysctl.model | ||
let kernelVersion = Sysctl.version | ||
let osRelease = Sysctl.osRelease | ||
let activeCPUs = Sysctl.activeCPUs | ||
|
||
public static func get() -> MacOSDeviceInfo { | ||
return MacOSDeviceInfo() | ||
class MacOSDeviceInfo { | ||
let computerName: String | ||
let hostName: String | ||
let arch: String | ||
let model: String | ||
let kernelVersion: String | ||
let osRelease: String | ||
let activeCPUs: Int | ||
|
||
public init() { | ||
computerName = Sysctl.hostName | ||
hostName = Sysctl.osType | ||
arch = Sysctl.machine | ||
model = Sysctl.model | ||
kernelVersion = Sysctl.version | ||
osRelease = Sysctl.osRelease | ||
activeCPUs = Int(Sysctl.activeCPUs) | ||
} | ||
} | ||
#endif |
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
29 changes: 7 additions & 22 deletions
29
Sources/Appwrite/DeviceInfo/Windows/WindowsDeviceInfo.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,31 +1,16 @@ | ||
#if os(Windows) | ||
import Foundation | ||
|
||
class WindowsDeviceInfo : DeviceInfo { | ||
class WindowsDeviceInfo { | ||
|
||
let numberOfCores: String | ||
let computerName: String | ||
let systemMemoryInMegabytes: UInt64 | ||
|
||
public init( | ||
numberOfCores: String, | ||
computerName: String, | ||
systemMemoryInMegabytes: UInt64 | ||
) { | ||
self.numberOfCores = numberOfCores | ||
self.computerName = computerName | ||
self.systemMemoryInMegabytes = systemMemoryInMegabytes | ||
} | ||
|
||
public static func get() -> WindowsDeviceInfo { | ||
let memory = ProcessInfo.processInfo.physicalMemory / 1000 / 1000 // Bytes to MB | ||
|
||
return WindowsDeviceInfo( | ||
numberOfCores: ProcessInfo.processInfo.processorCount.description, | ||
computerName: Host.current().localizedName ?? "", | ||
systemMemoryInMegabytes: memory | ||
) | ||
public init() { | ||
numberOfCores = ProcessInfo.processInfo.processorCount.description | ||
computerName = Host.current().localizedName ?? "" | ||
systemMemoryInMegabytes = ProcessInfo.processInfo.physicalMemory / 1000 / 1000 // Bytes to MB | ||
} | ||
} | ||
#endif | ||
|
||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,27 @@ | ||
#if os(iOS) || os(tvOS) || os(watchOS) | ||
#if os(iOS) || os(tvOS) | ||
import Foundation | ||
import UIKit | ||
|
||
class iOSDeviceInfo : DeviceInfo { | ||
class IOSDeviceInfo { | ||
|
||
let name: String | ||
let systemName: String | ||
let systemVersion: String | ||
let model: String | ||
let localizedModel: String | ||
let identifierForVendor: String | ||
let modelIdentifier: String | ||
|
||
internal init( | ||
name: String, | ||
systemName: String, | ||
systemVersion: String, | ||
model: String, | ||
localizedModel: String, | ||
identifierForVendor: String, | ||
modelIdentifier: String | ||
) { | ||
self.name = name | ||
self.systemName = systemName | ||
self.systemVersion = systemVersion | ||
self.model = model | ||
self.localizedModel = localizedModel | ||
self.identifierForVendor = identifierForVendor | ||
self.modelIdentifier = modelIdentifier | ||
} | ||
|
||
public static func get() -> iOSDeviceInfo { | ||
public init() { | ||
let device = UIDevice.current | ||
|
||
return iOSDeviceInfo( | ||
name: device.name, | ||
systemName: device.systemName, | ||
systemVersion: device.systemVersion, | ||
model: device.model, | ||
localizedModel: device.localizedModel, | ||
identifierForVendor: device.identifierForVendor?.uuidString ?? "", | ||
modelIdentifier: UIDevice.modelName | ||
) | ||
|
||
name = device.name | ||
systemName = device.systemName | ||
systemVersion = device.systemVersion | ||
model = device.model | ||
localizedModel = device.localizedModel | ||
identifierForVendor = device.identifierForVendor?.uuidString ?? "" | ||
modelIdentifier = UIDevice.modelName | ||
} | ||
} | ||
#endif |
Oops, something went wrong.