ios8

UIView background color in Swift

℡╲_俬逩灬. 提交于 2019-12-29 19:05:19
问题 Is there a way to set the UIView background color with Swift? I know that in Objective-C, you would use self.view.backgroundColor = [UIColor redColor]; , but that does not work the same way in Swift. I have looked around and because Swift is only about a week old, I cannot find an answer. Does anyone have any suggestions? 回答1: self.view.backgroundColor = UIColor.redColor() In Swift 3: self.view.backgroundColor = UIColor.red 回答2: Try This, It worked like a charm! for me, The simplest way to

UIView background color in Swift

时光怂恿深爱的人放手 提交于 2019-12-29 19:05:13
问题 Is there a way to set the UIView background color with Swift? I know that in Objective-C, you would use self.view.backgroundColor = [UIColor redColor]; , but that does not work the same way in Swift. I have looked around and because Swift is only about a week old, I cannot find an answer. Does anyone have any suggestions? 回答1: self.view.backgroundColor = UIColor.redColor() In Swift 3: self.view.backgroundColor = UIColor.red 回答2: Try This, It worked like a charm! for me, The simplest way to

How to compare the types of gestures on iOS?

▼魔方 西西 提交于 2019-12-29 08:16:49
问题 I have three different gestures with two different types on one view. First is a UITapGestureRecognizer and the two others are UILongPressGestureRecognizer . The long press gesture recognizer have different minimumPressDuration , one is 0.15 and the other is 0.50 , so to I implemented he following function so that all the gestures are recognized: -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer *)

what would be a proper storyboard example of combining nav bars and tab bars in one app?

六月ゝ 毕业季﹏ 提交于 2019-12-29 07:49:08
问题 Hi I'm new to ios app dev. I've only done tutorials so far that have covered apps with either nav bars or tab bars. Now I want to make an app combining both. So, say I have an app with a tab bar at the bottom with two tabs: friends and enemies. In each tab i plan to have a running list of who my friends and enemies are, so it will need an addPerson button on the nav bar of each tab. given that scenario, what would be the proper way to organize my controllers and views and stuff? would both my

How can i customize UIAlertAction in UIAlertController for iOS8?

房东的猫 提交于 2019-12-29 06:54:11
问题 I need to add image in Action sheet item using UIAlertController . I add using: UIImage *image = [UIImage imageNamed:@"icon.png"]; [alertAction setValue:image forKey:@"image"]; And results as: The problem is that: I need the image & text to be centrally aligned and resize the height of Cancel button How can i do that, please share some code. Thanks! 回答1: Well, here is the Runtime Header file for UIAlertAction . You can neither change the frame of image nor you can change the height of Cancel

iOS 8 Safari - Can't scroll element's content when page is zoomed

对着背影说爱祢 提交于 2019-12-29 06:25:30
问题 This issue happens only in iOS 8 (8.1 to be exact). It does not reproduce in iOS 7. The use-case: Scrolling inside an element with scrollable (long) content. If the page is not zoomed-in - it works as expected. When you zoom-in the page - it stops working, the page is scrolled instead (as if you reached the end of the scrollable content). The effect is continuous: the higher the zoom - it's less possible to scroll the content. Test page: here Open the link in your iOS 8 Safari - see that the

iOS 8 presentationController determine if really is popover

梦想与她 提交于 2019-12-29 05:13:11
问题 I'm using the new adaptive "Present As Popover" capability of iOS 8. I wired up a simple segue in the StoryBoard to do the presentation. It works great on an iPhone 6 Plus as it presents the view as a popover and on an iPhone 4s it shows as a full screen view (sheet style). The problem is when shown as a full screen view, I need to add a "Done" button to the view so dismissViewControllerAnimated can be called. And I don't want to show the "done" button when it's shown as a popover. I tried

How do i add this sharing button? IOS8 with swift

旧巷老猫 提交于 2019-12-29 04:56:28
问题 I want there to be a button in my app, that when it is pressed, this(See image below) Pops up. How do i do that? I don't want to create a custom sharing extion, i just want the default one? What code do i use? All the tutorials online are in objective-c. Please give an answer in swift. Image: http://9to5mac.com/2014/06/30/hands-on-1password-beta-shows-off-ios-8s-touch-id-extensions-apis-video/#jp-carousel-330420 Here is my code so far, but i get an error that UIBarButtonItem Is not convetable

Facebook is not shown in UIActivityViewController but twitter does

烂漫一生 提交于 2019-12-29 04:37:06
问题 My iOS is 8.1.2 and I am using the UIActivityViewController for social sharing. I click on a button and allow the UIActivityViewController to present - (IBAction)UIActivityTypeButtonClick:(id)sender { NSString* text=@"I am sharing this text"; NSArray* sharedArray=@[text]; UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil]; activityVC.excludedActivityTypes=@[]; [self presentViewController:activityVC animated:YES

how to change the height of a single cell when clicked?

孤街浪徒 提交于 2019-12-29 03:33:09
问题 I have to resize a single row of my tableView when clicked. How I can do this? Anybody could help me? My view controller class: class DayViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet var daysWorkPointTable: UITableView override func viewDidLoad() { super.viewDidLoad() var nipName = UINib(nibName: "daysWorkPointsCell", bundle: nil) self.daysWorkPointTable.registerNib(nipName, forCellReuseIdentifier: "daysWorkCell") } func tableView(tableView: