ios

让 Flutter 在鸿蒙系统上跑起来

送分小仙女□ 提交于 2021-01-26 07:17:00
鸿蒙系统 (HarmonyOS)是华为推出的一款分布式操作系统,那么如何在保证开发迭代效率的前提下,以相对低的成本将移动应用快速移植到鸿蒙平台上呢?美团外卖 MTFlutter 团队近期做了一次技术探索,成功地实现了 Flutter 对于鸿蒙系统的原生支持。 前言 鸿蒙系统 ( HarmonyOS )是华为推出的一款面向未来、面向全场景的分布式操作系统。在传统单设备系统能力的基础上,鸿蒙提出了基于同一套系统能力、适配多种终端形态的分布式理念。自 2020 年 9 月 HarmonyOS 2.0 发布以来,华为加快了鸿蒙系统大规模落地的步伐,预计 2021 年底,鸿蒙系统会覆盖包括手机、平板、智能穿戴、智慧屏、车机在内的数亿台终端设备。对移动应用而言, 新的系统理念、新的交互形式 ,也意味着新的机遇 。如果能够利用好鸿蒙的开发生态及其特性能力,可以让应用覆盖更多的交互场景和设备类型,从而带来新的增长点。 与面临的机遇相比,适配鸿蒙系统带来的挑战同样巨大。当前手机端,尽管鸿蒙系统仍然支持安卓 APK 安装及运行,但长期来看,华为势必会抛弃 AOSP,逐步发展出自己的生态,这意味着现有安卓应用在鸿蒙设备上将会逐渐变成“二等公民”。然而,如果在 iOS 及 Android 之外再重新开发和维护一套鸿蒙应用,在如今业界越来越注重开发迭代效率的环境下,所带来的开发成本也是难以估量的。因此

Kotlin Multiplatform: How to mock objects in a unit test for iOS

若如初见. 提交于 2021-01-26 04:58:55
问题 I'm working on a Kotlin-multiplatform (KMP) library for iOS / Android. I have written some unit tests for JVM, for which I use MockK to create spies and mocks, but MockK doesn't support Kotlin native fully yet. Therefore, I was wondering how others working on KMP projects write unit tests for the iOS platform. An example would be really appreciated. 回答1: Currently, MockK does not support Kotlin/Native or Kotlin/JS. However, both are placed as important items on the project backlog: Kotlin

Kotlin Multiplatform: How to mock objects in a unit test for iOS

放肆的年华 提交于 2021-01-26 04:53:16
问题 I'm working on a Kotlin-multiplatform (KMP) library for iOS / Android. I have written some unit tests for JVM, for which I use MockK to create spies and mocks, but MockK doesn't support Kotlin native fully yet. Therefore, I was wondering how others working on KMP projects write unit tests for the iOS platform. An example would be really appreciated. 回答1: Currently, MockK does not support Kotlin/Native or Kotlin/JS. However, both are placed as important items on the project backlog: Kotlin

create timer with react native using es6

与世无争的帅哥 提交于 2021-01-26 03:50:37
问题 I am looking to add a timer to my app which is built using react native. I have looked at the link to the timer mixin in the documentation however I have built the rest of the app using es6 so this won't be compatible. I have tried the below. In my Main class I have a function called getTimerCountDown getTimerCountDown() { setTimeout(() => { this.setTimeRemaining(this.getTimeRem()-1); }, 1000); } getTimeRem() { return this.state.timeRemaining; } I have tried calling this in componentDidUpdate

create timer with react native using es6

给你一囗甜甜゛ 提交于 2021-01-26 03:50:31
问题 I am looking to add a timer to my app which is built using react native. I have looked at the link to the timer mixin in the documentation however I have built the rest of the app using es6 so this won't be compatible. I have tried the below. In my Main class I have a function called getTimerCountDown getTimerCountDown() { setTimeout(() => { this.setTimeRemaining(this.getTimeRem()-1); }, 1000); } getTimeRem() { return this.state.timeRemaining; } I have tried calling this in componentDidUpdate

How to detect keyboard frame changes when dismiss the keyboard interactively?

孤者浪人 提交于 2021-01-26 03:49:41
问题 Consider this scenario, I have a textview with keyboard Dismiss interactively set in storyboard, so when user scroll down and able to dismiss keyboard interactively. I have constraints on the textview to bottom to make sure it is always fully displayed on the view. Current problem is, when user gradually scroll down to dismiss the keyboard, I can not detect the keyboard frame changes. I tried UIKeyboardWillHideNotification and UIKeyboardWillChangeFrameNotification , they were only called

Amazon S3 policy allowing only upload not overwrite [duplicate]

拥有回忆 提交于 2021-01-26 03:46:24
问题 This question already has answers here : Amazon S3 ACL for read-only and write-once access (4 answers) Closed 3 years ago . I'm developing a mobile application which will let anyone upload a file to an S3 bucket. I think I'll use the Anonymous Token Vending Machine that is provided by Amazon. However, I can't see how to write a TokenVendingMachinePolicy.json file that will only allow uploading new files, not overwriting (effectively deleting). I thought allowing just s3:PutObject would be

React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template

核能气质少年 提交于 2021-01-26 03:06:07
问题 While executing npx react-native init MyProject I ran into the following error: ✖ Installing CocoaPods dependencies (this may take a few minutes) error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Which seems to be related to an earlier error displayed: checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot checking whether the C compiler works... no xcrun: error: SDK "iphoneos" cannot

React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template

不想你离开。 提交于 2021-01-26 03:05:40
问题 While executing npx react-native init MyProject I ran into the following error: ✖ Installing CocoaPods dependencies (this may take a few minutes) error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Which seems to be related to an earlier error displayed: checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot checking whether the C compiler works... no xcrun: error: SDK "iphoneos" cannot

用APICloud开发iOS App Clip(苹果小程序)详细教程

前提是你 提交于 2021-01-25 17:22:17
App Clip是苹果公司在WWDC20开发者大会上发布的新功能,用户可以只访问应用程序的一小部分,而无需下载整个应用,被称为苹果小程序。本文主要介绍如何通过APICloud开发App Clip。 一 创建应用 在APICloud上创建App Clip有两种方式,一种可以在登录APICloud后,进入开发控制台进行创建,如下图,另外也可以在开发工具APICloud Studio3中创建。 在APICloud Studio3中创建: 二 开发调试 App Clip 使⽤和主应⽤⼀样的 APICloud 开发技术,其开发流程和主应⽤也基本⼀致,⽀持使⽤官⽅AppLoader 或者⾃定义 Loader 进⾏ WiFi 代码同步预览,或者云编译进⾏查看。 三 准备编译证书 在编译安装 App Clip 应⽤之前,需要在控制台“证书”⻚⾯上传编译证书。对于 p12 证书,共⽤主应⽤的p12 即可,App Clip 应⽤的包名由主应⽤的包名 + ⾃定义字符串组成,例如主应⽤包名为com.api.demo,则 App Clip 的包名可以为 com.api.demo.clip,参考创建 App ID,然后再⽤创建好的包名制作 mobileprovision 证书。 ⼀般需要分别准备测试证书和正式证书,测试证书⽤于开发阶段安装调试,正式证书则⽤于最终发布到App Store。 四 安装启动App