swift hello, world

2685 단어 XcodeSwiftiOS

한 무더기쯤 만들었을 텐데..


ViewController.swift
//
//  ViewController.swift
//  HelloWorldApp
//

import UIKit

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        var label = UILabel()
        label.text = "hello, world"
        label.sizeToFit()
        label.center = self.view.center
        view.addSubview(label)
    }
}

실행 결과



다음과 같은 경고가 있지만 신경 쓸 필요는 없다.
ld: warning: relocatable dylibs (e.g. embedded frameworks) are only supported on iOS 8.0 and later (@rpath/libswift_stdlib_core.dylib)
cf. http://stackoverflow.com/questions/24622495/relocatable-dylibs-e-g-embedded-frameworks-are-only-supported-on-ios-8-0-and
다음을 참조하였습니다.
http://www.atmarkit.co.jp/ait/articles/1211/07/news017.html
http://gupuru.hatenablog.jp/entry/2014/06/16/191358

좋은 웹페이지 즐겨찾기