Menu
  • HOME
  • TAGS

When creating new tableView entry the constraints don't work

uitableview,ios8,nslayoutconstraint

It looks like you're trying to add constraints to labels for a built-in cell style. The reason why this doesn't won't work is because they're (public yet) internal labels, and Apple's code is optimized to remove its labels from their contentView when Apple believes the labels won't be needed. When...

Add view to a cell in a Table View Programatically

ios,swift,uitableview

You can create the view as you want and add it as subview of your cell's contentView: var newView = UIView(frame: CGRectMake(200, 10, 100, 50)) cell.contentView.addSubview(newView) ...

Using UIPicker to create desired number of rows in UITableViewController

ios,iphone,uitableview,uipickerview

As Nitin Gohel said: In your TableView.h @interface TableViewController : UITableViewController @property (nonatomic) NSInteger numberOfRows; @end And in your TableView.m - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.numberOfRows; } Don't forget to assign the value of number of rows when your start button is tapped....

Can I use both UITableViewCellEditingStyleInsert and UITableViewCellEditingStyleDelete two button together?

ios,uitableview

At least as of iOS 8 this can't be done (I don't know if this changed in iOS 9). A cell can only have one of the 3 possible editing styles - None, Insert, or Delete. UITableViewCell does not support both Insert and Delete at the same time. When the...

How to create UITableViewCells with complex content in order to keep scrolling fluent

ios,swift,uitableview,cocoa-touch,ios-charts

What you're trying to do is going to inevitably bump into some serious performance issues in one case or another. Storing all cells (and their data into memory) will quickly use up your application's available memory. On the other hand dequeueing and reloading will produce lags on some devices as...

Table cell borders get visible when selecting a cell in UITableView in IOS

ios,objective-c,uitableview

You just need to set the "selection" property of UITableViewCell to "none" and add the following code to your controller. see screenshot its working. Code: - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath]; [self setCellColor:[UIColor colorWithRed:0.239 green:0.239 blue:0.239 alpha:1] ForCell:cell]; //normal color } ...

Save UITableViewCell Checkmark Selection in Swift

swift,uitableview

Yep, you answered your own question here. You need to store lastSelectedIndexPath some how (ie to whatever you're using for persistence). A simple way (read: not the best way) to do this if you don't have any sort of database set up already is to store it using NSUserDefaults.

hide uitableview with swipe or gesture

ios,swift,uitableview,uigesturerecognizer

You will need to create a UISwipeGestureRecognizer and have to add it to the UITableView. Try the following: let swipeGesture = UISwipeGestureRecognizer(target: self, action: "hideTableView:") //do that animation to hide the UITableView swipeGesture.direction = .Down //Swiping down may come into conflict w/ the UITableView itself if it is scrollable, check...

What happens when you call UItableview's reload twice

ios,objective-c,uitableview,tableview

Your question can't happen. All reloading is done on the main thread. The call to reloadData doesn't return until the reload is complete. So you can't call it a second time while the previous reload is still running. It's a non-issue. And your question also implies a misunderstanding of how...

Assigning value to Search Bar Delegate - Swift

ios,swift,uitableview,search

There is no problem with the use of tableView as both a local (to a function) and "global" variable name. If you have a local and a global variable with the same name, the code will access the local variable in preference to the global. If you want to access...

iOS Segue opening two view controllers (assuming two table cells clicked)

ios,uitableview,segue,viewcontroller

A segue will be performed automatically while a cell is tapped. Try the following code: // - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath // { // self.selectedIngredient = self.selectedProduct.ingredientsArray[indexPath.row - 3]; // [self performSegueWithIdentifier:@"ingViewSegue" sender:self]; // NSLog(@"selected ingredient %@", self.selectedIngredient); // } #pragma mark segue - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSIndexPath *indexPath...

How to get tableview cell text label from 2nd viewcontroller to a label from 1st viewcontroller?

ios,uitableview,delegates,nsnotifications

1st In VC2, you must create delegate @protocol VC2Delegate; @interface VC2 : UIViewController @property (nonatomic, weak) id <VC2Delegate> delegate; @end @protocol VC2Delegate <NSObject> @required - (void)changeToText:(NSString *)text; @end @implementation VC2 // this is your "完了" action - (IBAction)doneAction:(id)sender { ... [self.delegate changeToText:@"what you want"]; } @end 2nd, add the delegate...

UITableView Using two arrays

ios,swift,uitableview

Try this func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cellID = "cell" let cell = tableView.dequeueReusableCellWithIdentifier(cellID, forIndexPath: indexPath) as! UITableViewCell cell.textLabel!.text = category.books[indexPath.row] cell.backgroundColor = colorArray[indexPath.row % 5] return cell } ...

