Skip to content

Instantly share code, notes, and snippets.

Privacy Policy for Storyze

Storyze ("us", "we", "our" or "app") operates the Storyze mobile application (the "Service"). This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.

Information Collection And Use

We collect several different types of information for various purposes to provide and improve our Service to you.

@VAnsimov
VAnsimov / BackgroundSerialPersistence.swift
Last active October 28, 2023 03:24
BackgroundSerialPersistence
import Foundation
import SwiftData
/// ```swift
/// // One operation one instance of BackgroundSerialPersistenceActor class
/// let actor = BackgroundSerialPersistenceActor<MyModel>(container: modelContainer)
///
/// Task {
/// let data = try? await actor.fetchData()
/// }
// 1
final class ListModel: ObservableObject, ListModelStatePotocol {
@Published var text: String = ""
}
// 2
extension ListModel: ListModelActionsProtocol {
func parse(number: Int) {
text = "Random number: " + String(number)
// 1
protocol ListModelStatePotocol {
var text: String { get }
}
// 2
protocol ListModelActionsProtocol: AnyObject {
func parse(number: Int)
}
final class ListIntent {
// 1
private weak var model: ListModelActionsProtocol?
init(model: ListModelActionsProtocol) {
self.model = model
}
func viewOnAppear() {
struct ListView: View {
// 1
@StateObject private var container: MVIContainer<ListIntent, ListModelStatePotocol>
var body: some View {
// 2
Text(container.model.text)
.padding()
.onAppear(perform: {
extension ListView {
static func build() -> some View {
let model = ListModel()
let intent = ListIntent(model: model)
let container = MVIContainer(
intent: intent,
model: model as ListModelStatePotocol,
modelChangePublisher: model.objectWillChange)
// 1
final class MVIContainer<Intent, Model>: ObservableObject {
// 2
let intent: Intent
let model: Model
private var cancellable: Set<AnyCancellable> = []
init(intent: Intent, model: Model, modelChangePublisher: ObjectWillChangePublisher) {
@VAnsimov
VAnsimov / HostingView Example.swift
Last active June 28, 2024 15:17
SwiftUI View to UIView
import UIKit
import SwiftUI
// SwiftUI
struct SomeView: View {
var body: some View {
Text("Hello World!")
}
}
import Foundation
import ARKit
extension ARPlaneAnchor {
@discardableResult
func addPlaneNode(on node: SCNNode, geometry: SCNGeometry, contents: Any) -> SCNNode {
guard let material = geometry.materials.first else { fatalError() }
if let program = contents as? SCNProgram {