Created
December 14, 2016 02:40
-
-
Save takoikatakotako/87f4674728006b69a307064864ed34f4 to your computer and use it in GitHub Desktop.
iOS端末の横幅、縦幅を取得する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| //画面サイズを取得する | |
| let viewWidth:CGFloat = self.view.frame.size.width | |
| let viewHeight:CGFloat = self.view.frame.size.height | |
| print("このiOS端末の横幅=\(viewWidth) ") | |
| print("このiOS端末の縦幅=\(viewHeight) ") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment