Ios Insert "Download on iTunes" button in app

My app shows the title of a certain song and I would like to insert a "Download on iTunes" button that open iTunes on my iPhone pointing to my song. I've retrieved the correct iTunes url, using the iTunes Link Maker but I've two questions for you. In which way can I add this button to my UIView? Do I have to insert a standard button? Which method do I have to call? Is it possible to dynamically compose the iTunes url? I've tried to implement the following method: - (void) openItunes {

Ios Setting alpha of IUTableViewCell subclass subview

I have a subclass of a UITableViewCell. I am trying to adjust the alpha of a whiteLine subview, but the alpha only takes effect once scrolling to an off screen cell. The initial batch of whiteLine subviews display with an alpha of 1.0. Here's how I set up the table cell: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CartCell"; BaseCell *cell = [tableView dequeueReusableCellWithIdentifier:Cel

Ios Displaying custom text in a textview

I have a data object and want to display it in a text view. It is inside a view that looks almost like an email view. The object I have has an array of "selections" each with a "name" and "value". The value property could be several lines of text. The name field is the description of the selection (i.e. "Name", "Address", "Comments", etc) I'd like to display it something like this... Name - Fogmeister Address - 1 The Street - Town - Country Comments - This is a long comme

Ios GMSMapView myLocation not giving actual location

I have a GMSMapView properly loaded and working inside my viewcontroller what i'm not being able to do is setting the GMSCameraPosition around my location this is my code: mapView_.myLocationEnabled = YES; CLLocation* myLoc = [mapView_ myLocation]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:myLoc.coordinate.latitude longitude:myLoc.coordinate.longitude zo

Is there a way to build multiple targets on the same gradle build script on iOS?

