ios8

How do I use iOS auto resizing cells without specifying estimated row height?

烂漫一生 提交于 2019-12-10 10:05:28
问题 I want to leverage Auto Layout taking care of my cell heights automatically in iOS 8, but I hate how finicky estimated row heights make scrolling (jumpy, scroll position unpredictable, etc.). Is there a way to not use estimation so that the table view precalculates all row heights like it did pre iOS 7 (not too many cells so not a performance issue) but uses iOS 8's auto calculating for heights? 回答1: Edit: There is no way to use dynamic sizing without using this property. estimatedRowHeight

Cannot subscript a value of type [CLPlacemark] with an index type int

狂风中的少年 提交于 2019-12-10 09:58:43
问题 I would like to retrieve the current location. I work with on swift Xcode 7. I looked PLUSIEUR tutorials, but every time they use the same method. Here is my code and my error: ! Error : Cannot subscript a value of type [CLPlacemark] with an index type int import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate { let LocationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the

Implement heightForRowIndexPath: in iOS 7, but remove it in iOS 8 using compile-time macro

核能气质少年 提交于 2019-12-10 09:42:19
问题 I'd like to implement the new auto-resizing table view cells in iOS 8, while maintaining support for heightForRowAtIndexPath: in iOS 7. The problem is I have to remove the method override heightForRowAtIndexPath: for iOS 8, but keep in it for iOS 7. Is there some compile-time macro to use that will accomplish this? 回答1: You can not use a compile time macro because this is a run time decision. Instead, you can just return UITableViewAutomaticDimension for iOS 8 and if not, return your

Swift: Keyboard Observer via NSNotificationCenter doesn't work

大城市里の小女人 提交于 2019-12-10 09:37:25
问题 I'm trying to implement a simple keyboard observer in my iOS 8 Swift app but it really doesn't work. This is the code im currently using: override func viewDidAppear(animated: Bool) { NSNotificationCenter().addObserver(self, selector: Selector(keyboardWillAppear()), name: UIKeyboardWillShowNotification, object: nil) NSNotificationCenter().addObserver(self, selector: Selector(keyboardWillHide()), name: UIKeyboardWillHideNotification, object: nil) } override func viewDidDisappear(animated: Bool

Today View Extension (Widget) not working

末鹿安然 提交于 2019-12-10 09:32:47
问题 I found several other threads with similar problems, but no one has exactly the same problems. Besides it DID work some time! the errors now keep occurring while it was working some time before.. When Running my app, that has a build Target "Today View Extension", I get no actual result. The Extension is shown in Notification Center, but has no body (Simulator AND device). Also when I try to run the App (not the target extension) and attach the process manually by PID I get this error: I also

UIActivityViewController exclude all UIActivityCategoryAction

非 Y 不嫁゛ 提交于 2019-12-10 09:32:09
问题 I have instantiated a UIActivityViewController. Conveniently, I can exclude individual activity types using the property excludedActivityTypes . I now want to exclude the activity category UIActivityCategoryAction . How can I exclude an activity category, as opposed to an individual activity type? 回答1: As per current documentation, you can't but you could build an array holding all the individual types of an UIActivityCategory and pass it to the excludedActivityTypes property. If you fear

UIScrollView scrolls on all the simulators but not on my iPhone

流过昼夜 提交于 2019-12-10 09:16:01
问题 So after figuring out how scrollView works, I've implemented it with the following code: self.scrollView.delegate = self; self.scrollView.userInteractionEnabled = YES; CGRect view = CGRectMake(0, 0, 320, 750); self.scrollView.contentSize = view.size; The above code works as intended on ALL simulators in Xcode 6. However, when I run it my phone (iphone4s on ios7), the scroll does not function at all. Are people experiencing the same problems since the new release? Or am I missing something I

Objective C- iCal not creating custom calendar and new event to it in iOS 9

╄→гoц情女王★ 提交于 2019-12-10 08:53:43
问题 This working perfectly in iOS 8. But creating issue in iOS 9.Here is code : self.eventManager.eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { if (granted) { // Create a new calendar. EKCalendar *calendar = [EKCalendar calendarForEntityType:EKEntityTypeEvent eventStore:self.eventManager.eventStore]; // Set the calendar title. calendar.title = @"<APP name>"; calendar.CGColor=APP_Blue_COLOR.CGColor; // Find the proper source type value. for

UIAutomation test invocation from the command line with Xcode 6

泪湿孤枕 提交于 2019-12-10 07:16:54
问题 Running UIAutomation tests from the command line seems to break often with new Xcode releases (judging by past posts). Having never used the command line scripting for this, I found this post from 2012: Automation Instrument from the Command Line. The Problem: My command returns without error, without output results and without anything logged to the system console. The simulator does not even launch! Checking some of the paths for updates (notably, the Automation trace instrument path), I

iOS8 Rotation issue with UITabBarController and UINavigation Controller

这一生的挚爱 提交于 2019-12-10 04:34:09
问题 I have one issue with iOS8. Here I have structure of my view hierarchy. Window ==> UITabBarController ==> 2 Tab Tab 1 ==> UINavigationController1 ==> UIViewController1 as root view controller Tab 2 ==> UINavigationController2 ==> UIViewController2 as root view controller Now everything works perfect with one orientation. But problem is with this testing steps: Put log in both ViewController's viewDidLoad method for tracking event Start app FirstViewController's viewDidLoad will call. Now stay