XibKit

1.1.6

This library provides a way to create views from xib files
NikSativa/XibKit

What's New

1.1.6

2024-04-17T22:52:24Z

Full Changelog: 1.1.5...1.1.6

XibKit

This library provides a way to create views from xib files. It's useful when you need to create a custom view with a complex hierarchy of subviews.

Important

  1. the root view and File's Owner must be specified as your class, which inherits from XibView
  2. all outlets must be connected with File's Owner object inside xib
  3. root view in xib must have minimum 1 subview

As result you will get a view with hierarchy:

  • MyView - file's owner
    • MyView - root view
      • subview
      • subview
      • subview

How to create from code:

let main: XibViewMain = .init()
view.addSubview(main)

You can use you custom views inside other xib/storyboard by setting class type to your custom view class and connect outlets to it. To handle correct size in xib just set intrinsic size to placeholder.

How to create from other xib:

final class MyViewController: UIViewController {
    @IBOutlet weak var main: XibViewMain!
}

PS: see XibViewMain.xib and XibViewMain.swift as example *

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

Last updated: Fri May 03 2024 05:06:51 GMT-0900 (Hawaii-Aleutian Daylight Time)