My current Script: (Which works fine for single target) buildscript { repositories { maven { url('http://openbakery.org/repository/') } mavenCentral() } dependencies { classpath group: 'org.openbakery', name: 'xcodePlugin', version: '0.9.2' } } apply plugin: 'Xcode' xcodebuild { scheme = 'TestBuildGradle' configuration = 'Debug' sdk = 'iphonesimulator7.0' target = 'TestBuildGradle'

Ios Error when drawing a UIBezierPath. No current point

I am creating a UIBezierPath like this: UIBezierPath *path = [UIBezierPath bezierPath]; [path addLineToPoint:CGPointMake(200.0, 40.0)]; [path addLineToPoint:CGPointMake(160, 140)]; [path addLineToPoint:CGPointMake(40.0, 140)]; [path addLineToPoint:CGPointMake(0.0, 40.0)]; [path closePath]; The problem is that when I try to draw my UIBezierPath, it does not appear and I get an error: <Error>: void CGPathCloseSubpath(CGMutablePathRef): no current point. My drawing code is very basic:

How can I make tableview the default view screen for my iOS app?

I have created a single view project, but now I would like the default view when you first open the app to be the tableview controller. Can I delete the original view that I no longer want? Or disable it somehow? Additional info: using storyboard in Xcode 5.0.2 Solution: I simply dragged the arrow in storyboard to the table view controller instead. Thanks everyone for your help! I'm brand new to this. :)

Ios Same character show difference Hex code

When i print This characters show following values, (unichar) $2 = U+2f42 u'⽂' (unichar) $3 = U+6587 u'文' Same character but different hex code.I want to I identify similar characters in this kind of different encoding. Like bellow if(c1 == c2){ } Actual situation more complex than this. One set of text are extracted text from pdf file encode using glyph and other one is search text word. Thanks in advance.

Ios MoPub Full SDK 2.3.0 Improper IDFA usage

During my IOS app validation, warning shows "Improper Advertising Identifier [IDFA] Usage. Your app contains the IDFA API but you have not indicated its usage on the Prepare for Upload". I have updated the admob SDK inside with the latest. Do I have to tick using IDFA during the preparation for upload? Regards Hammer

Ios json grouping date and filling uiTableView headers

I have json data that I want to group by dates for the section headers and fill the sections of the table view with the corresponding team names. data: [ { "awayscore": null, "awayteam": "Norway", "collectionid": "33958", "gameid": null, "gametime": "2014-05-03 19:00:00", "homescore": null, "hometeam": "Olympics 2014", "id": "20921", "opplogo": null, "psiteamid": "0", "seasonid": "166", "side": "home", "status": null, "teamid": "20016" },

Ios Update tabBarItem badge using NSNotification is not working (swift)

I want to post a notification from my appDelegate in order to updtae the badge number of the tabBarController. So in appDelegate : NSNotificationCenter.defaultCenter().postNotificationName("addBadge", object: nil) In the viewController : func addBadge () { badgeNumber = badgeNumber + 1 var tabArray = self.tabBarController?.tabBar.items as NSArray! var tabItem = tabArray.objectAtIndex(3) as UITabBarItem tabItem.badgeValue = "\(badgeNumber)" } override func view

How to build a speech-to-text app using Swift in iOS

I'm trying to write an iOS app (Coding in Swift) that converts speech into text and display that text in a TextView. I'm using the OpenEars library. But, so far I haven't found any materials for Swift that show how to convert speech into text. How to convert speech into text and display it in a TextView?

iOS textarea text hidden when using -webkit-overflow-scrolling: touch

Once again I am here because I have exhausted my research on the subject. I have a very simple setup with very simple markup and yet a very strange behavior. The behavior is eerily similar to (Firefox and Angular: Textarea placeholder doesn't appear until first focus) but I am experiencing it in a different environment. Consider the snippet with a readonly text area. This brings bad a list of comments, where 2-3 fit on the screen before having to scroll for some more already loaded com

Ios Loading `UIImage` inside `UItableViewCell` not working as expected

I have read many questions and answers [here or on the web] through this day and I can't find an answer to my problem. The situation is : I have a custom UITableViewCell that contains a UIImageView, I load the content of the cell from a server and this is working as expected. for the UIImageView I started a new thread to download the image, but the image is not showing UNTIL I download the whole items in my DataBase ! I have tried putting a link to a sample image in the internet and this wo

WatchKit: direct communication with the containing iOS app

I just get started with WatchKit and I'm trying to do this (if I'm not wrong, it is possible to do): I'd like the WatchKit Extension to ask the containing app for requesting some data to a web service, and then return the service response to the Extension to update the WatchKit App interface accordingly. As I read in Apple Watch Programming Guide, yo can call the openParentApplication:reply: method in the WatchKit Extension to request something to its containing app, and then the application:ha

Ios Convert my xib to arabic language

My app is going to be made in both English, Arabic languages. I have made my xib using auto layout for english version. Now i want to use same xib for arabic version. But the problem is that interface will also change its layout from right to left. I know about NSLocalization for xib's but i am clueless for arabic version, I googled last day but not found any thing relevant. e.g. English version Icon label Arabic version label Icon Please put some light in how can i convert my english vers

Ios Get index of last repeated string in NSMutableArray

I have a NSMutableArray with multiple repeated strings, I am trying to get last string index. NSMutableArray *arrWithRepeatedStrings=[[NSMutableArray alloc]initWithObjects:@"iOS",@"apple",@"iOS",@"apple",@"apple",@"iOS", nil]; here iOS and apple are the repeated strings in my array. I think it's possible and am on the way to it. Can anyone help me.

UISearchBar in iOS 8 - UI displacement

I have UINavigationItem and I want to add UISearchBar to it. Here's how I'm doing that: let searchBar = UISearchBar(frame: CGRectMake(0, 0, self.navigationController!.navigationBar.bounds.width, self.navigationController!.navigationBar.bounds.height)) //searchBar.sizeToFit() searchBar.showsCancelButton = true let barWrapper = UIView(frame: searchBar.frame) barWrapper.addSubview(searchBar) self.navigationItem.titleView = barWrapper Here's result: What's wrong here?

Ios how create a new NSUrlSession (after first session is invalidated)

As suggested from Apple I use finishandinvalidate method for NSURLSession after that my app downloads each file. Then the app must have download new update file but I don't reach to create new session. Method to create session is this: - (NSURLSession *)backgroundSession { NSString* sessionIdentifier=@"com.liuk.pf"; NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:sessionIdentifier]; static NSURLSession *session = nil; static

Ios Required device capabilities for iPad Wifi only

I recently published an app in the AppStore. Many users are getting the device compatibility message and it seems that all of them are having an iPad WiFi only. My app need location of the user but it don't need an accurate one. Currently in the Info.plist I've location-services and gps under the required device capabilities. My question is: If I remove these two requirements from the info.plist. Will my app be able to execute and get location whenever it's possible? Sorry for asking but I h

Ios Change localizations of base storyboard to german swift xcode

I have an App which is nearly done and I only need to add localizations to it. The problem is that I have written it completely in German (because I am from Germany) and I don't have changed the development language. That means xCode thinks that everything I have done is written in English and not in German: I have tried to set the CFBundleDevelopmentRegion to German and also to set the Localization native development region (in target) to german but nothing worked. So my basic question is:

videos does not work in iOS 9.0.1

My code was working fine on ios8, while it does not work on ios 9. It actually does not work for other videos, for videos in photo library, it works well. Please help! It is an video play app, the main code is as below: AVURLAsset *movieAsset = [[AVURLAsset alloc] initWithURL:wpTrack.url options:nil]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:movieAsset]; _audioPlayer = [AVPlayer playerWithPlayerItem:playerItem]; AVPlayerLayer *playerLayer = [AVPlayerLayer player

IOS bring activated view controller from background to foreground

I have 2 UIViewControllers, the first controller to load data from server, and then go to the second controller. When 2nd controller needs to fetch more data, it will go back to 1st controller. 1st controller has reference of 2nd, and vice versa. But when I try to call the 1st controller again from 2nd controller, it shows error 'Application tried to present modally an active controller' Here is how I call the 1st Controller for 2nd time self.presentViewController(firstController!, animated:

iOS BLE UART Data Transmission Problems

I'm using an Adafruit BLE UART board to transmit data to an iOS application for processing. On the iOS side, data is being processed by a class called UARTPeripheral. (The link I sent is to the file in some one's GitHub project - I can't find a link to the real thing - but the file is the same. The Arduino side is processing the data with an Adafruit library. The things that require scrutiny on each side (at least I think) are the print() function on the Arduino side and the - (void)didReceiveDa

Ios performSegueWithIdentifier is not presenting the desired View

I've set up a "show detail" segue from one viewcontroller to another. however when i execute below code nothing happens, it doesnt show the viewController. I'm 100% that the identifier in the segue is identical. What can course this? self.performSegueWithIdentifier("PresentPermissionView", sender: self) i'm calling it in this method func determinePermission() { switch CLLocationManager.authorizationStatus() { case .AuthorizedAlways, .AuthorizedWhenInUse: if CLLocationManage

iOS10 UNNotificationServiceExtension not called

Im implementing new iOS10 extension to use rich notifications. Im trying to test it on push notifications but is not working, I just receive a simple notification and is not going through the extension. I did all that it's specified in the official sites and some other places: I have my app up and running with push notifications and the right provisioning profile I added a new target to my app, a Notification Service Extension Implemented my own code (it doesn't matter really because is not e

Ios Adding accessibilityIdentifier to UITabBarButton

I'm displaying a UITabBar in my app, and am trying to assign accessibilityIdentifiers to the buttons. To accomplish this, I use the following lines in each of my view controller instantiations: viewController.tabBarItem.accessibilityIdentifier = @"ViewControllerID"; These viewControllers all get added to the UITabBar like so: NSMutableArray *tabBarItems = [NSMutableArray array]; for (NSInteger i=0; i<_viewControllers.count; i++) { UIViewController *viewController = [_viewControllers

Ios App freezes on main thread on iPhone 5c but not on iPhone 6s

I'm working on an app with a navigation controller. Swift + objective C Important note: This freeze happens 100% when testing on iPhone 5c and never happens when testing on iPhone 6s The scenario is: Go to TableViewController A Touch an item of the list to reach TableViewController B Go back to TVController A by pressing the top left arrow The app shows TableViewController A but freezes right away The UI is frozen but the app is still running. If I press the Pause button (debug mode), I ca

Ios How to properly use VarArgs for localizing strings?

I have a String extension that helps me internationalise. public extension String { var localized: String { return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "") } func localized(args:CVarArg...) -> String{ return NSString.localizedStringWithFormat(self.localized as NSString, args) as String } } This way I can easily use "hello_world".localized anywhere in the app and it works nicely. Now I want to have the same funct

Open Game Center with URL scheme in iOS 10 no longer working

Previously it worked for me to open Game Center via the following URL scheme: [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"gamecenter:"]]; In the latest iOS version this does no longer work and basically nothing happens. How can I switch to the Game Center app in iOS 10? EDIT: I just tried opening Game Center in the popular game Clash Royale by pressing their "Open Game Center" button and also nothing happens there. Is this a current iOS bug maybe?

Ios Swift: How to play the video and download at the same time

Currently in our iOS Application, we are downloading the video and then playing it, which is indeed taking a lot of time and killing the user experience. Now, we want to shift to directly stream the video or play the video while it is downloading. I have tried using AVAssetResourceLoaderDelegate. I doesn't play the video at all and displays the mime type as text/html. Maybe because I am loading from a secured URL with headers. Can someone suggest me a good way where I can stream or Play the v

Mapping two kind of responses with Alamofire and AlamofireObjectMapper (iOS - swift)

So, I'm making an iOS app the search a movie on imdb database (using omdb api) and the user could save the favorites. To search by imdbTitle the request url is "https://www.omdbapi.com/?s=(imdbTitle)&type=movie", if imdbTitle = "arq", for example, the response is: { Response = True; Search = ( { Poster = "https://images-na.ssl-images-amazon.com/images/M/MV5BMjAxODQ2MzkyMV5BMl5BanBnXkFtZTgwNjU3MTE5OTE@._V1_SX300.jpg"; Title = ARQ; Type = movie;

Ios UITableView calling didEndDisplayingCell incorrectly

I am having an issue using a UITableView's didEndDisplayingCell method. I am using this method along with willDisplayCell to handle some extra data tracking for my table. The problem is that didEndDisplayingCell is being called several times in a row, and at times where the cell is actually still being displayed. I cannot figure out why this would happen. More Details I am using an NSFetchedResultsController to provide data for the table. Changes come into the table from an NSManagedObjectCont

Ios MaxErrorRetry Firebase Swift

I am running in a problem with my firebase server (free version). I dient change a thing in my function but suddenly the error max retry error occurs. It ran well for a long time and now it changed. A function gets called like limitlessly until it crashes and the error message occurs. My code which is causing the problem func calculateScore(postId: String, onSuccess: @escaping (Post) -> Void, onError: @escaping (_ errorMessage: String?) -> Void){ let postRef = API.Post.REF_POST.chi

iOS Swift: How to recreate a Photos App UICollectionView Layout

I am wondering for quiet a while now how to create the iOS Photos App layout. How can I make it so it looks like zooming in to a collection while at the same time the navigation bar shows a back button? Is it a new view controller which gets pushed onto a UINavigationController? And if so, how exactly do they manage to match the tiles while expanding. Is there maybe even a 3rd party library which lets me easily recreate such a layout? Hope you can help me to understand the concept of how th

Ios UILabel shows more white space in top and bottom for long text

I want to display attributed text label inside a scrollview. I use the following code the label displays the text in centre and some extra white space is added in top and bottom. NSString *STR_titl_iten_des = @"Item Description"; NSString *STR_descrip_detail = @"Long text to be displayed"; self.lbl_item_descrip.numberOfLines = 0; NSString *text2 = [NSString stringWithFormat:@"%@\n%@",STR_titl_iten_des,STR_descrip_detail]; if ([self.lbl_item

Ios Possible to get GPS exif data from Camera photo

I have an app that launches the camera: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = NO; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:picker animated:YES completion:NULL]; And I implement the delegate to get the image taken by the camera: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { ... } Inside that

facebook ios url scheme for swift4

Does anyone know the scheme of facebook for swift4? I have tried many ways and also these: fb://profile/\(Username)! , fb://profile?id=[username|user_id] , but redirects me to the wall of my facebook page

Ios swift4: Firebase Notification not working when sending notification from server

I'm using Swift4: I want to create firebase push notification, i'd follow steps as this video firebase push notification and this is the app delegate code: import UIKit import IQKeyboardManagerSwift import FBSDKLoginKit import TwitterKit import Firebase import FirebaseMessaging import FirebaseInstanceID import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingW

Ios CoreData returns empty data

coreData returns empty data when there should not be any, even if you uninstall the application and reinstall it and make a request to Сore Data, the context.fetch returns the data get all Data in Сore Data func getMyLoadBook(){ words.removeAll() let appDelegate = UIApplication.shared.delegate as! AppDelegate let context = appDelegate.persistentContainer.viewContext let fetchRequest:NSFetchRequest<Favorite> = Favorite.fetchRequest() fetchRequest.returnsObjectsAsFault

Ios Add UILabel as subview of UITextField on top

I am in the process of implementing a UILabel as a subview of a UITextField which will be shown right above the UITextField itself. The UITextField has a rounded border and what I would like to achieve is the UILabel to be shown over the border. Everything currently works as expected, but the UILabel is drawn behind the border of the UITextField. I want it to go "over" (above) the border so the white backgroundColor would be shown above part of the border and make the text more easily readible.

Ios How to handle auto renewable subscription resubscribe?

I am implementing auto renewable subscription in my iOS application. Monthly subscription auto renews after 5 mins in sandbox mode. I have added transaction observer in appDelegate. So when app restarts updated transaction method gets called and i m getting following logs. payment store product purchased il_pkg1_1month_2 payment storee product purchased transaction id Optional("1000000792969469") payment store product purchased il_pkg1_1month_2 payment storee product purchased transact

Ios Unable to Select A UITableView Row on Tap, But Can On Long Tap

I have an iOS App that has the following flow: UITabView -> TabView with UITableView -> Select A Row -> UITabView (as full screen modal) -> UITabView with UIViewController and a UITableView The UITableView Rows in the UIViewController don't allow me to select them on a single tap. I can select them if I either A) 2-Finger Tap or B) Long Press (3D Force Touch?) on the row. Then the row triggers the didSelectRowAt. Otherwise nothing happens. I've tried setting these on the UITableView

  1    2   3   4   5   6  ... 下一页 最后一页 共 2101 页