Tag: iOS应用程序

[iOS] Udemy 004:测验应用

于类customTableViewCell中建立单元中各元件的IB出口: @IBOutlet弱var cellImage:UIImageView! @IBOutlet弱var topLabel:UILabel! @IBOutlet弱var bottomLabel:UILabel! 将Table View拖曳至ViewController建立数据源关联 进入ViewController.swift完成功能:cellForRowAt() 此时尚未设定CoreData,所以先写入固定的文字 func tableView(_ tableView:UITableView,cellForRowAt indexPath:IndexPath)-> UITableViewCell { 让cell = tableView.dequeueReusableCell(withIdentifier:“ cell”,for:indexPath)为! customTableViewCell cell.topLabel?.text =“总统” cell.bottomLabel?.text =“ 3” cell.cellImage?.image = UIImage(命名为:“ president”) 返回单元 } 设定AutoLayout

[iOS] Udemy 003:PhotoShareApp

在xcode中创建一个新项目 安装 Ostetso 点击“ SDK”->“下载Ostetso SDK v2.4” 解压缩“ ostetsoSDK_2.4.zip” 将“ ostetsoSDK_2.4”重命名为“ Ostetso” 将文件夹“ Ostetso”拖到xcode项目中 创建新文件: iOS->头文件->另存为“ OstetsoBridge” 编辑“ OstetsoBridge.h: #import #import“ Ostetso / Ostetso.h” 3.将Objective-C框架安装到Swift项目中 单击“照片共享”->选择标签“构建设置”->选择标签“全部”,“组合”: (1)搜索“链接器标志”->展开“其他链接器标志”->双击“其他链接器标志”->添加“ -ObjC” (2)搜索“ bridgin”->双击“ Objective-C桥接标题”->添加“ photoshare / OstetsoBridge.h” ->选择标签“构建阶段”: (1)将“ Ostetso.framework”拖到“链接二进制文件与库”中 (2)将“ Ostetso.bundle”拖到“ Copy Bundle Resources”->“完成”中 (使用空白应用成功运行:第一次提交) 初始化Ostetso 注册Ostetso 新增应用 在“类AppDelegate:”的末尾添加“,OstetsoDelegate” 在“ AppDelegate.swift”中的函数didFinishLaunchingWithOptions()中添加以下代码 Ostetso.setApplicationID(“ 0C04F2AE-4908-43AE-AB67-677F92014A88”,appKey:“ 9B1FB7CE-C44A-A105-DB10-F4E30F5C6C69”,useProductionEnvironment:false,委托:self) (通过Ostetso消息弹出窗口运行成功:第二次提交) 5.在ViewController.swift的函数viewDidLoad()中添加“ Ostetso.showGallery()” […]