cocoa-touch

How to add a transparent mask on map View [closed]

半腔热情 提交于 2020-01-01 19:47:05
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to add a color mask on my MapView screen (without coordinate, I want to display it on all my mapView) and keep the control on this mapView. I've heard about MKOverlay but I dont know how to use it for all

Finding the current view when application enter foreground. IOS

匆匆过客 提交于 2020-01-01 19:42:13
问题 How do we find which view is presently first responder when application become active. I know application delegates applicationWillEnterForeground and applicationDidBecomeActive will be called in cases, how can I use this to intimate view which is first responder. I have googled and stack overflowed didn't find exact answer. Any idea friends.. 回答1: Getting reference to the top-most view/window in iOS application topMostView = [[[[UIApplication sharedApplication] keyWindow] subviews]

UITableView - resign first responder on outside touch

半世苍凉 提交于 2020-01-01 19:36:12
问题 I have a UITableView with an associated UITableViewController. However, I've modified the table to also have a view with a textfield subview. As always, I want the keyboard to disappear when the user hits 'done' (easy) and when they touch anywhere else on screen other than the textfield (hard, stuck!). The normal way to achieve this is to change the class to UIControl so it can handle actions... but I can't do this for my UITableView/UITableViewController combination. How can I solve this

How to add touch event for custom uicontrol and controller?

旧巷老猫 提交于 2020-01-01 19:26:11
问题 I have a custom UIControl that has three subviews. Each of those subviews, I add a target: button.addTarget(self, action: #selector(buttonTapped(clickedBtn:)), for: .touchUpInside) Within that function buttonTapped , it does some special animations to do some transitions (It mimics the segmented control). Now, within the ViewController that this custom UIControl exists in must know when it's touched. I created an @IBAction function that interacts with the touch events for the custom UIControl

UIButton Semi-Transparent Border

回眸只為那壹抹淺笑 提交于 2020-01-01 19:23:12
问题 I have a custom button and the border is supposed to be semi-transparent white. If I do this: - (void) awakeFromNib { self.layer.cornerRadius = 6.0f; self.layer.borderWidth = 4.0f; self.layer.borderColor = [[UIColor colorWithWhite:1.0f alpha:0.5f] CGColor]; } I get this - transparency but of the original button color: The border is semi-transparent but the color of the button. 回答1: Set the color of a sublayer to the color you want the button to be (don't set the background color of the button

iOS Dropbox SDK on Device fails login with NSURLErrorDomain

放肆的年华 提交于 2020-01-01 19:20:53
问题 UPDATE: Setting the Dropbox SDK to use HTTP instead of HTTPS cures this problem on an iPhone 3G. I haven't used the SDK on iPhone 4 or iPad yet so I'm not sure of the result. Playing with the Dropbox SDK on iOS yields these results: in simulator, I can properly link my account using the provided login form class. Changing the build setting to device, I get an error alertView triggered by this method in DBLoginController.m - (void)restClient:(DBRestClient*)client loginFailedWithError:(NSError*

NSKeyedUnarchiver memory leak issue

爱⌒轻易说出口 提交于 2020-01-01 19:14:13
问题 I have problem with this code, it's working on debug environment. On the instruments I'm seeing memory leak problem on this function, instruments is giving warning that Category Event Type Timestamp Address Size Responsible Library Responsible Caller 27 SocialNetwork Malloc 00:19.951 0x3d64d20 80 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] - (NSMutableArray *)GetDataInstanceToUserDefaults{ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSData

Countdown NSTimer in title of a UIAlertController getting a null instead of time in seconds

我的未来我决定 提交于 2020-01-01 19:11:26
问题 I'm trying to display a countdown in the title of a UIAlertController. I want to have something like "Your session is going to expire in X seconds". My thought process was to create an NSTimer and store the time in an NSString stringWithFormat and have that string be the title of the alert controller. Here is my countDown method: @interface ViewController () { NSString *seconds; int mainInt; NSTimer *timer; } - (void)countDown{ mainInt = 20; mainInt -= 1; seconds = [NSString stringWithFormat:

Change Keyboard Color in UISearchBar with apperance

偶尔善良 提交于 2020-01-01 19:01:12
问题 I want to change the color of the keyboard to black, when the user taps on the search textfield. I was trying to achieve it with UITextField *textField = [UITextField appearance]; [textField setKeyboardAppearance:UIKeyboardAppearanceAlert]; but my build fails with this message Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISearchBarTextField _UIAppearance_setKeyboardAppearance:]: unrecognized selector sent to instance 0x8485260' Please can you help me

Why does UIWebView shrink images?

爷,独闯天下 提交于 2020-01-01 18:16:12
问题 I'm using a UIWebView to display images in base64 (http://www.abluestar.com/utilities/encode_base64/index.php). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and