The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
## What's Changed
* Readme Changes by @haIIux in https://github.com/0xOpenBytes/o/pull/8
* Remove tvOS Notifications by @0xLeif in https://github.com/0xOpenBytes/o/pull/9
## New Contributors
* @haIIux made their first contribution in https://github.com/0xOpenBytes/o/pull/8
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/2.1.0...2.1.1
## What's Changed
* Improve usage with non JSON functions. Added String and Data functions for in and out. by @0xLeif in https://github.com/0xOpenBytes/o/pull/7
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/2.0.0...2.1.0
## What's Changed
* Improve o.file using paths by @0xLeif in https://github.com/0xOpenBytes/o/pull/6
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/1.0.1...2.0.0
## What's Changed
* Lower platform OS versions by @0xLeif in https://github.com/0xOpenBytes/o/pull/5
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/1.0.0...1.0.1
# o
*Output and Input*
## What is `o`?
`o` is a simple framework to output to a file, url, the console, or even register notification using UserNotifications. `o` can also get input from a file, url, or console.
## Where can `o` be used?
Currently, `o` can be used on macOS, iOS, and watchOS.
## Examples
### o.console
```swift
o.console.out("Value to print: ", terminator: "") // (oTests/oTests.swift@7) [testExample()]: Value to print:
o.console.out(o.console.in()) // Type in "???"; (oTests/oTests.swift@8) [testExample()]: Optional("???")
```
### o.file
```swift
let filename: String = ...
// Write the value 4, an Int, to the file named `filename`. Files using o.file are base64Encoded.
try o.file.out(4, filename: filename)
// Asserts
XCTAssertNoThrow(try o.file.in(filename: filename) as Int)
XCTAssertEqual(try? o.file.in(filename: filename), 4)
// Delete the File
try o.file.delete(filename: filename)
// Assert deletion
XCTAssertThrowsError(try o.file.in(filename: filename) as Int)
```
### o.url
```swift
struct Post: Codable {
let userId: Int
let id: Int
let title: String
let body: String
}
// GET Request
let (data, response) = try await o.url.get(
url: URL(string: "api/posts")!
)
// POST Request
let post = Post(userId: 1, id: 1, title: "First!", body: "")
let (_, response) = try await o.url.post(
url: URL(string: "api/posts/\(post.id)")!,
body: try? JSONEncoder().encode(post)
)
print(response)
```
### o.notification
```swift
// Request Notification Authorization
o.notification.requestAuthorization()
// Set UNUserNotificationCenter.current's delegate to `o.notification.delegate`
o.notification.registerDelegate()
// Schedule a Notification
o.notification.post(
title: "Hello!",
subtitle: "o.notification",
body: "Woo Hoo!",
trigger: UNTimeIntervalNotificationTrigger(
timeInterval: 3,
repeats: false
)
)
```
***
## What's Changed
* Leif/feature/data response by @0xLeif in https://github.com/0xOpenBytes/o/pull/3
* Create CI.yml by @0xLeif in https://github.com/0xOpenBytes/o/pull/4
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/0.3.0...1.0.0
## What's Changed
* Prefer full async solution to URL. by @0xLeif in https://github.com/0xOpenBytes/o/pull/2
```swift
struct Post: Codable {
let userId: Int
let id: Int
let title: String
let body: String
}
// GET Request
let (data, response) = try await o.url.get(
url: URL(string: "api/posts")!
)
// POST Request
let post = Post(userId: 1, id: 1, title: "First!", body: "")
let (_, response) = try await o.url.post(
url: URL(string: "api/posts/\(post.id)")!,
body: try? JSONEncoder().encode(post)
)
print(response)
```
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/0.2.1...0.3.0
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/0.2.0...0.2.1
# o
*Output and Input*
## What is `o`?
`o` is a simple framework to output to a file, url, the console, or even register notification using UserNotifications. `o` can also get input from a file, url, or console.
## Where can `o` be used?
Currently, `o` can be used on macOS, iOS, and watchOS.
## Examples
### o.console
```swift
o.console.out("Value to print: ", terminator: "") // (oTests/oTests.swift@7) [testExample()]: Value to print:
o.console.out(o.console.in()) // Type in "???"; (oTests/oTests.swift@8) [testExample()]: Optional("???")
```
### o.file
```swift
let filename: String = ...
// Write the value 4, an Int, to the file named `filename`. Files using o.file are base64Encoded.
try o.file.out(4, filename: filename)
// Asserts
XCTAssertNoThrow(try o.file.in(filename: filename) as Int)
XCTAssertEqual(try? o.file.in(filename: filename), 4)
// Delete the File
try o.file.delete(filename: filename)
// Assert deletion
XCTAssertThrowsError(try o.file.in(filename: filename) as Int)
```
### o.url
```swift
struct Post: Codable {
let userId: Int
let id: Int
let title: String
let body: String
}
// GET Request
o.url.in(
url: URL(string: "api/posts")!,
successHandler: { (posts: [Post], response) in
print(posts)
}
)
// POST Request
let post = Post(userId: 1, id: 1, title: "First!", body: "")
try o.url.out(
url: URL(string: "api/posts/\(post.id)")!,
value: post,
successHandler: { data, response in
print(response)
}
)
```
### o.notification
```swift
// Request Notification Authorization
o.notification.requestAuthorization()
// Set UNUserNotificationCenter.current's delegate to `o.notification.delegate`
o.notification.registerDelegate()
// Schedule a Notification
o.notification.post(
title: "Hello!",
subtitle: "o.notification",
body: "Woo Hoo!",
trigger: UNTimeIntervalNotificationTrigger(
timeInterval: 3,
repeats: false
)
)
```
- [Add url case when Value is Data](https://github.com/0xOpenBytes/o/commit/760c971650413d30c2edba6090fd92ce0720b8a0)
@0xLeif
**Full Changelog**: https://github.com/0xOpenBytes/o/compare/0.1.0...0.2.0
# o
*Output and Input*
## What is `o`?
`o` is a simple framework to output to a file, url, the console, or even register notification using UserNotifications. `o` can also get input from a file, url, or console.
## Where can `o` be used?
Currently, `o` can be used on macOS, iOS, and watchOS.
## Examples
### o.console
```swift
o.console.out("Value to print: ", terminator: "") // (oTests/oTests.swift@7) [testExample()]: Value to print:
o.console.out(o.console.in()) // Type in "???"; (oTests/oTests.swift@8) [testExample()]: Optional("???")
```
### o.file
```swift
let filename: String = ...
// Write the value 4, an Int, to the file named `filename`. Files using o.file are base64Encoded.
try o.file.out(4, filename: filename)
// Asserts
XCTAssertNoThrow(try o.file.in(filename: filename) as Int)
XCTAssertEqual(try? o.file.in(filename: filename), 4)
// Delete the File
try o.file.delete(filename: filename)
// Assert deletion
XCTAssertThrowsError(try o.file.in(filename: filename) as Int)
```
### o.url
```swift
struct Post: Codable {
let userId: Int
let id: Int
let title: String
let body: String
}
// GET Request
o.url.in(
url: URL(string: "api/posts")!,
successHandler: { (posts: [Post], response) in
print(posts)
}
)
// POST Request
let post = Post(userId: 1, id: 1, title: "First!", body: "")
try o.url.out(
url: URL(string: "api/posts/\(post.id)")!,
value: post,
successHandler: { data, response in
print(response)
}
)
```
### o.notification
```swift
// Request Notification Authorization
o.notification.requestAuthorization()
// Set UNUserNotificationCenter.current's delegate to `o.notification.delegate`
o.notification.registerDelegate()
// Schedule a Notification
o.notification.post(
title: "Hello!",
subtitle: "o.notification",
body: "Woo Hoo!",
trigger: UNTimeIntervalNotificationTrigger(
timeInterval: 3,
repeats: false
)
)
```
# o
*Output and Input*
## What is `o`?
`o` is a simple framework to output to a file, url, the console, or even register notification using UserNotifications. `o` can also get input from a file, url, or console.
## Where can `o` be used?
Currently, `o` can be used on macOS, iOS, and watchOS.
## Examples
### o.console
```swift
o.console.out("Value to print: ", terminator: "") // (oTests/oTests.swift@7) [testExample()]: Value to print:
o.console.out(o.console.in()) // Type in "???"; (oTests/oTests.swift@8) [testExample()]: Optional("???")
```
### o.file
```swift
let filename: String = ...
// Write the value 4, an Int, to the file named `filename`. Files using o.file are base64Encoded.
try o.file.out(4, filename: filename)
// Asserts
XCTAssertNoThrow(try o.file.in(filename: filename) as Int)
XCTAssertEqual(try? o.file.in(filename: filename), 4)
// Delete the File
try o.file.delete(filename: filename)
// Assert deletion
XCTAssertThrowsError(try o.file.in(filename: filename) as Int)
```
### o.url
```swift
struct Post: Codable {
let userId: Int
let id: Int
let title: String
let body: String
}
// GET Request
o.url.in(
url: URL(string: "api/posts")!,
successHandler: { (posts: [Post], response) in
print(posts)
}
)
// POST Request
let post = Post(userId: 1, id: 1, title: "First!", body: "")
try o.url.out(
url: URL(string: "api/posts/\(post.id)")!,
value: post,
successHandler: { data, response in
print(response)
}
)
```
### o.notification
```swift
// Request Notification Authorization
o.notification.requestAuthorization()
// Set UNUserNotificationCenter.current's delegate to `o.notification.delegate`
o.notification.registerDelegate()
// Schedule a Notification
o.notification.post(
title: "Hello!",
subtitle: "o.notification",
body: "Woo Hoo!",
trigger: UNTimeIntervalNotificationTrigger(
timeInterval: 3,
repeats: false
)
)
```