ios 必须支持ios开发 safe areaarea吗

iOS 11新特性: safeAreaLayoutGuide
iOS 11新特性: safeAreaLayoutGuide
The layout guide representing the portion of your view that is unobscured by bars and other content.
iOS 11.0+Beta
tvOS 11.0+Beta
FrameworkUIKitOn This Page
Declarationvar safeAreaLayoutGuide: { get }Discussion
When the view is visible onscreen, this guide reflects the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. (In tvOS, the safe area reflects the area not covered the screen's bezel.) If the view is not currently installed in a view hierarchy, or is not yet visible onscreen, the layout guide edges are equal to the edges of the view.
For the view controller's root view, the layout guide accommodates the status bar, other visible bars, and any additional insets that you specified using the
property of your view controller. For other views in the view hierarchy, the layout guide reflects only the portion of the view that is covered by other content. For example, if a view is entirely within the safe area of its superview, the layout guide edges are equal to the edges of the view.
安全区域页面布局指示器安全页面布局向导代表你设计的没有被bars和其他部分挡住的一部分页面SDKs
iOS 11.0+Beta
tvOS 11.0+Beta
FrameworkUIKit声明var safeAreaLayoutGuide: { get } 介绍
当视图在页面可见,安全页面表示没有被导航栏和顶部tab bars,工具栏或者其他的继承页面(在tvOS,安全区域是区域没有被外圈挡住的界面)如果页面当前没有被安装在页面层,活着没有可见的界面,页面边缘和整个页面的边缘一样。
对于页面控制器主页面,页面布局适应状态栏,其他可见bars,以及其他的内建使用
属性。对于其他在view的层级view,页面指示器仅表示一部分被其他部分包含的view。比如,如果一个view的父视图完全是安全区域,那么视图指示器就和view的边缘一致。原创框架:、、
腾讯手机管家iOS版的iPhoneX适配实践分享
在线时长累积100天(即100 * 8 = 800小时)。
精华主题数超过100个。
为论区做出突出贡献的开发者、版主等。
商务/合作:
投稿/报道:
手机访问本站
微信公众号newiOS开发:为你的应用兼容iPhone X
招聘信息:
每年苹果爸爸都会在六月份的WWDC上发布有关下一代iOS的新特性和改动内容,开发者们有半年时间去准备和兼容最新版本的iPhone和操作系统。但是这一次为了在发布会前不泄露iPhone X的相关信息(实际上我们早就知道了=。=),苹果直到前几天才在官网上线了兼容全面屏的指导文档和视频。离iPhone X正式上市还有两个月不到的时间,我们需要为我们的app做哪些准备呢?屏幕我们在编码中使用的是以point为单位的屏幕尺寸(在不同设备上每个point对应的实际像素点是不一样的),iPhone 8的尺寸是375pt × 667pt @2x,iPhone X的尺寸是375pt × 812pt @3x,也就是屏幕宽度是一样的,但是高出了145pt,大概能多显示20%的内容。屏幕注意iPhone X的屏幕素质比较好,所以它需要加载较高像素的图片,我们要提供必要的@3x资源。另外由于iPhone X极高的长宽比,我们用作背景的图片都需要重新设计,以保证比例适合,内容被裁切后效果仍然ok。屏幕status bariPhone X的状态栏高度是高于之前所有的iPhone版本的,所以在代码里写死kStatusBarHeight == 20的地方都会出错!刘海变高也就是说,之前使用固定状态栏高度来进行布局的代码都需要调整为动态布局方式,否则会出现内容被遮挡的问题。特别是图中这个64,一直在iOS开发中常数般的存在,最后也被苹果爸爸摆了一道。此处不能写死关于状态栏另外两个需要注意的地方:不要在iPhone X下隐藏状态栏,一个原因是显示内容足够高了,另一个是这样内容会被刘海切割。现在通话或者其它状态下,状态栏高度不会变化了,程序不需要去做兼容。高度不变布局iPhone X的布局有很多改变,这是因为:刘海的存在使横屏的情况变得复杂四个角变圆,需要防止内容被切割代替home键的长条(不知道官方名字叫什么,homeBar?)使得屏幕底部的布局需要调整很多系统经典的控件,比如TableView,Collection,Navigation,TabBar等都会自动适应iPhone X(呵呵,一定会有很多坑等着打补丁或者让开发者擦屁股)。Safe AreaiOS11引入了safeArea的概念,用来替代之前的topLayoutGuide和bottomLayoutGuide,safeArea用来描述视图不被任何内容遮挡的部分。它提供两种方式:safeAreaInsets或safeAreaLayoutGuide来提供给你safeArea的参照值。safeArea在iPhone X上,视图的默认safeArea如下图所示:safeArea2可以看到,底部的Bar还有四周圆角,都对这个safeArea进行了切割。苹果官方的设计指导是使用以safeArea为框,以layoutMargin为间距来进行UI布局。横屏在横屏状态下,不能因为刘海的原因将内容向左或者向右便宜,要保证内容的中心对称:centercenter2另外,之前所有版本的iPhone tableView的cell和它的contentView的大小是相同的,开发者相对cell布局和相对contentView布局效果上不会有太大区别。但是在iPhone X下,由于刘海和圆角的存在,tableView的contentView会被裁切,所以所有的布局都应该被调整为相对contentView布局,否则会越界:tableView一致性苹果对iOS中运行的app的一致性有很高的要求,在iPhone X下,开发者不能自己去遮盖圆角、状态栏,特别是底部的homeBar,即使你认为刘海很丑,也许用户看着看着就习惯了呢……关于homeBar,它的颜色是会自动适应的,保持着『时刻能找到但是又不那么显眼』的状态,所以开发者不用去为它费心添加背景啊,强调啊啥的,苹果爸爸会十分感动然后拒绝掉你的……交互在交互方面,iPhone X最大的改变就是底部那个无时无刻不存在的homeBar了,代替了原来home按键的功能,系统级的任务切换和回到桌面 、、,都是上滑这个细细的长条。homeBar所以苹果爸爸的意思是:赶紧把你自己写的上滑手势乖乖删掉~当然如果app确实需要这个手势,可以打开程序开关覆盖系统的手势,但是这样用户就需要滑动两次来回到桌面了,这会让他们非常怀念home键。兼容首先是iPhone X下的键盘和其他系统有区别,会多出来那个很有趣的animateEmoji工具栏,所以在做键盘相关处理的时候要关注兼容性问题,至少:高度不要写死了……iPhone X的认证使用的是全新的faceId,所以如果app需要使用认证相关api,需要根据设备区分touchId和faceId,可以看。认证
微信扫一扫
订阅每日移动开发及APP推广热点资讯公众号:CocoaChina
您还没有登录!请或
点击量6265点击量4590点击量4565点击量3500点击量2909点击量2409点击量2381点击量2351点击量2333
&2016 Chukong Technologies,Inc.
京公网安备89issuehub.io
Contribute to Open Source. Search issue labels to find the right project for you!
help wanted
documentation
enhancement
refactoring
translation
accessibility
good first issue
903 issues
Currently the current frame is freezed and not resumed. See /airbnb/lottie-ios/issues/413 for more information
Updated 28/10/
I&m having a problem viewing the correct currency symbols in the &invoice& list on the ios app.
Under &All& / &Unpaid& / &Paid& etc&
the list shows the invoice amount. but sometimes the currency symbol is $ and sometimes the symbol is EUR. (EUR is correct)
This is also the case for Quotes. I&m not sure with &Credits&.
Updated 05/10/
3 Comments
MGLMapSnapshotOptions and MGLMapSnapshotter are currently listed under “” in the iOS and macOS API references’ tables of contents. We should add these classes under “Maps” in both jazzy.yml files so they’re easier to find.
/mapbox/mapbox-gl-native/blob/f01588cac78b5e5411385faa20500b/platform/ios/jazzy.yml#L29-L35
/mapbox/mapbox-gl-native/blob/f01588cac78b5e5411385faa20500b/platform/macos/jazzy.yml#L25-L30
/cc @fabian-guerra
Updated 04/10/
Is debugging supported on both mobile platforms?
Updated 06/10/
1 Comments
Please, provide the details below:
Did you verify this is a real problem by searching
Yes, I was not able to find anything related to it.
Tell us about the problem
Please, ensure your title is less than 63 characters long and starts with a capital
When running the
template on iOS 11.0, after navigation, when you go back the ListView component is vertically offset and immediately gets pushed back in place after the backwards navigation is completed. The same behavior is observed with the RadListView component from the
I was able to reproduce the same behavior in pure native iOS project and it looks to be coming from a change on how the
is behavior in backwards navigation on the latest iOS 11, the same is true for components backed on
like the RadListView element. Here is a screenshot, I have made the items background red to show the above white offset:
on navigation:
Which platform(s) does your issue occur on?
iOS - only on 11, on 10 works correctly.
Please provide the following version numbers that your issue occurs with:
CLI: 3.2.1
Cross-platform modules: 3.1.1
Runtime(s): 3.2.0
Plugin(s): nothing related
Please tell us how to recreate the issue in as much detail as possible.
Execute tns create my-app-name --template tns-template-hello-world-ts, as of writing this the latest version is 3.2.0
Execute cd my-app-name
Execute tns run ios (make sure that you are running agains iOS 11)
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
All the code is in the template.
Semi workaround
As a semi workaround I notice that you can change the default transition of the navigation to &slide& which solves the problem but only if you navigation via the &back& button, if you swipe with gesture (on left edge) to go back the issue is again visible even more.
To change the tradition you can do the following:
this.routerExtensions.navigate(['/your-route'], {
transition: {
name: "slide",
curve: "linear"
Updated 04/10/
2 Comments
JavaScript code can also make direct synchronous calls into native code (Java, Objective C, Swift) and get calls back from it, by means of Node’s native add-on APIs (the V8 API and N-API are both available).
How does this work exactly?
I&m trying to use the ffi on iOS. I ship my own node_modules folder, which I add to process.env.NODE_PATH at runtime.
The issue is that node-gyp simply didn&t build the native modules for arm64 in the first place.
const ffi = require('ffi');
throws the following error:
dlopen(PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node, 1): no suitable image found.
PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node: mach-o, but wrong architecture
PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node: mach-o, but wrong architecture
Is it possible to build native node addons written in c++ (that use the v8 api or the newer N-API) to work with nodejs-mobile?
Updated 09/10/
3 Comments
Issue: setting placeholder-color is applied successfully on initial load. But when the hint value is updated dynamically via binding the placeholder-color is reset to the default one and the CSS value is not applied on iOS (works as expected on Android).
Steps to reproduce:
or follow these steps
set the placeholder-color via CSS
.form-input {
placeholder-color:
the hint is dynamically changed
&Button text="change hint" tap="onChangeHint" /&
&!-- dynamically chaning the binded value will not apply the placeholder-color on iOS (works on Android) --&
&TextField class="form-input" hint="{{ hint }}" autocapitalizationType="none" autocorrect="false" keyboardType="email" returnKeyType="next"&
&/TextField&
in the code behind change the hint value dynamically
export function onChangeHint() {
vm.set("hint", "NEW HINT VALUE");
Result: on iOS after the hint value is changed, the placeholder-color is lost.
Related to
Updated 10/10/
Add &Deactivate account& button in settings like in the web client.
Updated 04/10/
Apply the 3pid login UI like on the web client (see /matrix-org/matrix-react-sdk/pull/811 for details).
Updated 04/10/
TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:
Make sample iOS project using Tangram-es 0.8.1 release
Load a scene file from disk (did not test from web)
Apply 3+ scene updates and an async scene load in that order
EXPECTED RESULT:
Not to crash!
ENVIRONMENT:
-iOS 10.x both simulator and device.
I tried to reproduce this with the debug builds available on
but to no avail. It seems the debug builds either take a slightly different code path, OR are just so much slower that tangram can cope with all the scene updates. I&ve attached the view controller code i used to do it to speed up the process.
Updated 19/10/
6 Comments
As is asserted in this
a MGLMapView is not necessarily opaque. MGLMapSnapshotter should implement an alpha channel if the background style layer has a non-opaque fill color.
Updated 04/10/
2 Comments
Snapshots include the Mapbox logo, but they should also include the copyright statements required by Mapbox’s terms of service (and the licenses of underlying sources such as OpenStreetMap).
/cc @fabian-guerra @frederoni
Updated 04/10/
8 Comments
Once exercise is clicked, show a graph with the data and if time permits show the data as well.
Updated 24/10/
On the map search function, add the ability to filter SRMP list by Region, Area, one or both.
Updated 17/10/
2 Comments
From @shivapersad on September 20,
Which platform(s) does your issue occur on?
Tell us about the problem
Unable to display &console.log()& messages in iOS applications after having upgrade to XCode 9. However, the messages are being displayed in Android.
Please provide the following version numbers that your issue occurs with:
CLI: 3.2.1
Cross-platform modules: 3.2.0
Runtime(s): 3.2.0
Is there code involved?
I am creating the template app with &tns create hello &ng& and adding a constructor method to ponent.ts file and including the command &console.log("Hello!&)& but no console.log messages are being displayed in the Terminal screen.
Any assistance is appreciated. Thanks.
Copied from original issue: NativeScript/NativeScript#4867
Updated 03/10/
7 Comments
Hello and thanks for contributing! To help us diagnose your problem quickly, please:
Include a minimal demonstration of the bug, including code, logs, and screenshots.
Ensure you can reproduce the bug using the latest release.
Only post to report a bug
direct all other questions to: /questions/tagged/mapbox
Steps to trigger behavior
Create annotations views which overlap each other.
Click overlapped annotation in random order.
Observe the result
Expected behavior
All annotations detects properly
Actual behavior
Some overlapped annotations cannot be detected properly and detect closest overlapped please look attached video.
annotation.
Updated 03/10/
Platform: iOS
Mapbox SDK version: 3.6.2
User puck is drawn in a different place after zoomLevel is changed and userTrackingMode is set to followWithCourse and userLocationVerticalAlignment is set to bottom.
Steps to trigger behavior
mapView.userLocationVerticalAlignment = .bottom
mapVIew.setUserTrackingMode(.followWithCourse, animated: false)
mapView.setZoomLevel(14, animated: true)
Expected behavior
Map should zoom out and user annotation/puck should stay at the same place as it was before the animation started.
Actual behavior
User puck moves to a different place (where the user isn&t). Panning the map helps to redraw the puck in correct location.
Updated 03/10/
I created a var folder locally in node assets and added this to may main.js within my nodejs-project. This puts the var folder at the same level as the nodejs-project
var fs = require('fs');
var varDir = path.join(__dirname, '..', 'var')
fs.writeFile(varDir, "Test write", function(err) {
if(err) return console.log(err);
console.log("The file was written");
I receive an errorno: -1,
&EPERM: operation not permitted& error when attempting to write to it. I also tried writing to nodejs-project with the same effect. I&d like to add files into the node project folder. For stashing files, the general director in iOS is
/var/mobile/Applications/&myappid&/Documents
but attempting a write here does not work either:
var appId = (__dirname).split(path.sep)[6]
var docsDir = path.join(path.sep,'var', 'mobile', 'Applications', appId, 'Documents')
console.log(docsDir: ${docsDir}`)
fs.writeFile(path.join(docsDir, &test.txt&), &Test write&, function(err) {
if(err) return console.log(err);
console.log(&The file was written&);
I receive the following error:
{ [Error: ENOENT: no such file or directory, open &/var/mobile/Applications/&myappid>/Documents/test.txt&]
message: &ENOENT: no such file or directory, open \&/var/mobile/Applications/&myappid>/Documents/test.txt\&&,
errno: -2,
code: &ENOENT&,
syscall: &open&,
path: &/var/mobile/Applications/&myappid>/Documents/test.txt& }
Updated 11/10/
7 Comments
При создании навиадреса, через мобильное приложение не присоединяет
ся фотография
Updated 04/10/
Drop NSLocationAlwaysUsageDescription in favour of NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription
I was seeing the following message in the debug window in Xcode
This app has attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain both NSLocationAlwaysAndWhenInUseUsageDescription
and NSLocationWhenInUseUsageDescription keys with string values explaining to the user
how the app uses this data
Switching to NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription resolves the issue.
Updated 31/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
Baseline Issue
Use this issue as a baseline. Please reference it from other issues related to it.
Updated 02/10/
From @NickIliev on September 29,
Setting custom title view for ActionBar is throwing on iOS with
file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:60:124: JS ERROR Error: onMeasure() did not set the measured dimension by calling setMeasuredDimension() ProxyViewContainer(11)
Reproducible only in Angular based application.
Steps to reproduce:
or the following snippet
&!-- Custom titleView NOT working on iOS - working on Android--&
&ActionBar&
&ActionBar.titleView&
&StackLayout orientation="horizontal"&
&Label text="lbl 1" textWrap="true"&&/Label&
&Label text="lbl 2" textWrap="true"&&/Label&
&Label text="lbl 3" textWrap="true"&&/Label&
&/StackLayout&
&/ActionBar.titleView&
&/ActionBar&
Copied from original issue: NativeScript/NativeScript#4905
Updated 03/10/
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
Though you are not required to fix the following issues, we wanted to make you aware of them:
Missing Marketing Icon - iOS Apps must include a px Marketing Icon in PNG format. Apps that do not include the Marketing Icon cannot be submitted for App Review or Beta App Review.
Once the required corrections have been made, you can then redeliver the corrected binary.
Updated 22/10/
2 Comments
I&m using version 1.0.6 for iOS (iphone), and noticed this issue LOW-Elves' Last Stand campaign/scenario.
When I attempt to instruct an ally by setting an objective or setting behavior, the choice menu appears behind the game layer (see attached screenshots).
Updated 26/10/
Expected Behaviour
Notification must be received in IOS
Actual Behaviour
Token is well registered but no notification received in background and in foreground. In android everything is working.
I observed lot of errors in the logs. Maybe I am doing something wrong
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Create a development certificate
Upload it in the app settings in
Download the .cer
Generate a p12 certificat
Upload it to firebase
For the rest see code
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
IOS 10.3.2
Cordova CLI version and cordova platform version
Cordova: 7.0.1
ios: 4.5.1
Plugin version
Sample Push Data Payload
"to" : "&Token&",
"alert": "Test push"
"notId": 1 ,
"priority" : 8
Sample Code that illustrates the problem
const OPTIONS: PushOptions = {
android: {
icon: "ic_notification",
iconColor : "#71a3e2"
alert: "true",
badge: "true",
clearBadge : "true",
sound: "true",
fcmSandbox : "true"
windows: {}
this.pushObject = this.push.init(OPTIONS);
console.log("Launch registration");
this.pushObject.on('registration').subscribe((data: any) =& {
console.log("device token -& " + data.registrationId);
this.token = data.registrationId;
this.sendToken();
console.log("Launch notification observable");
this.pushObject.on('notification').subscribe((data: any) =& {
console.log('notification', data);
this.handleNotificationReceived(data);
this.pushObject.on('error').subscribe(error =& console.error('Error with Push plugin', error));
This is working on android. I am using Ionic
Logs taken while reproducing problem
This is what I found interesting:
When launching the app:
createNotificationChecker
16:03:47.0 &APP&[440:185120] not coldstart
16:03:47.0 &APP&[440:185120] active
16:03:47.0 &APP&[440:185120] PushPlugin skip clear badge
16:03:47.0 &APP&[440:185164] libMobileGestalt MobileGestaltSupport.m:153: pid 440 (&APP&) does not have sandbox access for &ACCESS& and IS NOT appropriately entitled
16:03:47.0 &APP&[440:185164] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see &rdar://problem/&)
16:03:47.0 &APP&[440:185167] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
16:03:47.995 &APP&[440] &Error& [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
Then for registration:
16:03:56.0 &APP&[440:185120] Launch registration
16:03:56.0 &APP&[440:185120] Launch notification observable
16:03:56.0 &APP&[440:185163] Push Plugin register called
16:03:56.0 &APP&[440:185163] PushPlugin.register: setting badge to true
16:03:56.0 &APP&[440:185163] PushPlugin.register: clear badge is set to 1
16:03:56.0 &APP&[440:185163] PushPlugin.register: better button setup
16:03:56.0 &APP&[440:185163] FCM Sender ID 2
16:03:56.0 &APP&[440:185163] Using FCM Notification
16:03:56.0 &APP&[440:185163] Using FCM Sandbox
16:03:56.0 &APP&[440:185167] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
16:03:56.347 &APP&[440] &Error& [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
16:03:56.0 &APP&[440:185223] [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
16:03:56.351 &APP&[440] &Warning& [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
16:03:56.0 &APP&[440:185167] [Firebase/Analytics][I-ACS023007] Firebase Analytics v. started
16:03:56.358 &APP&[440] &Notice& [Firebase/Analytics][I-ACS023007] Firebase Analytics v. started
16:03:56.0 &APP&[440:185167] [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
16:03:56.359 &APP&[440] &Notice& [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
16:03:56.0 &APP&[440:185167] [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
16:03:56.359 &APP&[440] &Notice& [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
16:03:56.0 &APP&[440:185120] FCM Registration Token: &TOKEN&
16:03:56.0 &APP&[440:185120] Push Plugin register success: &405ab148 638a9d45 f101e955 a7cdff19 b121a8e2 8eea80 76b88abd&
16:03:56.0 &APP&[440:185165] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
16:03:56.401 &APP&[440] &Warning& [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
16:03:56.0 &APP&[440:185167] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
16:03:56.404 &APP&[440] &Notice& [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
16:03:56.0 &APP&[440:185167] [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
16:03:56.405 &APP&[440] &Notice& [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
16:03:56.0 &APP&[440:185120] device token -& &TOKEN&
Then I have no logs related to notification received
Updated 12/10/
31 Comments
Platform:iOS
Mapbox SDK version:3.6.2
Steps to trigger behavior
Add a fill layer
Specify fillOpacity attribute with MGLInterpolationModeCategorical containing some value (0.1, 0.2) and one value equal to 0.0
Objective-C
_placePolygonFillLayer.fillOpacity = [MGLStyleValue valueWithInterpolationMode:MGLInterpolationModeCategorical sourceStops:fillOpacitySourceStops attributeName:@"fillOpacity" options:nil];
where fillOpacitySourceStops contains :
Objective-C
@{@0:@0, @0.1:@0.1, @0.2:@0.2}
Expected behavior
Features containing property mapped with value 0.0 should not be displayed
Features containing others properties (0.1, 0.2 &) should be displayed
Actual behavior
If one of categorical stop contains value 0.0, none of the features are displayed.
If a remove 0.0 from the categorical stops, others value are displayed correctly.
Updated 02/10/
Issue Description
Thank you for this great library. When I set the replaceEnabled to false. The alert component won&t show up. But it works fine when the replaceEnabled set to true.
Steps to Reproduce / Code Snippets
import React from 'react';
import type { Element } from 'react';
import DropdownAlert from 'react-native-dropdownalert';
import styles from './Toast.styles';
type Props = { setRef: (ref: any) =& void };
export default ({ setRef }: Props): Element&any& =& (
&DropdownAlert
containerStyle={styles.container}
messageStyle={styles.message}
closeInterval={3500}
updateStatusBar={false}
replaceEnabled={false}
// &== The alert will show up when it set to "true"
ref={ref =& setRef(ref)}
Expected Results
Alert show up and animation won&t dismiss while message changed.
Additional Information
React Native version: 0.48.4
react-native-dropdownalert version: 3.1.0
Platform(s) (iOS, Android, or both?): iOS
xCode version: 9
iOS version: 11.0.1
Updated 10/10/
1 Comments
Apple open source iOS kernel.
Updated 01/10/
在iPhone X上构建你的APP
文章为 Building Apps for iPhone X
的文字实录。以视频中主人公为第一视角,结合本文作者的一些理解的进行了内容讲解。
要适配你的App,只需按照 iOS11 SDK 进行修改,就可以充分利用iPhone X搭载的超视网膜显示屏。&br>
如果你的App主要基于标准的 UIKit 控件,并且使用 AutoLayout 那么接下来的任务就会很轻松了,因为绝大多数工作都由 UIKit 为你代劳了。&br>
如果你使用的是自定义控件或没有使用 AutoLayout ,再或者你的 App 是一款自定义全屏的 App 像很多游戏那样,你也不必担心,虽然你确实有些工作要做。但整个适配过程中并没有什么难点,而且我们有很多内建支持工具,比如全新推出的 Safe Area Layout Guide 。&br>
无论如何,你都需要全面测试你的 App,尤其是在横屏模式下,以确保万无一失。
iPhone X Simulator
最新版 Xcode 包含支持 iPhone X 的 模拟器 让你可以改变绝大多数的布局, 尤其是调整关于 Safe Area 的布局。对于一些 App, 比如使用了 Metal 或是使用了前置摄像头等硬件功能的 App ,最好在实际设备上进行测试。&br>
让我们来看看全新的 iPhone X Simulator:
同其他 iPhone 或 iPad Simulator 一样,你可以直接使用系统内置 App,这样就可以很好的通过实例观察不同的 UIKit 组件在 iPhone X 上的表现。&br>
比如文件App,就展示了很多最新的 iOS11 API 的实际应用。比如一体式的 SerchBar 和 Large NavigationBar Titles 。&br>
别忘了,你还可以在 Simulator 中登录 iCloud 帐户,并访问你的 iCloud Drive 。这样你就可以方便的将文件或者照片等测试文件传输到 Simulator 中。
另外一个不错的例子就是通讯录,它展示了 TableView 如何在 iPhone X 上呈现。一定要将 Simulator 旋转至横向模式。这样就可以看到一些效果,比如 Section Header 横跨屏幕,而 TableViewCell 则遵照 SafeArea 的原则,并保持缩进。稍后还会讲到 TableView 。
接下来我们来看看我负责的项目 WWDC App,我花了一点时间,让它适配 iPhone X,我想分享一下我遇到的有关布局的问题以及我的解决方案。&br>
适配 iPhone X
WWDC是一款真实存在的App,它已经面世了很多年。这些年来,很多工程师都参与了它的编写。它既有很多标准控件和 AutoLayout,也包含自定义View。App 中较老的部分甚至使用了手动布局。我会用这款 App 来强调三处需要针对 iPhone X 进行适配的地方。&br>
首先,我在 Xcode 9 中打开工程文件,将 Base SDK 设为 iOS11,这样就可以以原生分辨率运行 App 了。&br>
当设置你的 App 时,如果你发现 App 没有完整在 iPhone X 下运行,请检查一下你是否配置了 Launch Storyboard,因为这部分设置是必须的。(编辑注: 如果没有使用Launch Storyboard的话)&br>
我们的初始视图是 Videos 标签页,效果如下图看起来还不错。这些全部使用的是今年的新代码,其中使用了遵循 AutoLayout 的 UICollectionView,以及 UINavigationBar 和 UIToolBar 控件等。所以绝大多数界面的布局都没问题,因为 UIKit 为我代劳了大部分工作。
有一个地方没有使用 AutoLayout ,那就是 News 标签页。效果如下图,其实这个 View 看起来还不错,尽管所有 UI 都是手动布局,尽管我们没有直接使用 AutoLayout,负责布局的代码也会注意到 layout margin insets,UIKit 会自动调整布局适应 Safe Area。
AutoLayout 适配 Safe Area
我遇到的第一个适配问题就是再 News 标签页中的全屏图片浏览器。尽管这个 View 使用了 AutoLayout ,但其中 PageControl 的位置太靠下了,已经与主屏幕指示器重叠在了一起。
这里的主要问题在于页面空间的底部约束关联的是 SuperView ,也就是 Home 指示器后面的整个屏幕。所以,我们不应该根据父视图进行约束,而应该将 PageControl 按照底部的 Safe Area Layout Guide 进行约束。修改方式如下:
在调整约束前,需要先启用 StoryBoard/Xib 的 Safe Area Layout Guide。Xcode 9 以前的 StoryBoard/Xib 不会自动启用该选项。需要进入 文档检查器 -> Interface Builder Document -> 勾选 Use Safe Area Layout Guides 复选框
注意: iOS StoryBoard 打开 Use Safe Area Layout Guides 功能会自动升级绑定在 top 和 bottom 的 layout guide 约束,leading Edge 以及 trailing Edge。因此,勾选后一定要检查测试所有 AutoLayout 的约束。
Storyboard Safe Area
将如图所示右侧的 Use Safe Area Layout Guide 勾选上。
勾选之后,效果如下:
多出一个叫 Safe Area 的区域,如上图所示。
此时我们来看下 PageControl 的约束,之前约束都是与 SuperView 构建的关系,现在全部变成了 Safe Area。这样就不会遮挡 Home 指示器了。 怎么样很简单吧?
Xib Safe Area
操作步骤与 Storyboard 相同
Use Safe Area Layout Guide
2. 再修改 PageControl 的 bottom 约束,将 SuperView 改成与 Safe Area
操作步骤如gif图
经过上述调整,我们的 PageControl 就已经不再遮挡 Home 指示器了,并且在横竖屏下均有效。
SearchBar 适配问题
接下来,来看看我遇到的第二个问题。问题出在 Videos 标签页,同样看上去也还不错,但当我调出 SearchBar 时,看起来位置似乎有问题,让我们和通讯录进行一下对比。
SearchBar 的背景颜色似乎不太对,Size 也不太对。如果我旋转到横屏模式,可以看出 SearchBar 和 Cancel 按钮都被屏幕的圆角裁剪掉了一部分。
这个例子说明 Safe Area 的存在显得至关重要,对于这种搜索栏 WWDC 的做法是直接显示了一个 UISearchController ,而在 iOS 11 中 SearchBar 可以集成在 NavigationBar 中,并且给出正确的显示方式。让我们来看下代码如何修改:&br>
这是显示 SearchController 的代码,需要做两处改动。
1. 将 searchController 赋值给 navigationItem.searchController
2. 让 searchController 变为活跃状态
注意: 该过程只在 iOS 11 下有效,因此,其他版本保持原有行为。
fileprivate func presentSearchController(initialSearchTeat searchTest: String? = nil) {
let searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self as? UISearchResultsUpdating
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.text = searchTest
present(searchController, animated: true, completion: nil)
fileprivate func presentSearchController(initialSearchTeat searchTest: String? = nil) {
let searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self as? UISearchResultsUpdating
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.text = searchTest
if #available(iOS 11.0, *) {
self.navigationItem.searchController = searchController
searchController.isActive = true
present(searchController, animated: true, completion: nil)
现在 SearchBar 刚好在 Safe Area 中,并且这全部是 NavigationBar 自动帮我们处理的。如果你的 UI 效果中有 SearchBar 在 navigationBar 上的话,你一定要在 iOS 11 上做类似的处理。
TableView 适配问题
现在我们来看看 App 中的第三处改动,需要改进的地方。&br>
如下是 Schedule 标签页,我们使用了 UITableView ,布局在竖屏模式下看起了不错,但这里搜索栏的样式也不太对。这个搜索栏恰好是作为 Header 视图插入到 TableView 中的。但我们可以像刚才那样改动,也就是让 SearchBar 集成到 NavigationBar 中。&br>
布局切换到横屏模式所有UI看上去都遵循了 Safe Area 布局,但仔细观察 TableView 的 SectionHeader ,它自定义的 BackgroundColor 似乎有问题,颜色应该像通讯录 App 里的 TableView 那样一直延伸到屏幕边缘。&br>
运行下代码会发现,App 将背景颜色设置给了 headerView 的 contentView ,这看上去很合理。
func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let header = view as! UITableViewHeaderFooterView
let font = UIFont.preferredFont(forTextStyle: .headline)
header.textLabel?.font = font
header.contentView?.backgroundColor = UIColor.lightGray
事实上,在除了 iPhone X 之外的 iPhone 上都没有这个问题。那问题出在了哪里呢?&br>
我们要研究下 TableView 在 iPhone X 上是如何布局 Cell 的。
为了帮助大家理解,我们通过 Xcode 的 View Hierarchy Debugger 进行视图层级的查看。
这是我们刚刚看到的视图,通过 View Hierarchy Debugger 可以调节视图的层级和控制视图的显示/隐藏。&br>
只显示 TableView ,你会发现它的尺寸是整个屏幕。
调节可见范围来显示 TableView 的 Cell 。&br>
你会发现 Cell 是与屏幕一样宽的。
选中其中一个 Cell。
再用 Safe Area 来表示它的位置。
继续调节可见范围,我们可以看到 Cell 的 contentView ,自动布局在了 Safe Area 中。
虽然 Cell 的 Size 与屏幕一样,但 Cell 的 contentView 却和 Safe Area 的 Size 相同。&br>这样发生了刚刚我们发现的问题。
刚刚我们看到的界面有些混乱,我们进行一些简化并加上一些标记。
默认情况下,TableViewCell 会包含 ContentView,这样就可以将内容适配在 Safe Area 内部。但这种行为是可以由你控制的。
在 Xcode 中你可以勾选 ContentView 的 Insets To Safe Area 选项,代码中也有对应的属性可以设置。如果不勾选或不设置,contentView 就不会适配 Safe Area,而是会与 cell 一样大小。
无论 ContentView 如何设置,它的 Layout Margin 始终默认与 Safe Area 关联。与 ContentView 适配类似,也有一些属性可以让你控制 Layout Margin 。关于这一点以及其他与边距相关的选项你可以查阅文档以及 WWDC 视频。
已经知道了原因是 Cell 的 contentView 的 Size 是与 Safe Area 相同的。通过代码我们可以了解到,我们只设置了 contentView 的背景颜色。此时,我们有几种解决方案来解决这个问题。
其中一种是禁用 TableView 的默认将 ContentView 适配 Safe Area 的行为,但这样会影响 contentView 里的其他内容。
这里最好的解决方案就是设定 backgroundView 的 backgroundColor。backgroundView 与 contentView 不同,它与 Cell 是一样大小,不受 Safe Area 影响。
func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let header = view as! UITableViewHeaderFooterView
let font = UIFont.preferredFont(forTextStyle: .headline)
header.textLabel?.font = font
header.backgroundView?.backgroundColor = UIColor.lightGray
修改完毕后,编译运行。颜色就充满了整个 Cell 。但 ContentView 中的内容并没有发生变化。
以上就是我在为 WWDC 适配 iPhone X 的时候遇到的三个问题示例。
适配 iPhone X ,需要注意以下几点:
遵循 iOS 11 SDK,使用 Launch Storyboard,可以让你的 App 与原生分辨率一致
测试UI时,横竖屏幕都要进行,绝大多数问题出在横屏下(左右横屏都要测)
遵循 Safe Area 可以避免绝大多数适配问题
AutoLayout: 设置 safeAreaLayoutGuide
手动布局: 使用 safeAreaInsets ,自由计算所需布局的数据
不要让控件遮挡屏幕底部的 Home 指示器
关于 Home 指示器以及 iPhone X 设计方面的内容,请查看 &br>
Session Name
Session Number
Session 801
Session 412
Session 219
Session 204
这个 Session,因为有很多关于 iPhone X 适配的细节包含在其中。
版权声明: , 如需转载请联系作者并标明出处,谢谢
如果觉得写得还不错,欢迎Star
Updated 30/09/
[x] job??, ??, ?? ??, ????? ??? tableview??
[x] ??? ? ????
[ ] ?? ???
[ ] ?? sorting
Updated 03/10/
1 Comments
Background
Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum
Acceptance Critera
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Updated 30/09/
When calling showAnnotations on a MGLShapeCollectionFeature, the shape collection appears not to be correctly unpacked before generating the bounding box being used.
For example, the following code results in the wrong viewport:
self.mapView.showAnnotations([shapeCollectionFeature], edgePadding: insets, animated: true)
&img width=&545& alt=&screen shot
at 1 26 53 pm& src=&https://user-/1-e2d4d0ac-a519-11e7-84bb-6b67cc1ab5be.png&>
Where as it works fine if you unpack the shapes:
self.mapView.showAnnotations(shapeCollectionFeature.shapes, edgePadding: insets, animated: true)
&img width=&545& alt=&screen shot
at 1 27 16 pm& src=&https://user-/5-ebee337c-a519-11e7-8f7c-fb.png&>
Updated 02/10/
1 Comments
User requests: 1
Updated 29/09/
Problem description
When the image property of a ImageView changes, the scaleMode of the ImageView is not applied to the new image.
Expected behavior
The current configuration of an ImageView should always be applied to its image.
In the snippet below, the top image should look like the bottom image after pressing the Change image button.
Environment
Tabris.js version: 2.1
OS: iOS 11
Code snippet
Replace in the imageview-scalemode snippet:
```javascript
const {Button, ImageView, ui} = require(&tabris&);
const MARGIN = 16;
const IMAGES = [
{name: &Large&, src: &images/salad.jpg&, scale: 3},
{name: &Small&, src: &images/landscape.jpg&, scale: 3}
let imageView = new ImageView({
top: MARGIN, width: 200, height: 200, centerX: 0,
image: IMAGES[1],
background: &rgb(220, 220, 220)&,
scaleMode: &none&
}).appendTo(ui.contentView);
new Button({
centerX: 0, top: &prev() 10&,
text: &Change image&
.on(&select&, () => {
imageView.image = IMAGES[0];
.appendTo(ui.contentView);
new ImageView({
bottom: MARGIN, width: 200, height: 200, centerX: 0,
image: IMAGES[0],
background: &rgb(220, 220, 220)&,
scaleMode: &none&
}).appendTo(ui.contentView);
Updated 29/09/
I use Nativescript angular version
I have this problem in my app:
If I start app IOS action bar title centered and if I click icon on the left then action bar title jump right. Please help me what is the wrong code
https://youtu.be/7N0wGCwV0Vo
&ActionBar class="action-bar"&
&Label class="action-bar-title text-left" text="Ajánlatok"&&/Label&
&ActionItem *ngIf="isDetailsView"
android:visibility="collapse"
(tap)="closeDetails()" ios.position="left"&
&Label [text]="drawerService.getMenuIcon('0xf3cf')"
class="font-ionic action-bar-icon"&&/Label&
&/ActionItem&
&NavigationButton *ngIf="isDetailsView"
ios:visibility="collapse"
text="" android.systemIcon="ic_menu_back"
(tap)="closeDetails()"&&/NavigationButton&
&ActionItem (tap)="userModify()"
*ngIf="drawerService.isModifyIconActive"
ios.position="right"
android.position="actionBar"&
&Label [text]="drawerService.getMenuIcon('0xf213')" class="font-ionic action-bar-icon"&&/Label&
&/ActionItem&
&ActionItem [visibility]="!drawerService.isDrawerOpen ? 'visible' : 'collapsed'" (tap)="drawerService.toggleDrawer()"
*ngIf="drawerService.isToggleIconActive"
ios.position="right"
android.position="actionBar"&
&Label [text]="drawerService.getMenuIcon('0xf394')" class="font-ionic action-bar-icon"&&/Label&
&/ActionItem&
&ActionItem [visibility]="drawerService.isDrawerOpen ? 'visible' : 'collapsed'" (tap)="drawerService.closeDrawer()"
*ngIf="drawerService.isToggleIconActive"
ios.position="right"
android.position="actionBar"&
&Label [text]="drawerService.getMenuIcon('0xf2d7')" class="font-ionic action-bar-icon"&&/Label&
&/ActionItem&
&/ActionBar&
Updated 28/09/
1 Comments
It would be nice to be able to control playback speed, so users could choose to playback at eg. 1.5 times.
Updated 28/09/
1 Comments
众所周知, ReactiveCocoa 是由 Github 工程师主导设计的一款 FRP 应用框架, 关于 RAC 和 FRP 在这里不再多作赘述。今天主要来介绍下RAC的引入。
一、引入方式
二、引入前准备
本教程使用 Xcode 8 和 Xcode 7.3.1 同时讲解(因为Xcode8已经发布GM版本, 因此主要讲解Xcode8的适配工作)
新建工程 起名 RACImport
三、手动引入
在手动引入之前, 我们先来看看官方给出的引入流程。
1.添加 ReactiveCocoa 的源到你的工程中, 需要使用到 Git 子模块
这里说到了添加 Git 子模块, 关于添加 Git 以及添加 Git 子模块在这都不作不详细赘述。
首先在工程目录中, 添加一个 Git 仓库:
对应到终端
调用git初始化命令
显示初始化成功如下图
然后调用命令
git submodule add /ReactiveCocoa/ReactiveCocoa.git external/ReactiveCocoa
开始下载 Git 子模块
下载完毕后, 提示如下:
此时, 官方给出的导入步骤中的第一步完成
2.运行子模块更新命令
执行以下代码, 更新子模块
git submodule update --init --recursive
运行结果如下:
其中更新完成后, 会多出如下几个依赖库:
注: 最新版本中添加了, ReactiveSwift , 并且支持 Xcode 8
注: 不需做任何操作
Xcode 7.3.1
如果是 Xcode 7.3.1 需要注意, 工程中的 Result 和 ReactiveSwift 都是基于 Swift3 的。语法会有很大变化
因此, 需要从 Git 分支中, Checkout 出旧 tag 版本的 ReactiveCocoa 。
的 tag 找到 v4.2.2。
进入到 ReactiveCocoa 的目录
进入目录后
git checkout v4.2.1
然后查看工程目录中的 Cartfile 文件, 文件内容如下:
github "antitypical/Result" ~& 2.1.3
接下来执行
carthage update
执行过程如下图
执行完成后, 此步骤完成
3.拖拽 .xcodeproj 文件到你的工程中
官方给出的文档中, 已经说明需要将 ReactiveCocoa.xcodeproj, Carthage/Checkouts/ReactiveSwift/ReactiveSwift.xcodeproj, and Carthage/Checkouts/Result/Result.xcodeproj 拖拽到你自己的工程中。 这三个文件相互依赖, 因此缺一不可。
在工程中创建一个 Group 起名 Frameworks
导入ReactiveCocoa.xcodeproj
导入ReactiveSwift.xcodeproj
导入Reuslt.xcodeproj
Xcode 7.3.1
官方给出的文档中, 已经说明需要将 ReactiveCocoa.xcodeproj and Carthage/Checkouts/Result/Result.xcodeproj 拖拽到你自己的工程中。 ( Xcode 7.3.1 的版本中没有
ReactiveSwift.xcodeproj )
导入ReactiveCocoa.xcodeproj
导入Reuslt.xcodeproj
4.工程目录的 &General& 的 &Embedded Binaries"添加Framework
注:这里因为一般是iOS开发因此举例导入都是iOS的Framework框架
分别引入 Result.framework, ReactiveCocoa.framework, ReactiveSwift.framework
Xcode 7.3.1
分别引入 Result.framework, ReactiveCocoa.framework
引入Framework完成后, 编译完成如果没有错误, 该步骤完成。
5.工程不包含Swift代码, 设置EMBEDDED_CONTENT_CONTAINS_SWIFT
设置 Bulid Settings 中的 EMBEDDED_CONTENT_CONTAINS_SWIFT 为 YES
上述几步完成后, 引入 ReactiveCocoa 框架
#import &ReactiveCocoa/ReactiveCocoa.h&
编译, 运行
RACSignal *singal = [RACSignal createSignal:^RACDisposable *(id&RACSubscriber& subscriber) {
[subscriber sendNext:@"暮落晨曦"];
[singal subscribeNext:^(id x) {
NSLog(@"%@", x);
查看打印结果, 如果是 暮落晨曦 , 证明框架导入成功。
四、CocoaPods引入
使用 CocoaPods 引入时, 其实相对于手动导入就简单很多。
首先, 在引入 ReactiveCocoa 之前, 先来看看 RAC 最低支持的 iOS 版本是多少。
1.创建并修改Podfile
明确了最低支持的版本, 在需要使用 CocoaPods 的工程中创建 Podfile 文件
然后使用如下命令打开 Podfile 文件
open -a Xcode Podfile
打开后的界面如下图:
修改后, 如下图:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'RACCocoaPods' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'ReactiveCocoa'
# Pods for RACCocoaPods
2.检测 Repo 中的 RAC是否为最新版本
这里会出现问题, 因为 CocoaPods 的 repo 会时刻更新, 因此在安装前先来查看下本地的 repo 中的 ReactiveCocoa 是不是最新版本
在终端中使用以下命令
pod search ReactiveCocoa
搜索结果如下:
然后打开 , 查看其分支中的 tags 最新的版本为4.2.2, 如下图
通过图片发现, 本地 Repo 中的库不是最新版本, 因此需要更新下本地 Repo
pod repo update
这个过程可能会非常的漫长, 接下来大家喝杯咖啡休息休息。
更新完成后, 再次搜索, 如下图:
3.执行 pod init 方法
pod install --verbose --no-repo-update
Xcode 7.3.1
编译运行, 一切正常。
因为 Xcode 8.0 使用了 Swift 3.0 , 因此使用 Xcode 8.0 打开, 会出现以下问题:
解决方案: 如下图, 按步骤进行即可
编译运行, 一切正常
上述几步完成后, 引入 ReactiveCocoa 框架
#import &ReactiveCocoa/ReactiveCocoa.h&
编译, 运行
RACSignal *singal = [RACSignal createSignal:^RACDisposable *(id&RACSubscriber& subscriber) {
[subscriber sendNext:@"暮落晨曦"];
[singal subscribeNext:^(id x) {
NSLog(@"%@", x);
查看打印结果, 如果是 暮落晨曦 , 证明框架导入成功。
五、Carthage 引入
新建工程, 起名 RACCarthage, 在工程目录中进行如下操作
1.创建 Cartfile 文件
touch Cartfile
open Cartfile
在 Cartfile 中填入如下代码
github "ReactiveCocoa/ReactiveCocoa"
2.执行 carthage update 命令
保存并关闭后, 在终端中执行如下命令:
carthage update
执行完毕, 效果如下:
3.将 Framework 引入工程
打开工程目录, 发现工程中多出了一个 Carthage 目录, 如下图所示:
找到 Carthage 目录下的 Framework目录, Carthage -> Build -> iOS 找到 ReactiveCocoa.framework 和 Result.framework 两个库, 如下图:
打开 RACCarthage.xcodeproj 工程文件, 然后将刚刚找到的两个 Framework 文件引入工程, 如下操作:
编译通过, 一切正常
Xcode 7.3.1
编译通过, 一切正常
上述几步完成后, 引入 ReactiveCocoa 框架
#import &ReactiveCocoa/ReactiveCocoa.h&
编译, 运行
RACSignal *singal = [RACSignal createSignal:^RACDisposable *(id&RACSubscriber& subscriber) {
[subscriber sendNext:@"暮落晨曦"];
[singal subscribeNext:^(id x) {
NSLog(@"%@", x);
查看打印结果, 如果是 暮落晨曦 , 证明框架导入成功。
至此, 三种引入方式都已介绍完毕。 写这篇博客时, 恰好赶上 Xcode 8 GM 发行, 因此, 在博客中就将 Xcode 8 的集成方式也做了详细描述, 希望能帮到大家。如有疑问或错误, 欢迎评论指出。
ReactiveCocoa 库已支持 Swift3.0 , 但是还会出现问题,因为 CocoaPods 版本过低。需要将 CocoaPods 升级至 1.1.0 ,即可正常运行。
版权声明: 如需转载, 请说明出处。谢谢!by
Updated 28/09/
AFNetworking 3.0
AFNetworking是一款在OS X和iOS下都令人喜爱的网络库。为了迎合iOS新版本的升级, AFNetworking在3.0版本中删除了基于 NSURLConnection API的所有支持。如果你的项目以前使用过这些API,建议您立即升级到基于 NSURLSession 的API的AFNetworking的版本。本指南将引导您完成这个过程。
本指南是为了引导使用AFNetworking 2.x升级到最新的版本API,以达到过渡的目的,并且解释了新增和更改的设计结构。
新设备要求: iOS 7, Mac OS X 10.9, watchOS 2, tvOS 9, & Xcode 7
AFNetworking 3.0正式支持的iOS 7, Mac OS X的10.9, watchOS 2 , tvOS 9 和Xcode 7。如果你想使用AFNetworking在针对较旧版本的SDK项目,请检查的兼容性信息。
NSURLConnection的API已废弃
AFNetworking 1.0建立在NSURLConnection的基础API之上 ,AFNetworking 2.0开始使用NSURLConnection的基础API ,以及较新基于NSURLSession的API的选项。 AFNetworking 3.0现已完全基于NSURLSession的API,这降低了维护的负担,同时支持苹果增强关于NSURLSession提供的任何额外功能。由于Xcode 7中,NSURLConnection的API已经正式被苹果弃用。虽然该API将继续运行,但将没有新功能将被添加,并且苹果已经通知所有基于网络的功能,以充分使NSURLSession向前发展。
AFNetworking 2.X将继续获得关键的隐患和安全补丁,但没有新的功能将被添加。Alamofire(Swift下的网络请求)软件基金会建议,所有的项目迁移到基于NSURLSession的API。
下面的类已从AFNetworking 3.0中废弃:
* AFURLConnectionOperation
* AFHTTPRequestOperation
* AFHTTPRequestOperationManager
下面的类包含基于NSURLConnection的API的内部实现。他们已经被使用NSURLSession重构:
* UIImageView+AFNetworking
* UIWebView+AFNetworking
* UIButton+AFNetworking
AFHTTPRequestOperationManager 核心代码
如果你以前使用 AFHTTPRequestOperationManager , 你将需要迁移去使用 AFHTTPSessionManager。 以下的类在两者过渡间并没有变化:
* securityPolicy
* requestSerializer
* responseSerializer
接下来举一个关于AFHTTPSessionManager的简单例子。注意HTTP网络请求返回的不再是AFHTTPRequestOperation, 修改成为了NSURLSessionTask,并且成功和失败的Block块中的参数也变更为了NSURLSessionTask,而不再是AFHTTPRequestOperation。
AFNetworking 2.x
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:@"请求的url" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"成功");
} failure:^(AFHTTPRequestOperation *operation, NSError*error) {
NSLog(@"失败");
AFNetworking 3.0
AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
[session GET:@"请求的url" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
NSLog(@"成功");
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"失败");
AFHTTPRequestOperation 核心代码
与NSURLConnection对象不同,每个共享应用范围的设置如会话管理、缓存策略、Cookie存储以及URL协议等,这些NSURLSession对象都可以单独进行配置。使用特定的配置来初始化会话,它可以发送任务来获取数据,并上传或下载文件。
在AFNetworking 2.0中,使用AFHTTPRequestOperation,有可能创建一个没有额外开销的独立的网络请求来获取数据。NSURLSession则需要更多的开销,为了获得所要请求的数据。
接下来,将要通过AFHTTPSessionManager创建一个对象,并创建一个任务和启动它。
AFNetworking 2.x
NSURL *URL = [NSURL URLWithString:@""];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
op.responseSerializer = [AFJSONResponseSerializer serializer];
[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
[[NSOperationQueue mainQueue] addOperation:op];
AFNetworking 3.0
NSURL *URL = [NSURL URLWithString:@""];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:URL.absoluteString parameters:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionTask *operation, NSError *error) {
NSLog(@"Error: %@", error);
UIKit的迁移
图片下载已经被重构,以遵循AlamofireImage架构与新的AFImageDownloader类。这个类的图片下载职责的代理人是UIButton与UIImageView的类目,并且提供了一些方法,在必要时可以自定义。类别中,下载远程图片的实际方法没有改变。
UIWebView的类目被重构为使用AFHTTPSessionManager作为其网络请求。
UIAlertView的类目被废弃
从AFNetworking 3.0后UIAlertView的类目因过时而被废弃。并没有提供UIAlertController类目的计划,因为这是应用程序应处理的逻辑,而不是这个库。
纯属个人翻译,如有错误,还请纠正。
Updated 28/09/
The Keyman logo is stretched on iOS 11. May possibly be related to the new safe areas in iOS 11.
&img width=&376& alt=&screen shot
at 10 39 23 am& src=&https://user-/e80-a439-11e7-dccf21adf.png&>
&img width=&377& alt=&screen shot
at 10 39 08 am& src=&https://user-/aa30-a439-11e7-db2125f1.png&>
Updated 03/10/
1 Comments
Probably related to the following:
/app/Sensus-Production/issues/1820
Updated 27/09/
Description
Music control is not showing the album artwork from url.
1. Sample code
MusicControl.setNowPlaying({
title: `${episode.title}`,
artwork: '/soundwiseinc/demo/d4c68be0-9d6c-11e7-81ba-d3b.png',
artist: _currentPublisher.name,
album: _currentSoundcast.title,
duration: Playing._duration, // (Seconds)
description: episode.description, // Android Only
color: 0xFFFFFF, // Notification Color - Android Only
date: moment(episode.date_created * 1000).utc().format(), // Release Date (RFC 3339) - Android Only
rating: episode.likes && Object.keys(episode.likes).length || 0 // Android Only (Boolean or Number depending on the type) //
Platform ?
[x ] Real device
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
"react-native-music-control": "git+/tanguyantoine/react-native-music-control.git",
Updated 28/09/
1 Comments
Saigon Pearl, 92 Nguyen Huu Canh, Ward 22, Binh Thanh District, HCMC, Vietnam
Salary Expectation
Competitive
Requirements
We are looking for a junior iOS developer who will be responsible for multiple iOS libraries and apps,
including design, architecture, development and testing.
At the same time, you will be part of the product development as our products are built by developers
for developers.
Our forward product is Brain Tracker, an analytics-driven tool to answer the question of how good a
developer is. With Brain Tracker, we will help build the next generation of elite developers. You will
also be exposed and required to work with UserKit, a set of APIs and our identity management and
engagement systems which play a huge role in Brain Tracker.
Have strong Computer Science foundation
Have the ability to write code with efficiency and readability
Have experience with iOS development using Swift
Be familiar with Git and GitHub
Good verbal and written English communication skills
Meticulous
Positive attitude with a hunger for learning
Ability to self-study and research, willing to learn attitude
Like to work in an agile development environment
Self-driven and able work well in a team
&Do what it takes& attitude is critical
Responsibilities
Work with the mobile team to estimate, develop, test and maintain iOS apps and libraries
Support the technical design process for the iOS projects
Assist in documenting the products
Provide technical support on the iOS projects to other members of the team
Take part in the server APIs definition process
Why it would be awesome to work with us
Work with a product-driven team of founders and developers directly to drive change
Be exposed to our users to see the change and value you are bringing to society
Meet and learn from experienced entrepreneurs. Be part of an experienced team that sets out to create positive social impact
International exposure. We are a result-driven international team. The core team worked in Silicon Valley, Singapore, Hong Kong, New Zealand and you can expect the culture to be built on trust and results
Freedom and flexibility. In terms of work hours, responsibility and autonomy, you get to decide what works best for you. Usually between 9.00 am and 6.00 pm on Monday to Friday. And it can be flexible, we don’t measure your success by the number of office hours
Further benefits including flights, training, and other living expenses while training, exchanging with other teams and liaising with clients
Homey office in Binh Thanh District including breakfast and lunch
14 days of annual leave, 14 days of medical leave, and public holidays in Vietnam
No dress code. It’s your choice to be confident and comfortable
Pantry area with snacks, beer, and other beverages.
Interested?
Homepage: http://www.mstage.io/
Master your crafts and make impacts with us by emailing the below to linh@mstage.io
CV (no more than 2 pages with relevant experiences. Just keep this simple)
We do not need a cover letter, just two sentences to sum up yourself
For shortlisted candidates, be prepared for a short interview on Skype followed by a round at our office.
Updated 12/10/
Dear friend, we, the rest of the NativeScript community really
appreciate your feedback! While we are doing all we can to take care of every
issue, sometimes we get overwhelmed. Because of that, we will consider issues
that are not constructive or problems that cannot be reproduced &dead&.
Additionally, we will treat feature requests or bug reports with unanswered
questions regarding the behavior/reproduction for more than 20 days &dead&. All
&dead& issues will get closed.
Please, provide the details below:
Did you verify this is a real problem by searching
Tell us about the problem
Please, ensure your title is less than 63 characters long and starts with a capital
Which platform(s) does your issue occur on?
iOS/Android/Both
Please provide the following version numbers that your issue occurs with:
CLI: (run tns --version to fetch it)
Cross-platform modules: (check the &version& attribute in the
node_modules/tns-core-modules/package.json file in your project)
Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
package.json file of your project)
Plugin(s): (look for the version number in the package.json file of your
Please tell us how to recreate the issue in as much detail as possible.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
Updated 27/09/
5 Comments
Platform: iOS
Mapbox SDK version: 3.6.4
Steps to trigger behavior
Create a new Xcode project
Include the Mapbox iOS SDK via CocoaPods
Attempt to build application and view the resulting storyboard error:
Failed to render and update auto layout status for ViewController (BYZ-38-t0r):
The agent crashed Main.storyboard
Expected behavior
The application should compile without the IB Designables error.
Actual behavior
An IB Designables error is returned.
cc @1ec5 @friedbunny
Updated 26/10/
7 Comments
Create the cards for the new&s view.
The card will contain an image on the left, with the title and description on the right. When clicked, it will open up a web view with the article.
Updated 24/10/
Allow apps to insert tiles and resources into the offline storage. I use this to download server-generated offline archives and then inserting all of the tiles and resources into the offline storage.
Updated 31/10/
[X ] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the .
[ X] I reviewed the
and open GitHub issues and verified that this report represents a potentially new issue.
[X ] I verified that the
application works in my environment.
Code to reproduce the issue:
constraints={
video: true,
audio: true
Twilio.Video.createLocalTracks(constraints).then(function(localTracks) {
currentLocalTracks=localT
var localMediaContainer = document.getElementById(&localVideo&);
localTracks.forEach(function(track) {
localMediaContainer.appendChild(track.attach());
twRoom.localParticipant.addTrack(track);
Issue Description:
We tried group and P2P.
The issue refers to GROUP and we managed to get the following working:
1. connect to room.
2. receive participant audio and video.
When we tried on P2P, it completely did not work and did not crash.
Expected behavior:
When user clicks to start audio video, the phone should prompt to allow camera/microphone.
*Actual behavior:
The phone completely crashed and we had to do hard reset after each test.
Software versions:
[X ] Browser(s): Safari 11, Chrome 61.0.
[X ] Operating System: iOS 11,MAC OSX 10.12.6
[X ] Device: iphone 6 plus.
[X ] twilio-video.js: Using the latest from CDN:
///sdk/js/video/v1/twilio-video.min.js
[X ] Third-party libraries (e.g., Angular, React, etc.): None
Updated 30/10/
6 Comments
Job description
We are looking for talented iOS Developers to join our engineering team at Tonish Vietnam JSC.
Your primary focus will be the development of iOS applications and their integration with back-end services. You will be working with our distinguished engineers to create performance driven products. Successful engineers at our Hanoi based team will have great opportunities to join our team at Melbourne or Tokyo.
Hanoi, Vietnam
Salary Expectation
Up to $1000/month
Confident ability to read and write documentation in English
Experience with Git
2+ year experience with iOS (Swift, Objective-C, Cocoa)
Strong knowledge of iOS SDK and Xcode
Client-Server applications and architecture (working with network requests and RESTful APIs)
B.S./M.S. in Computer Science or equivalent, and 3+ years of software engineering
Experience in working with Reactive Programming, especially with RxSwift
Experience with iOS dependencies and automation tools (CocoaPods, Carthage, fastlane)
Experience with continuous integration and continuous delivery
Have published apps in App Store
Contributions to open source projects
Experience with Android
Responsibilities
Work closely with product, backend, and QA teams to iterate quickly on new features and experiments
Dive deeply into instruments tracking down leaks, bugs and identifying areas for optimization
Send us the following to hr@tonish.vn.
* Your CV in English
* Your GitHub profile
Updated 12/10/
https://jira.appcelerator.org/browse/TIMOB-25301
Updated 31/10/
5 Comments
Awhile ago we decided to pull out to view the entire globe when running a traceview.
For phones this works well, however, on tablets the node popup has an &arrow& that points to the selected node. When we zoom out this no longer points to the node.
We have a few options:
1. Do not zoom out on tablets
2. Hide the arrow when we zoom out
@apike @rachteo Thoughts?
Updated 28/09/
3 Comments
When I try to start download. It failed. From sample project.
[DownloadManager] Add -& New items: 1 at -1 || Old items: 0 at -1
Thread started:
[DownloadManager] Remove -& New items: 0 at -1 || Old items: 1 at -1
Updated 26/09/
7 Comments
[x] Download
[ ] Favorite
Updated 26/09/
Reporter by Enrico:
It looks like a data corruption, probably caused by a bug in ThaliCore.
When the replication starts, the SSL handshaking completes successfully and the first device starts sending the attachment to the second device in chucks of 16384 bytes each.
The second device receives the first few chunks and decrypts them without errors.
Then, usually it's the 5th chunk, a chunk arrives with a length of 16394 byes that is clearly wrong, since only 16384 were sent. The first 16032 bytes of the chunk are OK, but the last 352 bytes are different from the last 352 bytes sent, plus there are 8 extra bytes. At that point the SSL routine, that decrypts the chunk, returns an error.
It doesn't look like it's a bug in SSL or in JXcore, I guess it's a bug in the transmission/reception of the chunk.
Updated 10/10/
8 Comments
My environment:
react-native
- react-native version:最新
- aurora-imui-react-native version:最新
一进界面就会调用onPullToRefresh 而且如果只写onPullToRefresh消息会错错乱丢失的情况,必须在constructor先加一些消息才正常。android 还是没有下刷新的进度条。
Updated 27/09/
3 Comments
Thank you for opening an issue for Tabris.js!
Please include the following information, if applicable.
A small code snippet helps us reproduce the issue.
Problem description
cordova-plugin-x-toast hide() is not work in 2.1.0 developer app on iphone6s.
&!& What type of problem do you experience? Screenshots are welcome if applicable. &>
Expected behavior
should be hide when toast success. i tried setTimeout 1000 but it&s not hide too.
&!& Based on the problem described above, what would the expected behavior be? &>
Environment
Tabris.js version:2.1.0 &!& e.g. 2.0. When using &nightly& please provide concrete version. &>
Device:iphone6s &!& e.g. iPad Pro or Samsung Galaxy S8 &>
OS:IOS 10.3.3 &!& e.g. iOS 10.3.1 or Android 7.1 &>
Code snippet
// A minimal, *self-contained* code snippet to reproduce the problem:
window.plugins.toast.showShortTop("test",()=&{
window.plugins.toast.hide();
//is not hide...
Updated 25/09/
2 Comments
From a user&s support request:
Noticing a bug in this release I want to share.
When reading through a site&s feed or a folder&s list of articles, articles that were read and then marked as unread become re-marked as read as I keep scrolling through the rest of the unread stories.
So after going through a feed of unread stories, if you saved a few along the way and hit Done at the end, the user will lose those saved news items.
Updated 21/09/
PLEASE DON&T DELETE THIS TEMPLATE UNTIL YOU HAVE READ THE FIRST SECTION.
Is this a bug report?
If you answered &Yes&:
We expect that it will take you about 30 minutes to produce a high-quality bug report.
While this may seem like a lot, putting care into issues helps us fix them faster.
For bug reports, it is REQUIRED to fill the rest of this template, or the issue will be closed.
If you answered &No&:
We use GitHub Issues exclusively for tracking bugs in React Native. If you're looking for help,
the Community page at http://facebook.github.io/react-native/support.html list various resources
that should help you get started.
Now scroll below!
Have you read the ?
Environment
In your terminal run react-native info and paste its contents here. Next, specify your target platform, like this:
Environment:
macOS Sierra 10.12.6
Xcode 8.3.3 Build version 8E3004b
Android Studio:
2.3 AI-162.4069837
Packages: (wanted => installed)
react-native: 0.48.1 => 0.48.1
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
Target Platform: iOS (10.3)
***Make sure you are on v0.48.0 or greater of react-native, otherwise you may get this error:
Unrecognized command &info&
Run react-native &help to see list of all available commands
Environment:
macOS Sierra 10.12.5
Xcode 8.3.3 Build version 8E3004b
Android Studio:
2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.3 => 0.48.3
Steps to Reproduce
How would you describe your issue to someone who doesn’t know you or your project?
Try to write a seque

我要回帖

更多关于 ios safeareainsets 的文章

 

随机推荐