xcode

Pure SwiftUI login, signup, register flow, is it possible?

喜夏-厌秋 提交于 2021-02-05 11:43:27
问题 Im new to ios development and I have come straight into SwiftUI and Xcode 12. I'm trying to understand the flow for login from a login screen that after you input your credentials you are presented with a tabview screen. When the app first loads, its presented with the login and after login is successful the token from the server is returned and saved and further starting of the app checks for token and displays appropriate view WindowGroup { if token == nil { LoginView() } else { TabView() }

Why does Xcode line-out autocomplete methods for selector?

 ̄綄美尐妖づ 提交于 2021-02-05 10:51:56
问题 Ever since I upgraded to the latest Xcode, autocomplete lines out (strikethrough) methods for the selector object. I cannot tell if this is a bug with Xcode or there is some new syntax change I'm unaware of. If you plug this into your Playground and erase the method inside #selector(tapHandler(_:)) and re-enter it, does autocomplete line-out the tapHandler(_:) suggestion or not? class Mango { func tap() { let tap = UITapGestureRecognizer(target: self, action: #selector(tapHandler(_:))) }

Why does Xcode line-out autocomplete methods for selector?

我的未来我决定 提交于 2021-02-05 10:50:09
问题 Ever since I upgraded to the latest Xcode, autocomplete lines out (strikethrough) methods for the selector object. I cannot tell if this is a bug with Xcode or there is some new syntax change I'm unaware of. If you plug this into your Playground and erase the method inside #selector(tapHandler(_:)) and re-enter it, does autocomplete line-out the tapHandler(_:) suggestion or not? class Mango { func tap() { let tap = UITapGestureRecognizer(target: self, action: #selector(tapHandler(_:))) }

Apple framework not found when building Archive

爱⌒轻易说出口 提交于 2021-02-05 10:45:11
问题 I'm trying to add optional support for an AR feature to an existing app using RealityKit. The app builds and runs fine on both iOS 10 and iOS 13 devices with the optional feature only enabled in the latter. However, when I build for a Generic iOS Device or try to Archive, I get an error No such module 'RealityKit' on any import RealityKit statement and the build fails. The build target for the app is iOS 10, with RealityKit being available in iOS 13. I've added guards to only build certain

iOS Jenkins+蒲公英实现持续集成

泪湿孤枕 提交于 2021-02-05 10:42:03
随着项目的迭代速度不断加快,原始的使用xcode -> product -> archive 的方式已经不能满足迭代需要。还要现在已经有比较成熟的 Jenkins + 蒲公英持续集成方案。最近学习研究学了下这个方案。林林总总,遇到许多坑也学习到很多 。这里把直接把正确的方向分享记录下来 。方便下次再配置环境的时候可以一步到位,直取敌首。 如果从官网下载安装jenkins的apk包,会默认安装的 /Users/Shared/jenkins 目录下。安装在这个目录下我们使用 jenkins账户访问主账户资源的时候会遇到各种权限问题,我遇到的就是:在jenkins配置页面执行shell脚本的时候提示 permission denied,原因可能是jenkins安装在这个目录下无权访问主账户的某些文件 。 个人也尝试了网上大部分的通过命令行修改jenkins用户组的方法,效果并不理想(也可能是我操作方式不对 )。 如果能把jenkins安装在主账户的某个目录下不就是可以解决这个问题了么,从这个角度出发,于是有了下面一种比较好的解决方法 。 通过homebrew安装而不是apk包 。首先你要安装homebrew 。 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

SonarQube cannot parse TEST-report.xml which contains any failures

萝らか妹 提交于 2021-02-05 10:40:01
问题 How to send the XML report to SonarQube? I mean, while the TEST-report.xml file contains any failures, the import operation fails. I got an error: Running SonarQube using SonarQube Runner.17:18:18.452 ERROR: Error during SonarScanner execution java.lang.NullPointerException at java.text.DecimalFormat.parse(DecimalFormat.java:2030) at java.text.NumberFormat.parse(NumberFormat.java:383) ... The TEST-report.xml file (JUnit) contains something like: <?xml version='1.0' encoding='UTF-8'?>

