xcode

How to switch programmatically to dark mode swift

社会主义新天地 提交于 2020-11-29 04:18:12
问题 How can I make a switch to change programatically to dark or light mode in my iOS app? I'm using Swift. 回答1: You can override the style for single views or view controller using the overrideUserInterfaceStyle property. But since the window is also a view, you can set that on your main window to force it into light or dark mode: window.overrideUserInterfaceStyle = .dark 来源: https://stackoverflow.com/questions/60171262/how-to-switch-programmatically-to-dark-mode-swift

阅读《构建之法》所得与初步思考

烈酒焚心 提交于 2020-11-28 06:25:17
写在前面   虽然身在软件工程专业已经一年半有余了,但由于一直以来所学的课程基本都是基础课程,没有太多的专业色彩,所以我对于本专业的认识也就比较浅显,这门课程可以说是全面展示本专业特色的一门课程了,在阅读过邹欣老师的《构建之法》后,我对本专业到底是什么,到底与计算机专业有什么区别有了充分的了解,而且对于行业内的许多其他知识也有了很大收获,所以记述了我的阅读所得和在多次阅读后的一些思考和疑惑。 第一章 概论   在进入大学学习软件工程之后,我一直有一个问题不是很明白,就是软件工程专业与计算机科学与信息技术专业到底有什么不同之处?看着两个专业相似的课程安排,我更加疑惑了,既然两个专业如此相近,那么设立“软件工程”这个新学科的意义又在哪里呢?通过阅读《构建之法》第一章 概论,使我对这个问题有了清晰的了解。   在本章之初,作者就指出:“软件=程序+软件工程”,看到这里,我就意识到软件工程和计算机科学与技术肯定是有不同之处的,不然为什么这里偏偏使用了“软件工程”一词呢?接下来我就通过了阿超的例子对“软件工程”到底是什么有了初步的了解。原来想要做出一个软件,不仅仅是要编写程序,还要有需求分析,软件架构,配置管理等等步骤,还要兼顾用户体验,软件维护,国际化和本土化等等方面,这些着实与计算机科学有很大的差异,毕竟这些方面都是应用于我们实际生活中的,和人的行为、现实社会的需求息息相关

How use Instruments and display the console in Command Lines applications

こ雲淡風輕ζ 提交于 2020-11-26 07:02:53
问题 I'm using Xcode on OSX to develop command line C applications. I would also like to use Instruments to profile and find memory leaks. However, I couldn't find a way to display the console when launching the application from within Instruments. I'm also unable to attach to a running command line process (it exits with an error): Here's an example code: #include <stdio.h> #include <signal.h> #include <stdlib.h> #include <setjmp.h> static sigjmp_buf jmpbuf; void handler(int sig) { char c[BUFSIZ]

The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, in Flutter How can I change the minimum IOS Deploying Target

随声附和 提交于 2020-11-26 04:55:14
问题 I changed everything to 9.0 in the project but I'm having the same error in a lot of pods. I tried doing a lot of different things but nothing worked. Does anyone know how can I fix this? warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods') warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range

Xcode 与 bitcode 的几个小知识点

北战南征 提交于 2020-11-25 13:50:47
Python实战社群 Java实战社群 长按识别下方二维码, 按需求添加 扫码关注添加客服 进Python社群▲ 扫码关注添加客服 进Java社群 ▲ 作者 | 酷酷的哀殿 来源 | 酷酷的哀殿的博客 https://ai-chan.top/2020/10/19/Xcode-bitcode/ 开启 Enable Bitcode 配置后,不会触发额外的代码优化 根据官方文档,在 Build Settings 页面开启 Enable Bitcode (ENABLE_BITCODE) 选项后,会在 Archive 时,在支持的平台和架构上生成 bitcode 代码。 注意:只有通过 Archive 模式导出并提交到 App Store 时,才可能被苹果进行进一步的代码优化。 BITCODE_GENERATION_MODE BITCODE_GENERATION_MODE 是 Xcode 定义的一个枚举值。 它存在两种可能值:marker 和 bitcode。 marker 代表编译的二进制文件只包含 size 等于 1 的 marker进行占位。 bitcode 代表编译的二进制文件包含真正的 bitcode 信息。 { Name = "BITCODE_GENERATION_MODE"; Type = enum; Values = ( "marker", "bitcode", );

