2019-05-01から1ヶ月間の記事一覧

UnsafeMutablePointer のパターンをいろいろテストする

はじめに UnsafeMutablePointer の allocate/deallocate/initialize/move などのメソッドを一通り使用する。 また、ポインタの扱いでメモリリークが発生しないようにする。 テストしたコードは GitHub にある。 テストで共通使用する関数・クラス このコード…

Swift で数値から日本語形式の文字列を得る (例)1,234 -> 千二百三十四

はじめに Swift でこんな感じのことをしたく var v = Int(0) print(v) // "〇" v = Int(1) print(v) // "一" v = Int(2) print(v) // "二" v = Int(1234) print(v) // "千二百三十四" v = Int(665061443960367) print(v) // "六百六十五兆六百十四億四千三百…

テストケースで UIButton をタップする

import XCTest class UITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure oc…

テストケースで UIAlertController のボタンをタップする

import XCTest class UITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure oc…