Skip to content

Instantly share code, notes, and snippets.

@mono0926
mono0926 / 1Database.swift
Last active June 2, 2022 08:15
FirestoreのRxSwiftとの組み合わせ。Codableも活用。 [追記] FirestoreのデータはCodable非対応のプロパティを持ててしまいそれが含まれると対応難しいのでCodableは捨てた方が良いかもしれない
//
// Database.swift
// Model
//
// Created by mono on 2017/10/14.
// Copyright © 2017 Masayuki Ono All rights reserved.
//
import Foundation
import FirebaseCore
@toddhopkinson
toddhopkinson / BackgroundTransferSample.swift
Last active September 27, 2023 01:47
Upload Very Large Files In Background on iOS - Alamofire.upload multipart in background
// You have a very very large video file you need to upload to a server while your app is backgrounded.
// Solve by using URLSession background functionality. I will here use Alamofire to enable multipart upload.
class Networking {
static let sharedInstance = Networking()
public var sessionManager: Alamofire.SessionManager // most of your web service clients will call through sessionManager
public var backgroundSessionManager: Alamofire.SessionManager // your web services you intend to keep running when the system backgrounds your app will use this
private init() {
self.sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default)
self.backgroundSessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.background(withIdentifier: "com.lava.app.backgroundtransfer"))
@y-takagi
y-takagi / DOCUMENT.md
Last active July 6, 2023 05:27
iOSでデータを永続化する方法

How to save data in iOS

この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。

iOS File System

アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。

IMG_0017_RESIZE.png

図1. An iOS app operating within its own sandbox

@mitsuruog
mitsuruog / index.md
Last active April 15, 2024 00:54
express実践入門

express実践入門


自己紹介

小川充

  • mitsuruog
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active April 17, 2024 09:40
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S