uikit

UIAlertView wont delegate

拈花ヽ惹草 提交于 2019-12-12 03:16:21
问题 I'm try to get from an UIAlertView the Content with following: UIAlertView *loginView = [[UIAlertView alloc] initWithTitle:@"Login" message:@"Please enter user and pass" delegate:self cancelButtonTitle:@"Abort" otherButtonTitles:@"Login", nil]; [loginView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput]; [loginView show]; and then -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { UITextField *username = [alertView

ios recognizing gestures simultaneously with object handling

自作多情 提交于 2019-12-12 03:08:50
问题 Is it possible to recognize gestures and touches simultaneously when interacting with a UIKit object. For example, when a user is scrolling through a slider or pickerview, could I also be handling a swipe gesture? 回答1: If you set your view controller to be the delegate of your gestures, you can implement: - (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer I'm not sure if you're

swift inherited protocol method override

烈酒焚心 提交于 2019-12-12 02:45:53
问题 I was hoping this would work: protocol Foo : UITableViewDelegate{ } extension Foo{ func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { print("ROW:\(indexPath.row)") } } class MyVC : UITableViewController, Foo{ //... } No luck though, the method does not get called. Am I missing something, or is this genuinely not possible? Also, there is no compiler warning/error, the method is just not being called, which some may consider a bug. 回答1: I think this is

SLComposeServiceViewController preview view doesn't show up

那年仲夏 提交于 2019-12-12 02:36:39
问题 I want to use SLComposeServiceViewController inside my app as a UI for composing and posting a message to my backend. However, if I override loadPreviewView and return a view as stated in the documentation, that view doesn't show up. This is my code: @interface ComposeViewController : SLComposeServiceViewController @end @implementation ComposeViewController - (UIView *)loadPreviewView { UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; v.backgroundColor = [UIColor

Using a View Controller managing two other View Controllers

风流意气都作罢 提交于 2019-12-12 02:16:16
问题 I have a offlineMapVC and a onlineMapVC for my application to support both online maps (using MapKit and Google Maps) and offline maps (using Route-Me). I made my own mapVC to manage the switching of these mapVCs and be able to use the view controller as one separate view controller. Well I've done this by making the offlineMapVC and the onlineMapVC instance variables of the new mapVC witch I now use all over my application. First off all things seem to work but. However while using this

Grouped UITableView Interface Builder Examples/Tutorial

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:57:54
问题 I'm having an immense amount of trouble figuring out how to populate a Grouped UITableView with custom UITableViewCells. Could anyone point me towards a tutorial on how one might do this? Or does anyone have an example of what a cellForRowAtIndexPath method would look like when creating a Grouped UITableView with custom UITableViewCells? Thanks. 回答1: Here are some guidelines: Each of your group in grouped UITableView is a section. Then the method: - (UITableViewCell *)tableView:(UITableView *

Custom cell with three buttons (with icon) in objective c

旧巷老猫 提交于 2019-12-12 01:52:33
问题 I was using PSButtonCell's for links but three individual ones took up too much space so I'm trying to create a custom cell with three buttons in one row; basically like 3 floating icons. I've got some code for creating a tableview with icons, but currently I do not know how to space them properly (all the icons currently overlap), and I have no idea how I should go about adding tap listeners to the views. Does this look like something I could modify to do what I want? If not does anyone have

How can I capture the amount of surface area that the user is making contact with the iPhone screen?

十年热恋 提交于 2019-12-12 01:35:18
问题 Is there a way to capture the amount of screen that is making contact with the users? I assume there is since this finger painting app shows the ipad responding to only the pixels that the user makes contact with. Thanks so much in advance for your help! 回答1: The size of the touch is abstracted away by the framework, and UITouches only contain calculated (“best estimated”) points instead of the raw, actual areas that were touched. I would guess that the “pressure” was calculated from the

Reranging a uitableview

笑着哭i 提交于 2019-12-12 01:32:30
问题 I ran into the same problem as desciped in: Crashing while trying to move UITableView rows! All I want to do is on specific reranging operations insert a new cell or delete the selected one. Sometimes I get: ********* Assertion failure in -[_UITableViewUpdateSupport _setupAnimationForReorderingRow], /SourceCache/UIKit/UIKit-963.10/UITableViewSupport.m:295 Attempt to create two animations for cell exception and when I want to reload my data by calling [self.tableView reloadData] I get: *******

Mutlitouch drawing in iOS

Deadly 提交于 2019-12-12 01:05:51
问题 I am working with drawing project, and it is quite working well, the only problem is that, it works only with single touch.I want to do multitouch drawing, so that if user draws with his two fingers, then it should draw them Below is my code for single touch drawing -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; //LocationInView returns the current location of the reciever in coordinate system of the given View. m_previousPoint1 =