なんとかするから、なんとかなる

エンジニア関係のことを書きます

2018-09-01から1ヶ月間の記事一覧

iOS How to solve the build error related with "CommonCrypto" on Xcode10

Introduction This article shows how to solve the build error related with "CommonCrypto" on Xcode10. After updating the Xcode to version10, I faced on the error messages as below. The CommonCrypto was imported by cocoapods in my case. Rede…

How to connect to localhost on Mac from iPhone

Introduction This article shows how to connect to localhost on Mac from iPhone and some tips. Conditions Mac and iPhone is on the same network. How to connect it Set up the localhost server on a mac Confirm the access to the "localhost:{Po…

Macで立てたlocalhostサーバーにiPhoneからアクセスする

English version below https://hopita.hatenablog.com/entry/2018/09/30/154646?_ga=2.108892930.1252126168.1538288528-147310722.1524970173 はじめに Macでテスト用サーバーを立ててiPhoneから簡易的に試したいときのTipsです。 前提 MacとiPhoneは同一…

iOS Xcode10 で”CommonCrypto”のおかげでビルドエラーが出た時の対処法

English version below https://hopita.hatenablog.com/entry/2018/09/30/154646 はじめに Xcode10来ましたね。 早速アップデートしてみると次のようなエラー。 CocoaPodsとかで、モジュールをプロジェクトに組み込んでいると出会いやすいっぽいです。 Redef…

iOS How to change a language settings while debugging on the devices

Introduction This article shows how to change a language settings while debugging on the devices. This method is useful for confirming the localized String or text including line breaks. It won't need to change the language from settings a…

iOS 実機でデバッグするときに言語設定を変更する

English version is below. https://hopita.hatenablog.com/entry/2018/09/12/220856 はじめに 実機でデバッグ時に言語設定したい。 ローカライズがきちんとできているか、改行が正しくできているかなど確認するときに便利な方法です。 いちいちデバイス言語…

iOS UIPageViewControllerで"Unbalanced calls to begin/end appearance transitions for" が出たときの対処方法

English version below https://hopita.hatenablog.com/entry/2018/09/09/091925 はじめに UIPageViewControllerを早送りしたときに次のようなエラーが出ました。 Unbalanced calls to begin/end appearance transitions for そのときのコードはこんな感じで…

iOS UIPageViewController How to soleve the error message "Unbalanced calls to begin/end appearance transitions for" .

Introduction When I tried to transition some pages so rapidly. The Xcode shows an error message as below. Unbalanced calls to begin/end appearance transitions for The code is below. class MyPageViewController: UIPageViewController { var ma…

iOS How to set the Autolayout programatically

Introduction It was difficult and complexity to set the autolayout programatically when the AutoLyaout announced in iOS NSLayoutConstraint(item: button, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leadingMargin, …

iOS AutoLayoutをコードから設定する方法

English version below https://hopita.hatenablog.com/entry/2018/09/06/204428 はじめに AutoLayoutが発表された当初、AutoLayoutをコードから設定するのは面倒でした。 NSLayoutConstraint(item: button, attribute: .leading, relatedBy: .equal, toItem…

iOS How to copy the string to Clipboard

Solution let board = UIPasteboard.general board.string = "ABC"

iOS クリップボードへコピーする

解決方法 ものすごく簡単です。 let board = UIPasteboard.general board.string = "あいうえお"

iOS How to use the Decodable

Introdution This article show the basically usage of Decodable Protocol. What's the Decodable The Decodable give us an easy way to convert the JSON Data type to Class or Struct. Thanks for the Decoable protocol, developer could access each…

iOS Decodableの基本的な使い方

English version below https://hopita.hatenablog.com/entry/2018/09/02/110756 はじめに 今回はSwift4 で追加されたDecodableの使い方について紹介します。 Decodableとは API Requestなどで返ってくるJSONのData型を任意のクラスや構造体に変換する際に便…

iOS How to wait for the async procedure in XCTest

Introduction This article shows how to wait for an async procedure like API Request or some closure. Solution It is easy to wait an async procedure using "expectation" Sample Code let request = SomeRequest() let expect = expectation(descri…