How to increase the height of a section in a UItableview

ios,objective-c,uitableview

add this delegate method - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; in your case, return 18;...

How can I tell which custom UITableViewCell's UIButton has been tapped?

ios,objective-c,uitableview

Declare a protocol on the cell, which the tableview controller will conform to, then you can call a method on button click and can even send "self" as a parameter to get the actual cell.

TableViewCell overlaps text

ios,xcode,swift,uitableview,overlap

I can fix the problem. In the storyboard, the label have unchacked "Clears Graphics Context". I checked and for now it solved! Thanks for the help!

How to achieve scrolling animation in UITableViewCell?

ios,objective-c,uitableview,animation,uicollectionviewcell

Check out this source code, It is something that you are looking for, https://github.com/mrugrajsinh/AnimatedTableViewCellDemo ...

Swiftyjson bundled file

ios,json,swift,uitableview,swifty-json

Ok: Read out your file let path = NSBundle.mainBundle().pathForResource("filename", ofType: "json") let jsonData = NSData(contentsOfFile: path!, options: NSDataReadingOptions.DataReadingMappedIfSafe, error: nil) load data to SwiftyJSON let json = JSON(data: jsonData) Get the Object you want: let name = json["key1"]["key2"].stringValue // get any value Or cast as Array if let array =...

Change custom UITableViewCell

ios,objective-c,uitableview

You're using the same reuseIdentifier, use different ones. Another thing to check is that you've registered the custom cells with their respective identifiers with the table view. Also if you register the cell subclasses, you don't have to check for them being nil, you are guaranteed to get instances....

How to change element title inside UITableViewCell?

ios,objective-c,iphone,swift,uitableview

If your function is playPost(), you could change the value passed in (which is the sender of the function, by default) like this: func playPost(sender: UIButton) { sender.setTitle("New title", forState: UIControlState.Normal); } ...

Get TableViewController from TableViewCell

ios,swift,uitableview

To get a reference to the containing view controller, I add a weak property on the cell subclass. @property (nonatomic, weak) UITableViewController *viewController; You can assign this value in cellForRowAtIndexPath:...

Reusing a UITableViewCell's IBOutlets with two different UITableViewControllers

swift,uitableview,code-reuse,iboutlet,tableviewcell

This issue arises while registering the UITableViewCell class as tableView.registerClass(SwitchCell.self,forCellReuseIdentifier:"SwitchCell2") Remove that line tableView.registerClass(SwitchCell.self,forCellReuseIdentifier:"SwitchCell2") and set the cellIdentifier in storyboard..it works...

Adding Child View Controller view to dynamic UITableViewCell

ios,swift,uitableview,childviewcontroller

Don't misunderstand MVC. Not every view in the world needs to have its own personal view controller! A main view has a view controller, but a button in that main view does not have its own personal view controller; it simply talks to the main view's view controller. The same...

UITableView moveRowAtIndexPath displays duplicate cells

ios,uitableview

The cause of the problem was a bug in the re-ordering of my data provider. I moved a cell in the tableview but the data array did not reflect that change.

unrecognized selector sent to instance when using UITableViewCell

ios,objective-c,uitableview,unrecognized-selector

you are registering wrong class [self.PendingChal registerClass: [UITableViewCell class]forCellReuseIdentifier:@"GameTableCell"]; should changed like [self.PendingChal registerClass: [GameTableCell class]forCellReuseIdentifier:@"GameTableCell"]; And please following method in your GameTableCell.m file -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"GameTableCell" owner:self options:nil]; // Grab a pointer to the first object...

Customize a tableview

ios,objective-c,uitableview

Try this link .. Custom UITableViewCell Using Interface Builder good demo with project try this Customize Table View Cells for UITableView hope it helps....

