質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
RxSwift

RxSwiftは、Reactive ExtensionsのSwift向けの実装です。iOS開発に用いられ、リアクティブプログラミングを可能にします。

Q&A

解決済

1回答

7378閲覧

import RxSwiftが出来ない

takahayaboys

総合スコア21

RxSwift

RxSwiftは、Reactive ExtensionsのSwift向けの実装です。iOS開発に用いられ、リアクティブプログラミングを可能にします。

1グッド

1クリップ

投稿2017/09/29 13:08

編集2017/09/30 23:18

xcodeでプロジェクトを開きimport RxSwiftを書いてもNo such module 'RxSwift'
というエラーが出てしまいます。

cocoapodsをインストールして.xcodeprojファイルのあるフォルダにpod initしpodfileを作成しました。
ファイル内の内容を下記に変更

# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'Test' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod 'RxSwift', '~> 3.0' pod 'RxCocoa', '~> 3.0' target 'TestTests' do inherit! :search_paths # Pods for testing end target 'TestUITests' do inherit! :search_paths # Pods for testing end end

その後にpod install開始

Analyzing dependencies
Downloading dependencies
Installing RxCocoa (3.6.1)
Installing RxSwift (3.6.1)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use Test.xcworkspace for this project from now on.
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

最後の方に
[!] Automatically assigning platform ios with version 11.0 on target Test because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

という、メッセージが黄色っぽい文字で書かれているので警告か何かでしょうか?

ちなみにcocoapodsのバージョンは1.3.1です

何が悪いのかさっぱりわからなくなってしまいました。
わかる方がいましたら教えて下さい!!
よろしくお願いします。

追記
podfileのplatformのコメントアウトを外したら正常にインストールされたっぽいん
ですけど、同じくソースコードでimport RxSwiftを記述してもエラーが出てしまいます。
ビルドするとエラーが7個ぐらい出てtoIntMax()のところにエラーが表示されています。
xcode9ではRxSwiftは使えないのでしょうか?
勉強したいのですが前に進めず.......
どなたか知ってる方いませんか??

DrqYuto👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

色々試してやっと解決しました。
Cocoapodsを1.4.0.beta.1にアップデートしxcodeのプロジェクト内にpod initでpodfile作成
podfileに下記を記述

platform :ios, '11.0'

target 'Ex1' do

use_frameworks!
pod 'RxSwift', '4.0.0-beta.1'
pod 'RxCocoa', '4.0.0-beta.1'

end

pod installコマンド

Ex1.xcworkspaceファイルを立ち上げ後ビルド

以上で無事解決しました。
swift4.0ではRxSwiftとRxCocoaは4.0以上のバージョンじゃないとダメっぽいってことかな?

投稿2017/10/02 14:35

takahayaboys

総合スコア21

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問