ios11

UITableview merging with the home indicator on iPhone X

☆樱花仙子☆ 提交于 2019-12-04 14:53:25
I have a UITableView created programmatically. This UITableView merges with the home indicator on an iPhone X device. How can I fix this issue? Programatically, set bottom anchor of tableview with bottom anchor of SafeAreaLayout. Here is sample/test code, how to programatically set safe area layout with respect to interface elements. if #available(iOS 11, *) { let guide = view.safeAreaLayoutGuide NSLayoutConstraint.activate([ table.topAnchor.constraintEqualToSystemSpacingBelow(guide.topAnchor, multiplier: 1.0), guide.bottomAnchor.constraintEqualToSystemSpacingBelow(table.bottomAnchor,

Migrating a project using autoresizing masks for iPhone X

别来无恙 提交于 2019-12-04 12:21:40
We have some legacy projects that are still using Autoresizing masks, and everything was working fine until iOS 11 and iPhone X. With the introduction of safe area layout guides, what's the best solution to support iPhone X? We can convert all interfaces with autoresizing masks to use auto-layouts. This appears to be a significant effort, considering views are being dynamically added and adjusted. We keep using autoresizing masks but adjust the interfaces to add inset margins for iPhone X and iOS 11. A third option would be to use autolayout where you need to and leave the rest of the app with

iOS 11: Height of UINavigationBar for large title (mimic Apple Music App)

丶灬走出姿态 提交于 2019-12-04 11:19:31
I'm trying to mimic the look of UINavigationBar as used by the Apple Music App (the date is shown above the large title). I know that the Apple Music App doesn't use the standard UINavigationBar of ios11 but a header view is UICollectionView . I also want to use the standard UINavigationBar of ios11 because of the resizing feature for title text. I'm able to add the custom date label to view hierarchy of the large title view , my code as shown below: self.title = "Large Title" navigationController?.navigationBar.prefersLargeTitles = true guard let navigationBar = navigationController?

UIColor(named:) always returns nil on iOS 11.0-11.2

六月ゝ 毕业季﹏ 提交于 2019-12-04 10:37:08
问题 I have a class that returns a UIColor from my custom palette. I call this programmatically but when I tested it on iOS 11 it always returns a nil result... I tried this on multiple devices and OS versions 11.0, 11.0.1, 11.2 and all of them returns nil . But as soon as I run them on >iOS 12 it always returns a correct color. var color: UIColor? { switch self { case .darkIndigo: return UIColor(named: "darkIndigo") case .lightNavy: return UIColor(named: "lightNavy") case .cobalt: return UIColor

How to add refresh control to collection view large titles navigation bar in iOS 11?

耗尽温柔 提交于 2019-12-04 10:23:21
问题 According to Apple the refresh control should be part of the large title navigation bar in iOS 11. The refresh control is part of the navigation bar (on pull to refresh) when I enabled the refresh control in my storyboard for a UITableViewController. I can not do this in storyboard for all other views like UICollectionViewController. When I add a refresh control in code as a subview it is not part of the navigation bar: refreshControl = UIRefreshControl() collectionView?.addSubview

Import multiple files in app via iOS11 files app

自闭症网瘾萝莉.ら 提交于 2019-12-04 10:19:08
问题 I am trying to import multiple files from the new iOS11 files app into my app. However when I select two or more files (both of the same type, pdf) in the files app then hit the share button and select my app (copy to myApp) the - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options gets called only once and only the first file of my selection gets imported successfully. So I tried if this works in some other apps like

iOS 11: UITextView typingAttributes reset when typing

时间秒杀一切 提交于 2019-12-04 09:16:46
问题 I use typingAttributes to set a new font. On iOS 10 , everything works, but on iOS 11 , first typed character is correct, but then attributes are being reset to the previous ones, and the second character is typed with the previous font. Is this a bug? Can I fix it somehow? 回答1: I ran into the same issue and eventually solved it by setting typingAttributes again after every edit. Swift 3 func textViewDidChange(_ textView: UITextView) { NotesTextView.typingAttributes =

How to generate an UIImage from AVCapturePhoto with correct orientation?

浪子不回头ぞ 提交于 2019-12-04 08:37:44
问题 I am calling AVFoundation 's delegate method to handle a photo capture, but I am having difficulty converting the AVCapturePhoto it generates into an UIImage with the correct orientation. Although the routine below is successful, I always get a right-oriented UIImage ( UIImage.imageOrientation = 3). I have no way of providing an orientation when using the UIImage(data: image) and attempting to first use photo.cgImageRepresentation()?.takeRetainedValue() also doesn't help. Please assist. Image

Using iOS8 and later devices with Xcode

被刻印的时光 ゝ 提交于 2019-12-04 08:32:00
问题 Using iOS8 and later devices with Xcode? 回答1: Well you have two options: 1)Straightforward, download Xcode 9 and you are good to go. 2) You need to put DeveloperDiskImage of iOS 11 in /Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport Put iOS 11 DiskImage and you can find this diskImage in Xcode9 at same path in case you want to continue with XCode8 Path of iOS 11 Disk Image: ~/Applications/Xcode9.app/Contents/Developer/Platforms/iPhoneOS.platform

iOS11 vision framework mapping all face landmarks

无人久伴 提交于 2019-12-04 08:11:19
问题 I am playing with vision framework and getting all landmark points with this code: if let allFaceLandmarks = landmarks.allPoints { print(allFaceLandmarks) } But cant find mapping for these points. For example index numbers for right eye. Looking for something the same as this, but for Vision framework instead. 回答1: I have no clue why apple doesn't provide a graphic of this. It seems like it would be super helpful information to give people in the docs. At any rate, I was able to read the