ios8

How to use requestAccessToEntityType method in Swift iOS 8

落花浮王杯 提交于 2020-01-02 05:23:46
问题 I'm trying to get a list of events by using EKEventStore using Swift in iOS8, and the documentation is not updated yet as far as I can tell. This is what I'm trying to do: let eventStore = EKEventStore() eventStore.requestAccessToEntityType(EKEntityType(), EKEventStoreRequestAccessCompletionHandler(Bool(), NSError(){})) This is the error I get: 'EKEventStoreRequestAccessCompletionHandler' is not constructible with '(Bool, NSError) Do you know how can I use the method or the handler correctly

How to use requestAccessToEntityType method in Swift iOS 8

三世轮回 提交于 2020-01-02 05:23:37
问题 I'm trying to get a list of events by using EKEventStore using Swift in iOS8, and the documentation is not updated yet as far as I can tell. This is what I'm trying to do: let eventStore = EKEventStore() eventStore.requestAccessToEntityType(EKEntityType(), EKEventStoreRequestAccessCompletionHandler(Bool(), NSError(){})) This is the error I get: 'EKEventStoreRequestAccessCompletionHandler' is not constructible with '(Bool, NSError) Do you know how can I use the method or the handler correctly

iOS 8 number conversion/formatting error? (cannot reproduce)

余生长醉 提交于 2020-01-02 05:02:07
问题 The following method takes input from a UITextField and formats it for display. This code has worked flawlessly for years, but a problem was just reported on the iPhone 6 Plus using iOS 8.1. It happens every time for the user but I have not been able to reproduce it. I believe it has to do with NSNumber/NSDecimalNumber conversions and formatting on iOS 8, perhaps for a 64-bit app/device. The keyboard used for input is a number pad, so the only text that can be entered into the textfield are

Putting an H.264 I frame to AVSampleBufferDisplayLayer but no video image is displayed

元气小坏坏 提交于 2020-01-02 04:49:06
问题 After having a detail review of WWDC2014,Session513, I try to write my app on IOS8.0 to decode and display one live H.264 stream. First of all, I construct a H264 parameter set successfully. When I get one I frame with a 4 bit start code,just like"0x00 0x00 0x00 0x01 0x65 ...", I put it into a CMblockBuffer. Then I construct a CMSampleBuffer using previews CMBlockBuffer. After that,I put the CMSampleBuffer into a AVSampleBufferDisplayLayer. Everything is OK(I checked the value returned )

'NSInvocationOperation' is unavailable in Xcode 6.1

隐身守侯 提交于 2020-01-02 04:30:11
问题 My code suddenly can't be compiled in Xcode 6.1 (I'm sure it's working in Xcode 6 GM and beta version). It shows the error message: 'NSInvocationOperation' is unavailable My code is: let operation = NSInvocationOperation(target:self, selector:"backgroundRun:", object:self) Can anybody help? Thanks. 回答1: As of Xcode 6.1, NSInvocation is disabled in Swift, therefore, NSInvocationOperation is disabled too. See this thread in Developer Forum Because it's not type-safe or ARC-safe. Even in

How to enumerate all photos on iOS 8 using ALAssetsLibrary

廉价感情. 提交于 2020-01-02 03:13:10
问题 iOS 8 broke lots of apps by removing "Camera Roll" from the ALAssetsLibrary enumerating API. I know I can get all photos using the new Photos framework. But my app has a lot of code depending on ALAsset related classes and I need to keep iOS 7 support. Is there a way to enumerate all photos using ALAssetsLibary on iOS 8, without enumerating asset group first? 回答1: Apple just released 8.0.1 and listed this as a included fix. Might just be best to wait for that. From the 8.0.1 release notes:

UIWindow frame in ios 8 different from ios 7 in Landscape

此生再无相见时 提交于 2020-01-02 02:18:28
问题 I've create simple module where I add subview to UIWindow. In simulator ios 7(Xcode 5.1.1) I have printed self.windows and I get: <UIWindow: 0x8db1670; frame = (0 0; 768 1024); autoresize = W+H; gestureRecognizers = <NSArray: 0x8db1a70>; layer = <UIWindowLayer: 0x8db17d0>> but on ios8 (Xcode 6 beta 6) I get: <UIWindow: 0x794320d0; frame = (0 0; 1024 768); gestureRecognizers = <NSArray: 0x79437a80>; layer = <UIWindowLayer: 0x7943c400>> The question is: why there is a difference in frame

Social Framework iOS 8 swift

。_饼干妹妹 提交于 2020-01-02 02:18:12
问题 So I've been writing an app that needs to use Social framework to share text via twitter and facebook. I got it to work but it did not dismiss (?), then I remembered the completion handler, but whatever I do this handler keeps on giving me errors. var okFacebook :Bool = SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook) var okTwitter :Bool = SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter) var okLinkedIn : Bool = SLComposeViewController

Creating an EKCalendar in EKEventStore - Swift

雨燕双飞 提交于 2020-01-01 19:27:10
问题 I'm trying to create a single calendar into EKEventStore when the my app first runs. I found this tutorial but I don't really know enough about Objective-C to translate it to Swift, and also from the research that I've done I'm wondering if this method is still possible in ios8. 回答1: Try (note this is for a reminder type, but you can just change the type if you need to): let eventStore = EKEventStore() var yourReminderCalendar: EKCalendar? func retrieveYourCalendar() { let calendars =

How to disable Copy & Define UIMenuItems of UIMenuController in UITextfield

痞子三分冷 提交于 2020-01-01 19:14:23
问题 I am implementing custom UIMenuController and trying to figure out. How can I legally disable "Copy" and "Define" UIMenuItems of UIMenuController in UITextfield ? Textfield is not editable. I tried to disable "Copy" using: -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(copy:)) { return NO; } return [super canPerformAction:action withSender:sender]; } - (IBAction)tapTextViewGesture:(id)sender { UIMenuItem *myItem1 = [[UIMenuItem alloc] initWithTitle:@