Skip to content

watanabetoshinori/iPhoneSimulator-for-Playground

Repository files navigation

iPhoneSimulator for Playground

License: MIT

Preview

iPhoneSimulator for Playground allows you to display the view controller with simulating the screen size of the iPhone devices.

You can also found the Swift Playground version from here.

Features

  • Simulate the iPhone screen sizes. (8 Plus / X / 8 / SE / 4S)
  • Simulate the orientation. (Landscape / Portrait)

Getting Started

Requirements

  • Xcode 10.0+
  • Swift 4.2+

Installation

Cocoa Pods

pod 'iPhoneSimulator', :git => 'git@github.com:watanabetoshinori/iPhoneSimulator-for-Playground.git'

Usage

Initialization

Start by importing the package in the Playground file you want to use it.

import iPhoneSimulator

Run iPhone Simulator

let viewController = ViewController()

PlaygroundPage.current.liveView = iPhoneSimulator.liveView(with: viewController)

Change Device or Orientation

Tap the bottom of LiveView to display the toolbar.

Toolbar

  • Tap Device image to change simulation device.
  • Tap Orientaion to change view orientation.

Author

Watanabe Toshinori – toshinori_watanabe@tiny.blue

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

iPhoneSimulator for Playground allows you to display the view controller with simulating the screen size of the iPhone devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published