ios9

setStatusBarHidden(_:withAnimation:) deprecated in iOS 9

只谈情不闲聊 提交于 2019-11-28 16:59:19
I see that in iOS 9 setStatusBarHidden(_:withAnimation:) is now deprecated and the documentation says to use [UIViewController prefersStatusBarHidden] instead but what is the alternative in iOS 9 if I still want to hide the status bar with a slide animation? Refer to preferredStatusBarUpdateAnimation , Gif Code class ViewController: UIViewController { var isHidden:Bool = false{ didSet{ UIView.animate(withDuration: 0.5) { () -> Void in self.setNeedsStatusBarAppearanceUpdate() } } } @IBAction func clicked(sender: AnyObject) { isHidden = !isHidden } override var preferredStatusBarUpdateAnimation:

iOS8统一的系统提示控件——UIAlertController

筅森魡賤 提交于 2019-11-28 16:56:12
iOS8统一的系统提示控件——UIAlertController 一、引言 相信在iOS开发中,大家对UIAlertView和UIActionSheet一定不陌生,这两个控件在UI设计中发挥了很大的作用。然而如果你用过,你会发现这两个控件的设计思路有些繁琐,通过创建设置代理来进行界面的交互,将代码逻辑分割了,并且很容易形成冗余代码。在iOS8之后,系统吸引了UIAlertController这个类,整理了UIAlertView和UIActionSheet这两个控件,在iOS中,如果你扔使用UIAlertView和UIActionSheet,系统只是会提示你使用新的方法,iOS9中,这两个类被完全弃用,但这并不说明旧的代码将不能使用,旧的代码依然可以工作很好,但是会存在隐患,UIAlertController,不仅系统推荐,使用更加方便,结构也更加合理,作为开发者,使用新的警示控件,我们何乐而不为呢。这里有旧的代码的使用方法: UIAlertView使用: http://my.oschina.net/u/2340880/blog/408873 。 UIActionSheet使用: http://my.oschina.net/u/2340880/blog/409907 。 二、UIAlertController的使用 从这个类的名字我们就可以看出,对于警示控件

UIStackView “Unable to simultaneously satisfy constraints” on “squished” hidden views

China☆狼群 提交于 2019-11-28 16:27:17
When my UIStackView "rows" are squished, they throw AutoLayout warnings. However, they display fine and nothing else is wrong besides these sorts of loggings: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property

iOS 9 safari iframe src with custom url scheme not working

冷暖自知 提交于 2019-11-28 16:13:22
I use this solution https://gist.github.com/davidwkeith/2662899 to redirect into my app from web if app installed. But it was broken in ios 9. It still work in google chrome, but iframe with custom url scheme not launching app in safari. If i replace document.getElementById('loader').src = 'custom-protocol://my-app' (where loader is iframe) with window.location = 'custom-protocol://my-app' it will be work. os: iOS 9 beta4 and beta5 Anybody know this problem? Is it ios 9 beta bug? Or it will not be fixed? The previous answer is a partial implementation of Universal Links that is missing

Xcode 7 iOS 9 UITableViewCell Separator Inset issue

别来无恙 提交于 2019-11-28 15:51:58
This is not a question, rather a solution to the problem I faced. In Xcode 7, when the application is run on iOS 9 on iPad devices, the UITableView cells leave some margin onto the left side of the tableview. And rotating the device to landscape would increase the margins. The solution I found is: Setting "cellLayoutMarginsFollowReadableWidth" to NO. self.tbl_Name.cellLayoutMarginsFollowReadableWidth = NO; Since, this property is only available in iOS 9. So, you will have to put a condition to check the iOS version, else it will crash. if(NSFoundationVersionNumber > NSFoundationVersionNumber

UI Testing Failure - Neither element nor any descendant has keyboard focus on secureTextField

无人久伴 提交于 2019-11-28 15:26:54
This is my case: let passwordSecureTextField = app.secureTextFields["password"] passwordSecureTextField.tap() passwordSecureTextField.typeText("wrong_password") //here is an error UI Testing Failure - Neither element nor any descendant has keyboard focus. Element: What is wrong? This is working nice for normal textFields , but problem arise only with secureTextFields . Any workarounds? This issue caused me a world of pain, but I've managed to figure out a proper solution. In the Simulator, make sure 'Hardware -> Keyboard -> Connect hardware keyboard' is off. AlexDenisov Recently we found a

Is the newly added 'My Card' that automatically shows up in IOS9 a reliable way to get a users phone number?

老子叫甜甜 提交于 2019-11-28 14:21:09
Am I correct that with a address book permission we should be able to pretty reliably get a users phone number if they have given address book permissions via the new "My Card" contact that seems to be automatically added to your addressbook when you download IOS9? I always wanted to do a find friends but i did not want to force users to type/verify their number....this seems to be a solid work around for ios9 users. I am currently dealing with the same issue but unfortunately it seems that this is not possible according to Apple. "Presuming that you’re working on iOS, there’s no programmatic

Submitting App from building in Xcode 6.4

霸气de小男生 提交于 2019-11-28 13:49:14
问题 I previously built my app in an Xcode 7 beta as my testing device is an iOS 9.0 device. I recently deleted Xcode 7 and began working on my app in Xcode 6.4 (not a beta). 6.4 does not support iOS 9 but my iPhone on an iOS 9 Beta is not uneligible (as it should because 6.4 doesn't support 9.0). Are there some files I can remove so that my device is ineligible? I believe once I fix this problem, I can finally submit a new build for review to iTunes Connect because I shouldn't get this error

Require ForceTouch iOS App

时光总嘲笑我的痴心妄想 提交于 2019-11-28 13:31:42
Is there a way to write an app's "Required device capabilities" such that the app runs only iPhone 6s and above (due to a requirement of force touch)? You normally use the UIRequiredDeviceCapabilities key, which can require certain features to be present. However at this time it doesn't seem like 3D Touch has been added. A large warning will have to suffice for now, while waiting for apple to add 3D touch as a thing you can require. Otherwise there might be some features only the new iPhones models have, such as the arm chip, you could require. I haven't looked into this though. On apples page

UIApplication.sharedApplication() is unavailable

谁说我不能喝 提交于 2019-11-28 13:20:50
I just upgraded from XCode 6.4 to Xcode 7 GM and get started to change the code to be compliant with Swift 2. I could not come over the following errors. The project is a keyboard extension and the snippet is from the containing app. let s = "https://itunes.apple.com/" UIApplication.sharedApplication().openURL(NSURL(string : s)!) Error 1: 'sharedApplication()' is unavailable: Use view controller based solutions where appropriate instead. Error 2: 'openURL' is unavailable. This might be something to do with Xcode and AppDelegate, I might have screwed up my project. You can't access every API