swift 自定义TabBarController、NavigationController复用

被刻印的时光 ゝ 提交于 2020-11-25 03:17:45
自定义TabBarController、NavigationController 简单使用(复用) 环境:xcode9.4 语言:swift4.0 git: SwiftNotes 效果图:    SLNavigationController.swift import UIKit class SLNavigationController: UINavigationController { override func viewDidLoad() { super.viewDidLoad() navigationBar.isHidden = true } /// 重写Push方法 /// 所有的push动作都会调用此方法 /// - Parameters: /// - viewController: 需要push的VC /// - animated: 是否动画 override func pushViewController(_ viewController: UIViewController, animated: Bool) { // 如果不是栈底的控制器才需要隐藏,跟控制器不需要处理 if childViewControllers.count > 0 { // 隐藏tabBar viewController.hidesBottomBarWhenPushed = true } super

iPhone is not available. Please reconnect the device. / iOS 14.2 - Xcode 12.1

南笙酒味 提交于 2020-11-24 15:40:57
问题 I just updated my iPhone to iOS 14.2. When I want to launch an app on the device from Xcode, I now keep seing this: I also just updated Xcode to Version 12.1, hoping it would solve the problem, but it doesn't make any difference, I keep getting the same message. Obviously I tried disconnecting and reconnecting the device, but to no avail. I also removed all the data under ~/Library/Developer/Xcode/DerivedData/, but again with no effect. It seems like some other people have had this issue

iPhone is not available. Please reconnect the device. / iOS 14.2 - Xcode 12.1

走远了吗. 提交于 2020-11-24 15:35:06
问题 I just updated my iPhone to iOS 14.2. When I want to launch an app on the device from Xcode, I now keep seing this: I also just updated Xcode to Version 12.1, hoping it would solve the problem, but it doesn't make any difference, I keep getting the same message. Obviously I tried disconnecting and reconnecting the device, but to no avail. I also removed all the data under ~/Library/Developer/Xcode/DerivedData/, but again with no effect. It seems like some other people have had this issue

iOS 解决键盘遮挡输入框问题,输入框随键盘弹起上移,切换输入法时动态调整

橙三吉。 提交于 2020-11-24 12:36:41
最近在项目中需要解决苹果系统输入法遮挡输入框的问题,预期结果为: 若键盘弹出后会遮挡输入框,则输入框随键盘弹起上移,输入法切换时输入框始终保持在键盘上方; 若键盘弹出后不会遮挡输入框,但切换输入法后会遮挡输入框,则输入框需要在切换后上移,随后输入法切换时输入框始终保持在键盘上方。 一. 背景 开发环境:iOS14 + Xcode v12.0.1 + Swift5 设备:iPhoneSE(其他机型测试有效) 页面采用自动布局 二. 实现方式 1. 监听键盘变化,获取键盘高度 在viewWillAppear中添加键盘弹出、收起、frame变化的通知 NotificationCenter . default . addObserver ( self , selector : # selector ( keyboardWillAppear ) , name : UIResponder . keyboardWillShowNotification , object : nil ) NotificationCenter . default . addObserver ( self , selector : # selector ( keyboardHasAppear ) , name : UIResponder . keyboardDidShowNotification , object :

XCode 12: 'SessionDelegate' has different definitions in different modules

两盒软妹~` 提交于 2020-11-24 08:34:23
问题 Edit: This problem occurs after XCode 12 Beta5. Xcode doesn't allow different modules to define same names (Probably for public classes & protocols). Alamofire and Kingfisher appears to define SessionDelegate at the same time. I'm still trying to find a solution.. I'm implementing iOS 14 Widgets in our application. I have started working with XCode 12 Beta 2 and everthing was compiling fine. When I have updated XCode to XCode 12 Beta 6 , I faced with following error: 'SessionDelegate' has