我想让MGBox在我的应用上工作,没有用 - 我看到的只是一个空白的应用窗口,我不确定我做错了什么(我甚至试图翻译目标c来自它附带的DemoController
这是我控制器的代码
import Foundation
class MainController: UIViewController {
var appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
@IBOutlet weak var mainView: MGScrollView!
override func viewDidLoad() {
super.viewDidLoad()
mainView.contentLayoutMode = MGLayoutGridStyle
mainView.bottomPadding = 8
var box: MGBox = appDelegate.client.user.getViews()
var tablesGrid = MGBox.boxWithSize(CGSize(width: 320,height: 0)) as! MGBox
tablesGrid.contentLayoutMode = MGLayoutGridStyle
mainView.boxes.addObject(tablesGrid)
var table1 = MGBox.box() as! MGBox
tablesGrid.boxes.addObject(table1)
table1.sizingMode = MGResizingShrinkWrap
var table2 = MGBox.box() as! MGBox
tablesGrid.boxes.addObject(table2)
table2.sizingMode = MGResizingShrinkWrap
var menu = MGTableBoxStyled.box() as! MGTableBoxStyled
table1.boxes.addObject(menu)
var header = MGLine.lineWithLeft("MG Demo", right: nil, size: CGSize(width: 304, height: 44)) as! MGLine
header.font = UIFont(name:"HelveticaNeue", size:18)
header.leftPadding = 16
header.rightPadding = 16
menu.topLines.addObject(header)
}
}