UITableView with UITableViewCell containing UIImageView

ios,iphone,swift,uitableview,uiimageview

Panning and scrolling are the "same" gesture. The problem is that the imageView's pan gesture recognizer is recognizing the gesture, and handling it (instead of failing it or passing the touch through to cell/tableView). If you expect to be able to pan your image in any direction, what you can...

How to get the TableViewCell above (or below) a specific TableViewCell

ios,swift,uitableview

Get like this. func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { //Current cell... var currentCell = tableView.cellForRowAtIndexPath(indexPath) as UITableViewCell? //Next cell... let nextIndex = NSIndexPath(forRow: indexPath.row + 1, inSection: indexPath.section) var nextCell = tableView.cellForRowAtIndexPath(nextIndex) as UITableViewCell? //Previous cell... let prevIndex = NSIndexPath(forRow: indexPath.row - 1, inSection: indexPath.section) var prevCell = tableView.cellForRowAtIndexPath(prevIndex)...

How can I fix crash when tap to select row after scrolling the tableview?

ios,xcode,swift,uitableview,tableviewcell

Because you are using reusable cells when you try to select a cell that is not in the screen anymore the app will crash as the cell is no long exist in memory, try this: if let lastCell = self.diceFaceTable.cellForRowAtIndexPath(lastIndexPath) as! TableViewCell{ lastCell.checkImg.image = UIImage(named: "uncheck") } //update the data...

UITableView cell duplicates

ios,swift,uitableview

The root of the problem was in my sorting method.. simplified the code a lot, and sorted with sortDescriptors instead.

How can I centre both vertically and horizontally in a UILabel after resizing the text to fit width (1 line label)?

ios,objective-c,uitableview,uilabel

You are setting the label as a one-line label (by default) and setting its height at a fixed height, thus fixing its position: UILabel *numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 0, 60, 40)]; Thus, you are getting a constant baseline position for all your labels, regardless of the font size. So...

Values entered in custom UITableViewCell UITextField translated to other fields

ios,objective-c,uitableview,ipad