SonarQube cannot parse TEST-report.xml which contains any failures

你离开我真会死。 提交于 2021-02-05 10:39:24
问题 How to send the XML report to SonarQube? I mean, while the TEST-report.xml file contains any failures, the import operation fails. I got an error: Running SonarQube using SonarQube Runner.17:18:18.452 ERROR: Error during SonarScanner execution java.lang.NullPointerException at java.text.DecimalFormat.parse(DecimalFormat.java:2030) at java.text.NumberFormat.parse(NumberFormat.java:383) ... The TEST-report.xml file (JUnit) contains something like: <?xml version='1.0' encoding='UTF-8'?>

持续集成之jenkins打包iOS

[亡魂溺海] 提交于 2021-02-05 09:59:05
1、 安装jdk并配置JAVA_HOME vi ~/.bash_profile export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home source ~/.bash_profile 2、 安装Tomcat 3、 下载jenkins.war,部署到tomcat中 4、 配置.bash_profile export JENKINS_HOME= /Users/Shared/Jenkins/Home 5、 安装jenkins相关插件:系统管理-->插件管理 Subversion Plug-in 版本控制 Xcode integration xcode 打包命令 Keychains and Provisioning Profiles Management 管理证书和授权文件 6、 配置证书及pfofile:系统管理--> Keychainsand Provisioning Profiles Management Keychians 配置: 打开终端窗口输入命令行 open /Users/ 管理员用户名/Library/Keychains 例如:open /Users/admin/Library/Keychains Mac 系统10.12版本以后找到 login.keychain

iOS Jenkins 自动化打包构建

这一生的挚爱 提交于 2021-02-05 09:58:43
前言 在测试app项目过程中,通常都是需要开发打测试包给到测试,但是无论是iOS还是Android的打包过程都是相当漫长的,频繁的回归测试需要频繁的打包,对于开发同学影响还是蛮大的。因此在这种情况下,开发通常都会搭建一个简单的自动化打包平台(Jenkins),自动化构建打包或者上传到蒲公英,firm等分发平台。作为测试也需要了解相关的知识,因为这些工作也有可能测试来做或推动开发去做相关的工作,用以优化提高开发测试效率。 涉及技术点: Jenkins的搭建配置,任务构建 iOS开发环境配置 iOS打包(证书配置) iOS命令行打包xcodebuild的使用 xcode打包介绍 准备工作 如果不打包,直接在测试机上跑app是不需要证书和描述文件的。只要有Apple ID就是可以的,它可以自动生成描述文件,然后让app运行到测试机上。 如果是需要打包分发的话,就是必须要有证书和描述文件。 证书有两种,一种是开发证书,一种是上线证书,当然测试只需要拿到开发证书就可以了,大部分情况下上线工作是不需要测试来做的(涉及到一些开发者账号等东西)。 如果我们需要本地打包的话那么就需要跟开发要两样东西: 开发证书 描述文件 开发证书拿到之后双击打开就好,可以在钥匙串中看到安装好的证书。 描述文件需要单独保存一下,一些配置可能用到,Xcode配置中需要导入。 代码权限,跟开发拿到代码权限,git

NSWindow automatically closes after showWindow

淺唱寂寞╮ 提交于 2021-02-05 09:47:45
问题 I'm trying to open a NSWindow inside a Storyboard. I've instantiated the controller correctly, the window opens but disappears instantly. var sb : NSStoryboard? var vc : NSWindowController? @IBAction func openWindow(sender: AnyObject) { let sb = NSStoryboard(name: "NewStoryBoard", bundle: nil) let vc = sb.instantiateControllerWithIdentifier("windowController") vc.showWindow(nil) } I would understand this behavior if the vars would be inside the func. In this case ARC would kill the window. In