| 日時: | 2024-02-01 |
|---|---|
| 作: | 時雨堂 |
| 資料 バージョン: | 2024.1 |
| GitHub URL: | https://github.com/shiguredo/momo |
| 製品 URL: | https://momo.shiguredo.jp/ |
| import * as React from 'react'; | |
| import { compose, lifecycle, pure, StateHandler, StateHandlerMap, withStateHandlers } from 'recompose'; | |
| import { Message, Transition } from 'semantic-ui-react'; | |
| import './FlashMessage.css'; | |
| export interface FlashMessageProps { | |
| message: string; | |
| isWarning?: boolean; | |
| } |
| //Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview) | |
| @Override | |
| public boolean onTouch(View view, MotionEvent motionEvent) { | |
| final int actionMasked = motionEvent.getActionMasked(); | |
| if (actionMasked != MotionEvent.ACTION_DOWN) { | |
| return false; | |
| } | |
| if (mManualFocusEngaged) { | |
| Log.d(TAG, "Manual focus already engaged"); | |
| return true; |
| import UIKit | |
| class PickerKeyboard: UIControl { | |
| var data: [String] = ["Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sut.", "Sun."] | |
| fileprivate var textStore: String = "" | |
| override func draw(_ rect: CGRect) { | |
| UIColor.black.set() | |
| UIRectFrame(rect) |
この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。
アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。
図1. An iOS app operating within its own sandbox
| import * as React from 'react'; | |
| import { Component } from 'react'; | |
| export default function HOCBaseRender<Props, State, ComponentState>( | |
| Comp: new() => Component<Props & State, ComponentState>) { | |
| return class HOCBase extends Component<Props, State> { | |
| render() { | |
| return <Comp {...this.props} {...this.state}/>; | |
| } | |
| } |
| 更新: | 2022-03-18 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 2022.1 |
| URL: | http://voluntas.github.io/ |
Reposted from Qiita
For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.
There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.
If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow:
