ios8

How to build iOS framework with XCode 6

僤鯓⒐⒋嵵緔 提交于 2019-12-05 21:43:25
I know of familiar tutorials on this, but introduction of framework XCode 6 template has changed the game. I already watched WWDC 2014 video about building modern frameworks but it talks more about building extensions, framework & app all inside single project. It does not specify if the framework I make with it is truly reusable across any project. I am building framework the XCode 6 way (File->New Project->Framework and Library->Cocoa Touch Framework), but when I import it inside my test app project (separate from framework project) - I keep getting various errors. Example: Include of non

iOS 8 cell resizing

天大地大妈咪最大 提交于 2019-12-05 21:04:38
I have a subclass of a UITableViewCell and I override setFrame: to add insets to cell. In iOS 7 everything seems to work fine, on iOS 8 on the other hand, the table view loads the cells correctly but when I refresh the tableview the cells are resized. By commenting the code in the setFrame the tableview behaves correctly, but I also loose the insets. Has anyone experienced this? UPDATE: AFAIK, in iOS 8 the cell frame height matches the row height. i got similar problerm. solve it by: - (void)setFrame:(CGRect)frame { NSInteger inset = kDefaultViewPadding; frame.origin.x += inset; frame.size

Why is app not getting registered for push notifications in iOS 8?

只愿长相守 提交于 2019-12-05 20:59:31
问题 I upgarded my Xcode to Xcode 6.0.1, now remote notification registration is not happening for iOS 8 device. It is working fine for iOS 7 device. I have added the code in app delegate as mentioned below: //-- Set Notification if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil]; [

iOS: Using HanekeSwift with SwiftyJSON

醉酒当歌 提交于 2019-12-05 20:16:19
I use Alamofire with SwiftyJSON in my current swift project. I would like to add HanekeSwift for caching. Adding HanekeSwift to the project make it "collide" with SwiftyJSON struct JSON. Is there any easy way to use both of these frameworks? I know there is a option to rename one of the JSON structs but seems like a stupid workaround. Or do some namespace thing. Error message: 'JSON' is ambiguous for type lookup in this context Any solutions to this? So, the solution that I've found works for me is just to declare the full type of JSON object you are trying to use. E.g. - declare SwiftyJSON

UIDocumentInteractionController broken in iOS 8

主宰稳场 提交于 2019-12-05 20:14:53
The related code below worked perfect when i was building for iOS 7, but it seems now in iOS 8, it's not working properly. By properly, I mean in the sense where it's not actually sending the file or whatever to the chosen app. Example: If I selected Mail, it would open the mail app with the image or zip I chose in the text field. Now it won't send and it takes forever to call/dismiss the UIDocumentInteractionController. What am I doing wrong? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.tableView deselectRowAtIndexPath:indexPath animated

Swift generic type conforming to two protocols

混江龙づ霸主 提交于 2019-12-05 20:07:05
问题 I have a generic method in one of my classes where I want to have a generic type conforming to UIViewController and UIPickerViewDelegate . How can I do that? I thought of doing this: func foo<T: UIViewController, UIPickerViewDelegate> (#viewController: T) {} But this code doesn't "recognize" the UIPickerViewDelegate . I also thought of using the pipe | instead of the comma but this is even worse, the compiler doesn't accept that. Is it possible to do this or do I have to do 2 parameters for

Why does [NSSet containsObject] fail for SKNode members in iOS8?

老子叫甜甜 提交于 2019-12-05 19:52:23
Two objects are added to an NSSet , but when I check membership, I can't find one of them. The test code below worked fine in iOS7 but fails in iOS8. SKNode *changingNode = [SKNode node]; SKNode *unchangingNode = [SKNode node]; NSSet *nodes = [NSSet setWithObjects:unchangingNode, changingNode, nil]; changingNode.position = CGPointMake(1.0f, 1.0f); if ([nodes containsObject:changingNode]) { printf("found node\n"); } else { printf("could not find node\n"); } Output: could not find node What happened between iOS7 and iOS8, and how can I fix it? Karl Voskuil SKNode 's implementations of isEqual

ios8 autolayout: BOTH multi-line(maybe 0 line) label

女生的网名这么多〃 提交于 2019-12-05 19:26:49
I wanna display two UILabels(Title, Subtitle) in a cell. for Title : multiple line > 0 for Subtitle : 0 ≤ multiple line ≤ 2 A bug here (say, title&subtitle are both 2 lines, cell's indexPath.row = 1): The first time I run the simulator, title only shows 1 line and subtitle shows 2 lines. After I scrolled the tableView and back to the first indexPath.row, it display correctly! It seems like this: First time: ————————————————— This is the tile, and it should display... This is the subtitle, and it should show 2 rows. ————————————————— After scroll and back to this cell: ————————————————— This is

Enabling In-App purchase for custom keyboard iOS8

江枫思渺然 提交于 2019-12-05 18:57:12
I am building a custom keyboard for iOS and I want to know how can I enable in-app purchases for that? The documentation states that I can enable in-app purchases through the containing app, but I am not sure what that means (technically)? Has anyone built iPhone extensions with in-app purchasing that could give me some guidance? An extension is bundled with an app. When the user downloads the containing app, the extensions are available for the user to add to their keyboard list, today view, etc. If you want to charge for a keyboard, currently the only way you can do that is by charging for

iOS8: UIDocumentPickerViewController get NSData

拜拜、爱过 提交于 2019-12-05 18:50:02
I have implement UIDocumentPickerViewController according docs and now trying to get NSData from picked file in delegate method, but [[NSData alloc] initWithContentsOfURL:] returns nil: - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url{ NSData* documentData = [[NSData alloc] initWithContentsOfURL:url]; //documentData is nil documentData = [[NSData alloc] initWithContentsOfFile:[url path]]; //documentData is still nil :( } I'm using Xcode6 beta6, iPhone simulator, document picker mode is UIDocumentPickerModeImport . Trying to retrieve