ios9

iOS9 - NSAppTransportSecurity

久未见 提交于 2019-11-29 12:33:27
iOS9 - NSAppTransportSecurity 配置要求 属性结构 属性详解 事例讲解 只有HTTPS 所有网址都不经过ATS关闭ATS 所有网址都经过ATS添加一些例外白名单 所有网址都不经过ATS添加例外 使用低等级版本的TLS协议 如何配置 iOS9 - NSAppTransportSecurity 原文地址: http://www.pluto-y.com/ios9-nsapptransportsecurity/ App Transport Security(以下均称 ATS )是iOS9提供的一个新特性,主要是保证app和web服务之间的安全。如果不想开启的话,可以关闭这个特性。 所有用到 NSURLConnection 、 CFURL 以及 NSURLSession API都会触发 ATS (使用iOS9的SDK编译)验证, 所以在iOS9中需要符合一些配置才可以使 ATS 正常运行。 配置要求 关于App Transport Security 的一些进本配置要求: * 服务器只要支持TLS协议1.2 * 加密算法也是有限制,需要在以下列表中 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256

Swift 2 migration problems

无人久伴 提交于 2019-11-29 12:31:44
I just opened my old project in Xcode 7 beta. The code works perfectly fine in Xcode 6, but now it's showing many error. I don"t know what those are. Can anybody explain why this happened, and how to fix it? Thank you! Here is the Code import UIKit import AVFoundation class ViewController: UIViewController { var player: AVAudioPlayer = AVAudioPlayer() @IBOutlet weak var firstCardImageView: UIImageView! @IBOutlet weak var secondCardImageView: UIImageView! @IBOutlet weak var label: UILabel! var cardNamesArray:[String] = ["dice1","dice2","dice3","dice4","dice5","dice6"] override func viewDidLoad(

WKWebView notification when view is actually shown

核能气质少年 提交于 2019-11-29 12:24:45
问题 I want to take a screenshot of a WKWebView . I call the method drawViewHierarchyInRect (with screen updates set to true ) right after the web view finished loading - for this purpose I observe the loading property of the web view. However, I noticed, that at the time the web view notifies me that loading has finished, it doesn't actually display itself on the screen. That's why the screenshot is always only white. When I take the screenshot 0.5 seconds after loading (which is obviously too

Display Separator only for the Available CellForRow in UITableView

柔情痞子 提交于 2019-11-29 12:21:27
问题 I am using UITableView with custom cell. It is working fine but problem is when there is only one or two cell in UITableView. It is giving the separator for the empty cell also. Is it possible to display separator only for the cell that is load with my custom cell? 回答1: You need to add an empty footer view to hide empty rows from a table. Swift: In your viewDidLoad() self.tblPeopleList.tableFooterView = UIView.init() Objective-C: Easiest way: in your viewDidLoad method, self.yourTableView

(XCode 7 + iOS 9 + iPhone 4s/iPhone5 only) issue: “malloc: *** mach_vm_map(size=1048576) failed (error code=3)”

心不动则不痛 提交于 2019-11-29 12:04:50
问题 I know the issue is related to memory allocations, but I get it in only iOS 9, XCode 7. In XCode 6.4, iOS 8.4, it works just perfect, no issue at all at any ways. In iOS 9, XCode 7, it just crashes very frequently giving this error. malloc: *** mach_vm_map(size=1048576) failed (error code=3) *** error: can't allocate region securely *** set a breakpoint in malloc_error_break to debug Any suggestions? I am working on memory issues, but I wonder if there were too many memory issues, then why

After updating Xcode to IOS 9, app stucks on splashscreen and initial viewcontroller is not loaded

只谈情不闲聊 提交于 2019-11-29 12:01:51
Using a storyboard in Xcode, I have an application that worked nicely, but after latest Xcode update (IOS 9), the app stucks on the splash screen. DidfinishLaunchingWithOptions is succesfully called and reaches the end of the function, but the initial viewcontroller is not being loaded. If I switch the initial view controller to another screen, it works fine.. How can it be that the initial view controller is not loaded for the one screen, and it does get loaded if I set it on the second screen? I first thought it had perhaps to do with constraints, or UI elements, but even after resetting

sorted function in Swift 2

浪尽此生 提交于 2019-11-29 11:22:40
I'm sorting an Array like this: var users = ["John", "Matt", "Mary", "Dani", "Steve"] func back (s1:String, s2:String) -> Bool { return s1 > s2 } sorted(users, back) But I'm getting this error 'sorted' is unavailable: call the 'sort()' method on the collection What should be the correct way to use the sort() method here? Follow what the error message is telling you, and call sort on the collection: users.sort(back) Note that in Swift 2 , sorted is now sort and the old sort is now sortInPlace , and both are to be called on the array itself (they were previously global functions). Be careful,

iOS 9 disable support for right-to-left language

陌路散爱 提交于 2019-11-29 11:16:50
问题 My iOS app is in Arabic (right-to-left) language only. Prior to iOS 9 the views layout and view animations were all by default left-to-right. So, I had customised the complete app and had reversed the default behaviour e.g. back button in navigation bar was set to be on the right instead of default left. But now when the app is compiled using latest SDK (Xcode 7 beta 4), everything is the opposite of what I need. Is there any simple way to force the app to show views and behave like iOS 8 and

XCode 7: Launch screens may not set custom classnames

只谈情不闲聊 提交于 2019-11-29 11:12:24
问题 I created a simple application using Xcode 7 Beta 2. The application simply contains class MyAppDelegate , MyViewController , MyMain.storyBoard and MyLaunchScreen.storyboard . After recompiling the application with Xcode 7 Beta 4 the error "Launch screens may not set custom classnames" appears. Any suggestions? 回答1: Note that the launch screen is not a fully customizable view controller. You cannot specify a custom class name in the storyboard and expect the system to give you the option to

Swift 2 Error using mutating function in Protocol extension "Cannot use mutating member on immutable value: 'self' is immutable

老子叫甜甜 提交于 2019-11-29 10:34:40
问题 Not sure what's going on here, this seems like it should be pretty straight forward. I have a protocol that mutable var, an extension with a mutating function. Things are crapping out in the testClass.testFunc , when I try and use mtkAnimQueAppend declared in the extension, I get this error: "Cannot use mutating member on immutable value: 'self' is immutable. protocol MTKAnimateValueDelegate { var mtkAnimQue:[MTKAnimateValue]? {get set} } extension MTKAnimateValueDelegate { ///Adds element to