zip520123 / RxSwiftTestPlayground

Test RxSwift in playground setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RxSwift test project with playground setup

reference from https://www.appcoda.com.tw/playground-driven-development/

  1. Create Xcode project
  2. Init Podfile
$ pod init
  1. Edit Podfile insert below code.
  pod 'RxSwift', '~> 4.0'
  pod 'RxCocoa', '~> 4.0'
post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end
end
  1. Close Xcode project

  2. install pod for target

$ pod install
  1. open .xcworkspace/
  2. create new playground
  3. Drag playground file from finder into xcworkspace project navigator.
  4. Add new target Cocoa Touch Framework name "AppFramework"
  5. Edit Podfile
target 'AppFramework' do
  use_frameworks!

  pod 'RxSwift',    '~> 4.0'
  pod 'RxCocoa',    '~> 4.0'
end
  1. Setup pod for target AppFramework
$ pod install
  1. Select AppFramework and iPhone 7 simulator build once (important)
  2. import AppFramework and pods in playground page
import AppFramework
import RxSwift
import RxCocoa
  1. Done. We can use class in playground for test! Remember we must rebuild AppFramework target after we modify any class.

About

Test RxSwift in playground setup


Languages

Language:Swift 95.6%Language:Objective-C 2.3%Language:Ruby 2.1%