LoginSignup
3
3

More than 5 years have passed since last update.

xibファイルを使って表示さす

Last updated at Posted at 2013-10-22

(http://qiita.com/torshinor/items/26cdb8d3968beafa740c)

  1. xibファイル作成
  2. XcodeからInterface Builderを利用してUIをごにょごにょ
  3. resoucesにxibファイルを配置
  4. コードを弄る
  5. rakeしてxibファイルからnibファイルを作成する
app_delegate.rb
class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
    # このコードからnibファイルをよびだす
    @window.rootViewController = AboutViewController.alloc.initWithNibName("AboutViewController",
                                                                           bundle: nil)
    @window.rootViewController.wantsFullScreenLayout = true
    @window.makeKeyAndVisible
    true
  end
end
about_view_controller.rb
class AboutViewController < UIViewController
  def viewDidLoad
    super
  end
end

そもそもxibファイルを配置するだけでは
Interface Builderで作成したUIをRubyMotionに反映させることはできなくって、
きちんとrubyファイルは作らないといかんのでした。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3