Normal allocation cell = [[JASMiscConfigurationTableViewCell alloc] init]; is different from allocating with -reuseIdentifier like.. cell = [[JASMiscConfigurationTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; it is possible that JASMiscConfigurationTableViewCell *cell = ((JASMiscConfigurationTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]); keeps on using the previous cell. try this: static NSString *cellIdentifier = @"miscCell";...

try to recover views from custom cell

ios,uitableview

viewWithTag: is a very fragile way to get a reference to views, and isn't recommended. But what I think is happening is that you need to call viewWithTag: on cell.contentView rather than the cell itself. I'd recommend creating proper IBOutlets to hold your imageview and label....

Extra table cells when UITableViewController is embedded into a Container in a UIViewController

ios,swift,uitableview,uiviewcontroller

You just need to add this to your code in viewDidLoad. self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero]; EDIT: sorry i was written in objective -c here is in swift. self.tableView.tableFooterView = UIView(frame:CGRectZero) The tableview will display what appear to be extra blank rows to fill out the bounds if there are not...

Table View ReloadData function not triggering cellForRowAtIndexPath Swift

ios,swift,uitableview,uisearchbar

You are redeclaring your var filtered just update the existing filtered used inside your cellForRowAtIndexPathindexPath

UITableView - controls / IBActions embedded in custom UITableViewCell class

ios,uitableview

First of all, I can control-drag from the button in a UITableViewCell xib to my header files to create IBAction. You just choose connection from Outlet to Action. On the other hand, you can specify your Button's action by code. If you button is a property, let's say it's self.tableCellButton,...

UITableCell not resizing properly

ios,swift,uitableview

Try to use layoutIfNeeded for update constraint immediately. For fix warning, you should set one of your vertical constraint priority to 999. All works properly if set Accessory view to None...

SDWebImage Library - placeholder from URL

ios,image,uitableview,asynchronous,sdwebimage

I ended up using two UIImageViews, one for each photo, overlapped. When the real (big) image is completely downloaded I smoothly fade the blurred one.

IOS - Adjust cell height based on content

ios,uitableview,autolayout

If use AutoLayout the use this code You try to set the UITableView properties estimatedHeight. -(void)viewWillAppear:(BOOL)animated{ _messageField.delegate = self; _tableView.estimatedRowHeight = 65.0; _tableView.rowHeight = UITableViewAutomaticDimension; } Other wise use this UITableView Delegate Method - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 300; // your dynamic height... } ...

selectionStyle not working with UITableViewCell

ios,swift,uitableview

change this line tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone to tableViewCell.selectionStyle = .None ...

How can I capture a table row press action in Swift WatchKit?

ios,swift,uitableview,watchkit,ibaction

You want to override the table:didSelectRowAtIndex function. It is a method on WKInterfaceController. override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) { //Handle row selection } ...

Array index out of range on refresh

ios,swift,uitableview,parse.com,pfquery

Try to: findItemData.findObjectsInBackgroundWithBlock{ (objects:[AnyObject]? , error:NSError?) -> Void in if error == nil { timelineData.removeAll(keepCapacity: false) self.timelineData = objects as! [PFObject] self.newsFeedTableView.reloadData() } } It could happen that you have inconsistent data before you actually populate your list. This way you will have your data if some kind of error...

iOS Swift Problems putting 2 or more UITableView in a UIScrollView with datasource and delegate

ios,swift,uitableview,uiscrollview

First of all, you should probably store a reference to the second tableView somewhere and not just put it into your scrollview. But this is not the reason for your crash. Secondly:, the reason for your crash. You don't store a reference to 'foo', which means it will be deallocated...

UITableView - Row - Multiple alignments

ios,swift,uitableview,alignment

Ok, small tutorial how to do it, please also look into my comments under your question according to programming best practices: First file, containing your ViewController: class MyTableViewController: UITableViewController { // here ofc you'll have your array/dictionary of input data let titles = ["iOS", "Android", "Windows Phone", "Firefox OS", "Blackberry...

Blur Effect on TableViewCell when scroll

ios,objective-c,uitableview,ios8,uiimageview

I figured it out. I used: // iOS8 Blur UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; self.visualEffectViewGlobal = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; self.visualEffectViewGlobal.frame = self.view.bounds; self.visualEffectViewGlobal.alpha = 0.0; [self.view addSubview:self.visualEffectViewGlobal]; ...

cell separator line in uitableview not covering the complete width

ios,uitableview

With this codes it will be ok : In method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath: cell.layoutMargins = UIEdgeInsetsZero; cell.preservesSuperviewLayoutMargins = NO; EDIT : Changed code lines according to this post : iOS 8 UITableView separator inset 0 not working...

some text of my cells changes color when I scroll my tableview

ios,uitableview,colors,cell,changes

You need an else in the code you quoted. What colour do you want it to be when the dateIsGreaterThanDate test is false?

After an insert into the UITableView : custom the cell

ios,objective-c,uitableview

You need to use UITextField instead of UILabel. When you insert a new cell, set this UITextField's enabled property to true. When loading all the other cells remember to set it to false to disable editing (the same cell maybe used at more than one place)....

How can I add a panGestureRocgnizer To a TableView, and still have the tableview scroll while recognizing pans right?

ios,objective-c,uitableview,cocoa-touch

Try this: - (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer { CGPoint translation = [gestureRecognizer translationInView:self.view]; if (ABS(translation.x) > ABS(translation.y)) { return YES; } return NO; } ...

Swift - Adding image to tableview cell from asset library

ios,swift,uitableview

The underlying issue I was encountering, as pointed out by @gnasher729, was the mishmash of synchronous and asynchronous calls. Rewriting the code to take this into account and to include a cache, I have the following working solution. var cachedImages = [String:UIImage]() func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell...

Why doesn't a UITableView scroll until I have 2 additional rows?

ios,uitableview

UIScrollView (from which UITableView inherits) has a alwaysBounceVertical property. If you set this to true, either in code or Storyboard, the table view will be vertically 'scrollable' regardless of how many rows it has.

how to enable UITextField userinteraction property inside UITableView Cell

ios,objective-c,uitableview,uitextfield

define flag data memeber with Bool type -(void)editTimeline{ flag=true; [self.tableView reload]; } add following condition in cellForRowAtIndexpath method if(flag==true){ [cell.ds1 setUserInteractionEnabled:TRUE]; } else{ [cell.ds1 setUserInteractionEnabled:NO]; } let me know if it help u....!!! ...

UITableViewCell Can Not Constrain Label to Right Edge

ios,swift,uitableview,autolayout,interface-builder

First of all remove all constraint from that three label then follow this step and add constraint one by one as mentioned below. For Left Label select your label go to pin menu the add this 5 constraint for it.: For center label add this two constraint so it will...

How to achieve this custom Scroll bar in IOS or something similar to it?

ios,objective-c,uitableview,uiscrollview

Create UISlider vertical - (void)viewDidLoad { [super viewDidLoad]; [self addSliderVertical]; } -(void) addSliderVertical{ slider=[[UISlider alloc]initWithFrame:CGRectMake(20, 40, 300, 300)];// set fram your require position CGAffineTransform trans=CGAffineTransformMakeRotation(M_PI_2); slider.transform=trans; [self.view addSubview:slider]; slider.minimumValue=1; slider.maximumValue=100; slider.continuous=NO; [slider addTarget:self action:@selector(sliderChanhge:) forControlEvents:UIControlEventValueChanged]; } Slider change method...

How to edit a UITableViewCell in a completion block from a method called inside the delegate method cellForRowAtIndexPath:

ios,objective-c,uitableview

In your completion handler simply ask the table to reload the affected row. As your data model now has the picture, it will update correctly. This also protects you against cells being off screen which will result in a noop(). When you scroll back all will be well as the...

add “Load More” to tableview NSObject json parse

swift,uitableview,nsobject

The method addObjectsFromArray is available for NSMutableArrays, but given your screenshot I guess your appDataArray is instead a Swift array (of tuples). You should either make your Swift array an NSMutableArray, or add objects to your Swift array without using addObjectsFromArray, it's your choice. I would suggest to go with...

How do I access the attribute of a one to many relationship and pass to another tableview?

uitableview,core-data,nsfetchedresultscontrolle,nsmanagedobject

So I read up more on faults and learned that it's actually not an error but more of a unrealized object. It will become a real object when it's called. In my case, I had a one-to-many relationship so entity B was a NSSet in the A.h file. I simply...

How to sort number list on tableview

ios,objective-c,uitableview

//Your GetScore Method Edit Check -(void)getScore { NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Score"]; NSError* error; self.scoreList= [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; //error log if(self.scoreList == nil) { NSLog(@"Cannot fetch the list for your Scores:\n%@", error.userInfo); } for (id obj in self.scoreList) { Score *sc = (Score*)obj; int type = [sc.type intValue]; if...

Resize a UITableView

swift,uitableview,resize,frame

My first guess was that you were using AutoLayout. Changes to view frames often don't have any effect in that case. Have you double-checked to make sure it's turned off for you storyboard? Failing that, the most likely cause of changing having no effect is broken outlets. Add a println...

How can I sort an array from Core Data using a stored integer attribute?

ios,arrays,swift,uitableview,core-data

First, your array with a fetch requests necessary to retrieve the objects is not very efficient. Just use a NSFetchedResultsController and the index paths will automatically point to your objects. In addition, you get great memory and performance optimizations for free. As has been pointed out in the comments, you...

Do I have to use both of these methods?

ios,swift,uitableview

No, you don't have to use both. Either you go with reloadCell technique or cell updates via beginUpdate and endUpdate. When you are reloading a particular row, internally table view system creates 2 cell and then blends in the new one with. You can remove the beginUpdates and endUpdates and...

UITableview with more than One Custom Cells with Swift

swift,uitableview,ios8,xcode6

Let me start with answering your questions first. Do I have to code an own class for every cell?=> Yes, I believe so. At least, I would do that way. Can I use one tableviewController?=> Yes, you can. However, you can also have a table view inside your View Controller....

Core Location and UITableView performance issues in iOS 8

objective-c,uitableview,google-maps,ios8,core-location

Figured out the issue. Turned out that I never stopped the locationManager from updating the current user location so the didUpdateLocations delegate method was being called continuously and consuming resources. Once I sent the stopUpdatingLocation method to the location manager it fixed the problem

iOS Is there a way to keep the UISearchBar in TableviewHeader when active

ios,uitableview,uinavigationbar,uisearchcontroller

hidesNavigationBarDuringPresentation property of UISearchController determines whether the navigation bar is hidden during searching. Set it to NO friendsSearchController.hidesNavigationBarDuringPresentation = NO; ...

Cell's accessory keeps truncating UILabel

ios,swift,uitableview,uilabel

You need to set trailing space to the label because bydefault it is taking width that's why its happening . So you need to set it manually.

UITableView reloadData not working when button tapped

ios,objective-c,uitableview

Are you properly assigning your agendaTable you created to your 'agendaTable' property in your viewDidLoad? self.agendaTable = agendaTable; ...

Updating Core Data Model using two separate View Controllers

ios,objective-c,uitableview,core-data

I resolved this. Here is what was done. First off there was serious cleanup of files, arrangement, etc. There were some objects, attributes, etc., that didnt make sense. Renaming things helped a lot as I was causing a lot of confusion. There was a one-to-one relationship between my List and...

UITableView Change Text in one cell, text in other changes as well

ios,swift,uitableview

You are cells are reused. Please implement this method in ChangePriceTableViewCell: func prepareForReuse() // if the cell is reusable (has a reuse identifier), this is called just before the cell is returned from the table view method dequeueReusableCellWithIdentifier:. If you override, you MUST call super. And set the correct default...

Add Storyboard UITableView and custom UITableViewCells to UIScrollView programmatically

uitableview,uiscrollview,storyboard

The answer is to relace: MealImageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; with MealImageCell *cell = [_myTablView dequeueReusableCellWithIdentifier:CellIdentifier]; with _myTableView being the IBOutlet for the table view in Storyboard....

UITableView Cell repeating

ios,swift,uitableview,custom-cell

The problem is this method: override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // when searchcontroller is active, return the number of search results. If inactive simply return the count of the full AED list. return self.AEDItems.count } This method is asking for the number of sections. You should return simply...

how to use Query.limit and Query.skip?

ios,swift,uitableview,parsing,tableview

You don't want to change the limit, you just want to download the next 5 so the limit still 5 during all the interactions, the only number you should alter is the number of rows to skip, however this will require adjustments in the if condition as now you want...

UISwipeGestureRecognizerDirection only Recognizes Right Gesture

ios,objective-c,uitableview,uiswipegesturerecognizer

Use this code... I hope you don't mind its in swift. override func viewDidLoad() { super.viewDidLoad() var swipeRight = UISwipeGestureRecognizer(target: self, action: "respondToSwipeGesture:") swipeRight.direction = UISwipeGestureRecognizerDirection.Right self.view.addGestureRecognizer(swipeRight) var swipeDown = UISwipeGestureRecognizer(target: self, action: "respondToSwipeGesture:") swipeDown.direction = UISwipeGestureRecognizerDirection.Down self.view.addGestureRecognizer(swipeDown) } func respondToSwipeGesture(gesture:...

How to fix table view's search bar overlapping with status bar

ios,swift,uitableview,statusbar

I think you need this code. In your viewDidLoad method add this code: self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0) And your tableview will be something like this: EDIT: You can forcely scroll table with this code: tableView.scrollToRowAtIndexPath( NSIndexPath(index: 0), atScrollPosition: UITableViewScrollPosition.Top, animated: false) ...

UITableViewCell conflicting height constraint

ios,swift,uitableview,autolayout

For reasons unbeknownst to be, setting the priority of the constraints down to 999 seems to resolve this issue for autosizing UITableViewCells.

how to make accordion in ios with image

ios,objective-c,iphone,uitableview

Try select the large image view in your cell xib file, select properties and tick clip to subviews.

Multiple NSURLSessions Causing UITableView Problems

ios,objective-c,uitableview,nsurlsession

Besides assuming that your network requests aren't erroring (you should at least log if there are network errors), there are threading issues. Your NSURLSession callback probably runs on a background thread. This makes it unsafe to call UIKit (aka - [_tableView reloadData]). UIKit isn't thread safe. This means invoking any...

UIView.hidden doesn't work immediatly

ios,objective-c,iphone,uitableview,uiview

Be sure to call hiddenLoadingView from the main thread. Sounds like you might be calling it from the completion block of some asynchronous method.

UITableView(grouped) adds extra empty header at the bottom

ios,objective-c,uitableview

Instead of returning a CGRectZero view for the footer, simply return nil. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return nil; } Also you do not seem to have implemented heightForFooterInSection:section. That should return 0.0. This seems to have come up before and it would seem iOS often pads the bottom...

Int and int is not Convertible To Int - (Return 2 arrays, UITableView)

ios,arrays,swift,uitableview

Since you say The second array is going to be a subtitle. The first array is a title of the cell. I assume that for each cell you have exactly one title and exactly one subtitle! Therefore it does not matter what value you return as long as you just...

UIScrollview w/ one large view, or UITableview w/ multable views?

ios,objective-c,iphone,uitableview,uiscrollview

You can do this really easily with a static UITableView. Take a look at my blog. It explains in detail how to do this. You don't even need a datasource or anything. http://www.oliverfoggin.com/using-a-static-uitableview-as-a-layout-device/...

NSFetchRequest to retrieve Every Student's Maximum Test Score for Every Subject in CoreData Entity

ios,uitableview,core-data,nspredicate

Okay, here is what I came up with. Hope this helps others out: I parsed the Managed Objects into NSMutableArrays based upon the "class" (race in my case). Then I used put each NSM Array into a NSMutableDictionary where an index acted as the key. This dictionary and the arrays...

programmatically generate different static UITableviews

ios,swift,uitableview,programmatically-created

A UITableViewController abstracts some things. It seems like maybe what you want to do is to separate things out and have a little more granular control. You can do this fairly easily. You need 3 things to make this happen: UITableView UITableViewDataSource UITableViewDelegate A UITableViewController puts these all together for...

Swipe up to show button in UITableView?

ios,swift,uitableview,ios8,uicollectionview

Put the button on your first row and the rest of the data after. Set an inset on the tableview so the first row is hidden until the user scrolls.

Swift ios relational picker views and apple dev guidelines

ios,xcode,swift,uitableview,search

Just a rough sketch: Say you pick a category from you PickerView. Your PickerView should then notify you parent ViewController that the user has picked a Category. The most convenient way to do this is to have a Delegate method, like: self.delegate.userPickedCategory(pickedCategory: Category) Now, I assume you Category object contains...

Calling prepareforSegue from a UIButton?

ios,swift,uitableview,uibutton,segue

Solved. I passed the index via UIButton option tag and replaced the indexPathForSelectedRow.

Weird looking UISwitch in UITableViewCell

ios,uitableview,uiswitch

You really want to your switch to be part of your custom UITableViewCell class, and be created as part of the cell instantiation. You can then access the switch via a property of the dequeued cell. layoutSubviews is not the place to be adding controls. You probably don't even need...

When adding a UITableView to an existing ViewController with a JTCalendar view up top, the table covers the entire view

ios,objective-c,uitableview

You're initializing the tableview with a fullscreen frame, and haven't told it to shrink down to the height you want. Try applying a fixed height constraint with the height you want, then add constraints to the left, right, and bottom sides of the tableview. Apple has lots of documentation on...

How to make the customized UITableViewCell xib width to fit the device width

ios,iphone,uitableview

Did you enable the Use Auto layout and Use Size Classes as below do that first in both table view and table view cell .and tell me your problem 1)After that select both image and label and do as below 2) Select the image and do below 3) select the...

Creating TableViews in Swift with an Array

ios,swift,uitableview,swifty-json

use self.tableView.reloadData() after you append your values getState() { (json, error) -> Void in if let er = error { println("\(er)") } else { var json = JSON(json!); print(json); let count: Int = json["games"].array!.count println("found \(count) challenges") for index in 0...count-1{ println(index); self.GamesList.append(json["games"][index]["game_guid"].string!); } dispatch_async(dispatch_get_main_queue()) { self.tableView.reloadData() } } }...

UITableView Sections. For each cell - a section with the title

ios,uitableview

You have to return like this for numberOfSectionsInTableView method instead of 1. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return sectionsTitle.count; } And in cellRowAtIndexPath: method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"TableCell"; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc]...