ios8

Swift Take a variable in second File ButtonViewController.swift

不羁岁月 提交于 2019-12-11 20:46:05
问题 In My project i have two file ViewController.swift and ButtonViewController.swift . In ViewController i have this code var nomeLabel:String! func goToView(sender: UIButton!) { // self.performSegueWithIdentifier("goToView", sender: self) // I used This for Go to Second View in Another moment var label: UILabel = UILabel() label.frame = CGRectMake(self.view.frame.size.width/2, 10, 150, 21); label.backgroundColor = UIColor.blackColor() label.textColor = UIColor.whiteColor() label.textAlignment =

Achieving this layout for a viewcontroller using autolayout

血红的双手。 提交于 2019-12-11 20:06:38
问题 I am working on a viewcontroller and I would like to try to achieve something like the picture below. I'd like to do this so it looks great on any device with regards to aspect ratio. The top is a container, the middle is a collectionview, and the bottom is a uitableview. What i'm trying to preserve is the aspect ratios. My thought to do this was the following: For the first box, set the leading, trailing, and top margins to be to the container (guideline). Set the bottom one to be the box

iOS 8: UITableViewCell.contentView doesn't resize subviews in it

孤者浪人 提交于 2019-12-11 20:06:35
问题 I put an CustomView in UITableViewCell.contentView , setting the autoresize mask of the custom view as W+H . But when running, the CustomView gets a larger height than the ContentView , the ContentView is 60pt in height(which is the same as setting in UITableViewDelegate ), but the CustomView inside contentView is 76pt in height. By Xcode6's view debugging , I see some strange constraints on my custom view, they are: self.height = superview.height + 16 self.midY = superview.midY + 8 Where are

Audio not playing in Cordova iOS 8

非 Y 不嫁゛ 提交于 2019-12-11 19:58:15
问题 I am unable to play audio in iOS 8 Cordova app. the same code works on iOS 7. The message I get is, Unknown resource 'documents://audioFilePath' My Cordova version is 3.5.1 and Media plugin version is 0.2.15 Any help is appreciated. Thanks. 回答1: Solved This. I was Creating the media object as, new Media("documents://../appName.app/www/" + src...) I Found that the resource pointer in iOS is always at www folder. So i just had to create the object as, new Media("" + src...) 来源: https:/

How to share a String with sharing apps like Facebook, Twitter, etc.?

淺唱寂寞╮ 提交于 2019-12-11 19:56:20
问题 I'm developing an App and I want to have a Share button that allows users to pick an app from a list that they can share from, which then opens up that app or some sort of dialog that lets them tweet, post, text message, etc. I've achieved this on my Android app because it is extremely simple there to create an ACTION_SEND intent, and filter based on certain mimetypes for what apps to share with. I want something similar with iOS8 and Swift but I can't find anywhere how to achieve this. I don

Unicode Scalars in iOS

﹥>﹥吖頭↗ 提交于 2019-12-11 19:53:07
问题 Is it possible to create a custom Unicode scalar value in iOS or to map an existing value to a bitmap glyph? I'm curious to see if one can create custom characters and strings like Apple's emoji. 回答1: According to the documentation, this is possible. let customChar = "\u{5436}" 来源: https://stackoverflow.com/questions/25578183/unicode-scalars-in-ios

Save image to a specific photo album with photo framework ios 8

怎甘沉沦 提交于 2019-12-11 19:38:53
问题 I have just created a new photo album with this code: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^ { //Checks for App Photo Album and creates it if it doesn't exist PHFetchOptions *fetchOptions = [PHFetchOptions new]; fetchOptions.predicate = [NSPredicate predicateWithFormat:@"title == %@", @"ChameleonSensors"]; PHFetchResult *fetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:fetchOptions];

PKPaymentAuthorizationViewController is crashing unexpectedly on iOS 8.4

╄→гoц情女王★ 提交于 2019-12-11 19:36:45
问题 Background: I used same code for iOS 8.2,8.3 it was working fine. PKPaymentAuthorizationViewController *paymentPane = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request]; paymentPane.delegate = self; [self presentViewController:paymentPane animated:TRUE completion:nil]; PaymentRequest Code: PKPaymentRequest *request = [[PKPaymentRequest alloc] init]; NSString *chargeApplePay=[NSString stringWithFormat:@"%.02f",pay]; PKPaymentSummaryItem *total = [PKPaymentSummaryItem

ios 8 editing tableviewcell deleting a row removes the delete button

自闭症网瘾萝莉.ら 提交于 2019-12-11 18:49:50
问题 While editing my tableview, If I delete a row, the button for delete option disappears. This was working perfectly in iOS7, but now in iOS8, I find this bug. Is this some Apple bug, or Am I doing something wrong? Here is an image while editing: and this is an image after I delete a row. The - button is nowhere to be seen. Also, It does not remove the edit mode, only the button disappears 来源: https://stackoverflow.com/questions/24806850/ios-8-editing-tableviewcell-deleting-a-row-removes-the

Container View Receives Touches Instead of Subview on iPad

China☆狼群 提交于 2019-12-11 18:39:24
问题 I have a problem concerning getting a UITableViewController inside of a UIView to get touches in iOS8 (it worked fine in iOS7). Here's the setup code: UITableViewController *tvc = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped]; tvc.tableView.userInteractionEnabled = YES; tvc.tableView.frame = CGRectMake(0, 0, self.incentivesContainerView.frame.size.width, self.incentivesContainerView.frame.size.height); [self addChildViewController:tvc]; self.incentivesContainerView