ios11

iOS 11 large title navigation bar snaps instead of smooth transition

六月ゝ 毕业季﹏ 提交于 2019-12-02 18:05:49
I'm facing an issue where the large title navigation bar collapses very abruptly when scrolling on a UITableView embedded inside of a UIViewController. The problem seems to only occur when scrolling up on the screen. When scrolling down on the screen, the title transitions smoothly to being big again, but not vice versa. This issue does NOT occur if using a UITableViewController. Here is the normal, expected behavior when scrolling inside a UITableViewController. And here is the broken, abrupt transition when using a UITableView inside of a UIViewController. Here is the code for the broken

unrecognized selector sent to instance when no related entities found in Core Data

淺唱寂寞╮ 提交于 2019-12-02 17:23:26
问题 I have a Core Data problem - I have two entity's with the second being a one to many relation ship to the first. When trying to load a detailed view controller on the first with the first one's information and a UITableView fo the details of the 2nd, I am hoping this tableView code would allow me to show a blank table if now records are found. Instead I get a crash as indicated above. I have tried to cover the "Event" (the related NSSet) into an array, but I am not sure how to debug this

iOS 11: ATS (App Transport Security) no longer accepts custom anchor certs?

点点圈 提交于 2019-12-02 17:17:18
I am leasing a self signed certificate using NSMutableURLRequest and when the certificate is anchored using a custom certificate with SecTrustSetAnchorCertificates IOS 11 fails with the following error message: refreshPreferences: HangTracerEnabled: 1 refreshPreferences: HangTracerDuration: 500 refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0 ATS failed system trust System Trust failed for [1:0x1c417dc40] TIC SSL Trust Error [1:0x1c417dc40]: 3:0 NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) Task <721D712D-FDBD-4F52-8C9F

UISearchBarSearchField BackgroundView color

こ雲淡風輕ζ 提交于 2019-12-02 17:13:07
问题 I am trying to change the background color of the search bar text field and i have searched and tried lots of solutions but those are not working. So, please anyone can tell me the exact solution for that. How can we change the background color of the search bar text field? /// used to prepare searchController inside navigation. private func prepareNavigationSearchControllerSetup() { self.title = AppConstant.kContacts let search = UISearchController(searchResultsController: nil) search

iPhone X hide home indicator on view controller

北城以北 提交于 2019-12-02 17:04:13
I have a view controller that takes up the whole screen from top to bottom. I would like to hide the home bar indicator on the bottom of the screen on iPhone X devices. How can I do this in iOS 11? You should override prefersHomeIndicatorAutoHidden in your view controller to achieve that: override var prefersHomeIndicatorAutoHidden: Bool { return true } There is another alternative. If you are looking for the behavior where the indicator dims, then when the user swipes up it activates, and when they swipe up again the home action is invoked (I.E., two swipes are needed to invoke), then the

UICollectionView in landscape on iPhone X

爷,独闯天下 提交于 2019-12-02 16:36:38
When iPhone X is used landscape, you're supposed to check safeAreaInsets to make suitably large gutters on the left and right. UITableView has the new insetsContentViewsToSafeArea property (default true) to automatically keep cell contents in the safe area. I'm surprised that UICollectionView seems to not have anything similar. I'd expect that for a vertically-scrolling collection view, the left and right sides would be inset to the safe area when in landscape (and conversely, a horizontally-scrolling collection view would be inset if needed in portrait). The simplest way to ensure this

iOS11 更改状态栏、导航栏颜色的方法

泪湿孤枕 提交于 2019-12-02 14:21:58
ios上状态栏 就是指的最上面的20像素高的部分 状态栏分前后两部分,要分清这两个概念,后面会用到: 前景部分:就是指的显示电池、时间等部分; 背景部分:就是显示黑色或者图片的背景部分; (一)设置statusBar的【前景部分】 简单来说,就是设置显示电池电量、时间、网络部分标示的颜色, 这里只能设置两种颜色: 默认的黑色(UIStatusBarStyleDefault) 白色(UIStatusBarStyleLightContent) 可以设置的地方有两个:plist设置里面 和 程序代码里 初始化设置:导航栏设置为不透明并给了"标题"与状态栏文字作对比 self.edgesForExtendedLayout = 0; self.navigationItem.title = @"标题"; 只设置navigationBar不透明和写了一个标题.png 改变状态栏的方法 方法一: 1、plist View controller-based status bar appearance 设置为 NO 设置为NO.png 2、代码设置 [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; 效果如下: 状态栏白色.png 方法二: 1、plist View controller

how can i put these print text into Textfield?

我是研究僧i 提交于 2019-12-02 13:40:49
UNUserNotificationCenter.current().getPendingNotificationRequests { DispatchQueue.main.async{//Contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body let str:String = "" self.finalresulter.text = str self.finalresulter.text = "\($0.map{$0.content.title})" } } You are using $0 inside async { } closure. This closure expects no arguments, which means using $0 argument shortcut is invalid. You are evidently attempting to refer to requests array from getPendingNotificationRequests callback. The reason you can't by using $0 is that it's screened by DispatchQueue

What are the model names for IPhone 8 and iPhone X? [duplicate]

独自空忆成欢 提交于 2019-12-02 13:09:13
This question already has an answer here: iPhone 8, iPhone 8 Plus and iPhone X device code 2 answers Can anyone who have access to iPhone 8 and iPhone X let me know the model names? It could be accessed by UIDevice.current.modelName . Rashwan L The information as @Anbu mentioned are: iPhone 8: iPhone10,1 and iPhone10,4 iPhone 8 Plus: iPhone10,2 and iPhone10,5 iPhone X: iPhone10,3 and iPhone10,6 Remember if you want to use UIDevice.current.modelName you need to create your own extension since this is not a default value in UIDevice.current . 来源: https://stackoverflow.com/questions/46234177/what

Open specific item in Settings app from my app in iOS 11

China☆狼群 提交于 2019-12-02 11:56:09
I have studied several answers and haven't found any that would work for iOS 11. I want to show the way to switch Background App Refresh on for my user. To do that I want to open Settings/General/Background App Refresh menu from my app. The following code only opens root menu of the Settings app. guard let url = URL(string: "App-Prefs:root=General&path=BACKGROUND_APP_REFRESH") else { return } UIApplication.shared.open(url, options: [:], completionHandler: nil) Is there any way that would be allowed by Apple to do that? If you open the URL UIApplicationOpenSettingsURLString then you'll be taken