Swift

动态加载视图

步骤获取JSON文件路径根据路径创建NSData对象根据NSData对象对JSON进行序列化,得到一个数组遍历数组,提取出视图名,标题,图片名,根据这三项创建视图,并用UINavigationViewController包裹起来,将navi添加到tabBarViewController中.MainVCSettings.json文件[ { "vcName": "HomeTableViewController", "title": "首页", "imageName": "tabbar_home" }, { "vcName": "MessageTableViewController", "title": "消息", "imageName": "tabbar_message_center" }, { "vcName": "NullViewController", "title": "", "imageName": "" }, { "vcName": "DiscoverTableViewController", "title": "广场"

  • 发抖喵小咪
    发抖喵小咪
2 min read