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/...
ios,objective-c,iphone,nsfilemanager
NSFileCoordinator and NSFilePresenter are created just for that. You may find interesting Advanced iCloud Document Storage video from wwdc that covers the usage of this classes. Building a Document-based App will be great to watch too.
As pointed out by @valdentro, the development profile was not there on my machine. screenshot here After revoking and requesting a new certificate, it was working....
If you want to perform any action with single tap you and long press the you can add gestures into button this way: @IBOutlet weak var btn: UIButton! override func viewDidLoad() { let tapGesture = UITapGestureRecognizer(target: self, action: "Tap") //Tap function will call when user tap on button let longGesture...
ios,iphone,xcode6,iphone-6,iphone-6-plus
You should keep your image view point sizes the same but you should add a new pixel resolution for all of your images (3x) which will be used for the 6+. Although the 6+ is slightly less than exactly 3x resolution, the OS does some scaling so that you can...
ios,iphone,xcode,xcode6,ios-simulator
Create and add a CCSprite: CCSprite *bg = [CCSprite spriteWithFile:@"bg.png"]; bg.tag = 1; bg.anchorPoint = CGPointMake(0, 0); [self addChild:bg]; ...
ios,iphone,amazon-ec2,amazon-s3,amazon-ebs
Allowing an app to write directly to an instance file system is a non starter, short of treating it as a network drive which would be pretty convoluted, not to mention the security issues youll almost certainly have. This really is what s3 is there for. You say you are...
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...
Haha! I just found out the answer today, I must have been really tired. Basically i was missing the return instruction in the if statement inside the play function if(self.currentAudioIndex == index) { self.resumePlayback() return //This was missing } So what happened was that the audio was being loaded again...
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....
ios,objective-c,iphone,xcode,uiviewcontroller
in your ClassA.m - (IBAction)button1:(UIButton *)sender{ path=[[NSBundle mainBundle] pathForResource:@"filename" ofType:@"pdf"]; [self performSegueWithIdentifier:@"yourIdentifierName" sender:self]; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"yourIdentifierName"]) { classB *clsB =segue.destinationViewController; clsB.typeofSelect=path; } } in your class B.h @property (nonatomic, weak) NSString *typeofSelect; in your Class B.m @synthesize typeofSelect;...
The fact that I wrote that code helps me answering this question but the answer probably only applies to this code. You can easily limit the frequencies you listen to just by trimming that output array to a piece that contains only the range you need. In details: To be...
What I can see from your screenshots, you put constraints on view (white view as background). Now You need constraints on buttons and label to. Important is that buttons doesn't have fix width constraint,... but tailing and leading constraint. Actually you can create similar constraints for buttons like you create...
ios,iphone,swift,uisegmentedcontrol,uicontainerview
I found a solution to have all three views loaded into memory and be able to change which function I am calling using @Julian's response: Objective-c: How to invoke method in container view controller //Determine which view is showing and point to the correct child class func sendTransactionButton(sender: UIBarButtonItem) {...
iphone,swift,ios8,popup,xcode6
It sounds like you want a UIAlertController, check this out: @IBAction func popUpButton(sender: UIButton) { //This is where you declare and initialize your `UIAlertController` let alertController = UIAlertController(title: "Alert", message: "Test Alert", preferredStyle: .Alert) //You give the `UIAlertController` an action, which basically has a cancel button, that just cancels out...
childNodeWithName will return nil if a node with that name does not exist. Your code is not checking for this possibility (the as! assumes that it is both not nil and of the appropriate type) so this is causing the crash. The tutorial asks you to create this 'gameOverLabel' node...
ios,objective-c,iphone,xcode,parse.com
You can just retrieve the profileCompleted value from the current user - PFUser *currentUser = [PFUser currentUser]; BOOL profileCompleted= [[currentUser[@"profileCompleted"] boolValue]; if (profileCompleted) { ... } if the data held in PFUser may be stale (e.g. profile was completed somewhere else) then you will need to fetch the user -...
android,iphone,html5,windows-phone-8,input
When retrieving the value with jquery it is returned with a . decimal separator. Try this: <!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <input type="number" name="myNum" id="myNum"> <button id="submit">Submit</button> <hr/> <code></code> <script> $("#submit").on("click",function() { var numericValue = $("#myNum").val();...
Yes...because its Xib....you can create constraints to the xib objects...but what about xib edges....you need to give height and width constraints to your xib to get rid of this...It just placed in your view with xib height and width...in your case it is (340,325)...you have to make it screen width...
ios,objective-c,iphone,addressbook,abaddressbook
I have created ContactData NSObject Class. In following method, I am creating its object for each contact. At the end, you will get NSMutableArray named contactArr. -(void)loadContacts{ ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL); //NSLog(@"%@", addressBook);...
ios,objective-c,iphone,storyboard,modalviewcontroller
There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller): [(ChildViewController *)segue.destinationViewController sourceVC] = self; Anyway, I think...
ios,iphone,xcode,parse.com,push-notification
Use advanced targeting. Just enumerate device tokens you need to send push notifications to in where clause. Check out this sample in parse.com forum.
Some devices not recording sound correctly, but it is workng on simulator not working on real devices, check your code first then try again
ios,objective-c,iphone,uitableview
Try select the large image view in your cell xib file, select properties and tick clip to subviews.
I can't see where in your code you have created physics bodies for paddle and a ball. So, you are actually trying to use physics bodies before they exist. Here is an working example to give you a basic idea about how to create physics bodies and how to move...
No there is not. if your app supports iOS8 it must run on all devices which support that OS. iPhone 4S included.
ios,objective-c,iphone,uiimageview
iPhone 6 uses @2x image assets and not R4 or something else because apple didn't provide suitable APIs for background images! https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1...
ios,objective-c,iphone,opentok,tokbox
On the iOS publisher side, the OpenTokRTC avoids that complexity as it is a demo app - but you can see: Where OpenTokRTC creates OTPublisher: In a different sample app, an example custom OTPublisher that uses a custom VideoCapture. Where the custom VideoCapture sets the resolution. Combining these, you should...
ios,iphone,xcode,uinavigationbar,popover
I solved this problem (temporarily) with adding a new NavigationController to the ViewController3 with (Editor->EmbedIn->NavigationController) and add a back button to buttom of the layout. The problem to segue data from VC1->VC3, i solved with defining a global Variable in VC3 and add a action Button (in VC2) with assigning...
ios,iphone,xcode,automatic-ref-counting
Issue 1, not getting any response on this one, I just commented out the offending line and the tool no longer complained about it. So far no ill effects under ARC. Issue 2, thanks to Michael, was resolved by moving the declarations of response and error to each method in...
ios,iphone,ipad,ios8,testflight
Test-Flight App Beta Testing Answer 1 : yes, Apps may only use TestFlight to beta test apps intended for public distribution and must comply with the full App Review Guidelines. Apple Developer Answer 2 : yes, there wan't be any problem if you selected minimum target as IOS 8. If...
It seems the included library are not compiled for i386 (or simulators) so you must run code on real device. See author comment here and here
ios,iphone,watchkit,wkinterfacetable
Make sure that... Your WKInterfaceTable is connected via IBOutlet to your Storyboard element. Your rowType identifier for the row controller is set in Storyboard: Your Class identifier for the row controller is set in Storyboard: You have overridden the correct WKInterfaceController method: override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) {...
iphone,swift,uiviewcontroller,ios8,segue
So instead I was thinking to have a value associated with each button in the first view, have it sent to the second view via a segue, and then sent again to the third view and tell it to use the proper segue to the proper third view Controller...
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); } ...
ios,iphone,xcode,uinavigationcontroller
In the storyboard you have to set its property "Is initial view controller" in the navigation controller Attributes Inspector.
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.
You just have it when adding the gesture recognizer to the cell. When the gesture happens, the parameter passed will be the cell. So when declaring the tapGesture method you just access the sender's tag property. func tapGesture(sender: UITapGestureRecognizer) { var tag = sender.view!.tag //do what you want } ...
ios,iphone,swift,uiimageview,uigesturerecognizer
Your selector has arguments so needs a colon after its name. So: let gestureRecognizer = UITapGestureRecognizer(target: self, action: "fieldsTappedAction:") ...
I suggest you to Initiate view Controller when user successfully logged it with below code: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("nextViewController") as! UIViewController self.presentViewController(vc, animated: true, completion: nil) This way you can easily control your navigation and if user not entered correct information then you...
ios,iphone,itunesconnect,rename
To change app name which is visible on App Store you need to change Name on iTunes Connect on your app page below the Screenshot and above app Description there is field Name which you need to cahnge, to change the name of app on home screen visible to user...
ios,objective-c,iphone,encryption
It's obviously only a problem with the mode of operation, because the first block matches. In Java you're using ECB mode, because "DES" defaults to "DES/ECB/PKCS5Padding". I think that CCCryptor defaults to CBC. Don't ever use ECB mode. It's not semantically secure. You need to use at least CBC mode...
ios,iphone,swift,nsfilemanager
if you created folder reference when adding the folder to your project use it like this (emojis folder icon is a blue folder): let resourcePath = NSBundle.mainBundle().resourcePath!.stringByAppendingPathComponent("emojis") var resourcesContent : [NSURL] { return NSFileManager().contentsOfDirectoryAtPath(resourcePath , error: nil)! as! [NSURL] } let emojiCount = resourcesContent.count println(emojiCount) if you created groups when...
iphone,ipad,airplay,screensharing
For screen sharing Reflector is the best solution. It's wireless mirroring means you can share your iPad screen on mac and then you can share mac to client.
ios,iphone,xcode,user-interface,customization
I would suggest that you look at targets http://www.itexico.com/blog/bid/99497/iOS-Mobile-Development-Using-Xcode-Targets-to-Reuse-the-Code You could generate your XML file for each "Target", but only include the correct one for each target. Then when the app is compiled it should include all the relevant information. If you are producing multiple apps, you also need to...
You need to use a viewport meta. Define this in your head. <meta name=viewport content="width=device-width, initial-scale=1"> This would fit the content to whatever the device-width is....
You have to initialize the event store object before using. + (BOOL)removeEventWithEventIdentifier:(NSString *)identifier { EKEventStore* eventStore = [[EKEventStore alloc] init]; EKEvent *event2 = [eventStore eventWithIdentifier:identifier]; BOOL result = NO; if (event2 != nil) { NSError *error = nil; result = [eventStore removeEvent:event2 span:EKSpanThisEvent error:&error]; } return result; } ...
iphone,uipickerview,uialertcontroller
Ok so I will try to explain this: You declare a NSMutbleArray, you can't expect to use a NSArray because is not mutable, and you need to modify the content. NSMutableArray *array; UIAlertController * view; @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSArray* friends = [NSArray arrayWithObjects: @"jim", @"joe", @"anne",...
objective-c,iphone,ios8,uinavigationcontroller,autorotate
Just subclass UINavigationController and override appropriate methods: .h File: @interface CustomUINavigationController : UINavigationController @property BOOL canRotate; @end .m File: @implementation CustomUINavigationController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any...
I had same problem and I posted detailed question later. Luckily, I figured out the problem and it is working for me now. I was not sending data in proper format that got working after I sent data in proper format. My JSON format looks like this. { "notification":{ "badge":"12",...
ios,objective-c,iphone,core-data,magicalrecord
Your objects have no changes occurring in the save block. There are two problems I see here. You are creating your new objects in the MR_defaultContext when you need to be creating them in the localContext that is the saving context for your save block. Try this: - (void)updateStorageWithQuizzess:(NSArray *)quizzess...
Replace the following in your code var latestLocation: AnyObject = locations[locations.count - 1] with the following. var latestLocation = locations.last as! CLLocation ...
ios,iphone,swift,uialertcontroller
There's no built-in support to add any type of checkbox or toggle to the AlertController. There is a somewhat related question showing a hack for adding a (picker) control to an UIAlertController. You could add a button showing a checkmark/checkbox image, which the user could toggle, but it would be...
ios,iphone,swift,audio,ios-simulator
You just need to move the declaration of your audioPlayer out of your method. Try like this: var audioPlayer:AVAudioPlayer! func playSound() { if let soundURL = NSBundle.mainBundle().URLForResource("doorbell", withExtension: "mp3") { audioPlayer = AVAudioPlayer(contentsOfURL: soundURL, error: nil) audioPlayer.prepareToPlay() audioPlayer.play() } } ...
ios,objective-c,iphone,cocoa,nsdate
The problem is with the way NSLog() and the NSDate description method display the date which is in GMT (UTC). Notice the time offset: "+0000" which is probably not your timezone. All dates are stored internally in GMT. To obtain a string in the current or another time zone use...
Make sure you have added MapKit Framework in your project and try to follow some basic tutorial IOS8 Mapkit tutorial...
ios,objective-c,iphone,ipad,uiinterfaceorientation
Well. I got a fix for that myself. Posting the solution on what to do as it might help others too. Just uncheck the Device Orientation checks (LandscapeLeft and LandscapeRight) in Target->General And write the same piece of code in every controller -(BOOL)shouldAutorotate{ if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) { return YES; } else {...
ios,objective-c,iphone,uilabel
You code is correct but you miss setting the frame that will be occupied by the CAGradientLayer.. And take note that you need to use color with alpha value, to avoid occurrence of black color.. ex: [UIColor colorWithRed:0 green:0.5 blue:1 alpha:0] or [[UIColor YourColor] colorWithAlphaComponent:0] instead of [UIColor clearColor] And...
objective-c,iphone,sprite-kit,skspritenode
Here are some observations: You your code inside of a loop which only runs once. Why are you doing that? If you are creating an object, in your case a SKSpriteNode, and want to delete it later on, you will need to keep some kind of reference to it. There...
ios,objective-c,iphone,uialertview
You cannot change/alter apples default UIAlertView. Instead use custom view and mimic and behavior of it, and you might want to add YourCustomAlertView to like: CustomAlert.h @interface CustomAlert : NSObject + (void)alertShow; + (void)alertHide; @end CustomAlert.m @implementation CustomAlert + (void)alertShow { UIWindow *window = [UIApplication sharedApplication].keyWindow; UIView *existingView = [window...
You can do like as follows : @IBOutlet var lblStep: UILabel! @IBAction func stepPressed(sender: UIStepper) { lblStep.text = sender.value.description } else you have to convert AnyObject to UIStepper like as var stepControl : UIStepper = sender as! UIStepper as like : @IBAction func StepperTap(sender: AnyObject) { var stepControl : UIStepper...
ios,objective-c,iphone,facebook
try this one : FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login logOut]; ...
try this code self.view.addConstraint(NSLayoutConstraint(item: infoButton, attribute: NSLayoutAttribute.Leading, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Leading, multiplier: 1.0, constant: 0.0)) self.view.addConstraint(NSLayoutConstraint(item: infoButton, attribute: NSLayoutAttribute.Trailing, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Trailing, multiplier: 1.0, constant: 0.0)) self.view.addConstraint(NSLayoutConstraint(item: infoButton, attribute:...
- (BOOL) textFieldShouldEndEditing:(UITextField *)textField { if (textField == self.txt_Name) { if(txt_Name.text.length>0) { NSCharacterSet *s = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]; s = [s invertedSet]; NSString *str1 = txt_Name.text; NSRange r = [str1 rangeOfCharacterFromSet:s]; if (r.location != NSNotFound) { NSLog(@"the string contains illegal characters"); txt_nameOFInfo.hidden =false; [img_name setImage:[UIImage imageNamed:@"redot.png"]]; } else {...
ios,iphone,swift,core-location
CLPlacemark has a ISOcountryCode property which returns the country code conforming to the ISO 3166-1 alpha 2 standard.
Please try below code - - (NSString *)HTMLString { NSDictionary * const exportParams = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; letterString = [letterString stringByReplacingOccurrencesOfString:@"\u2022" withString:@"•"]; NSAttributedString *attributed = [[NSAttributedString alloc] initWithString:letterString]; NSData *htmlData = [attributed dataFromRange:NSMakeRange(0, attributed.length) documentAttributes:exportParams error:nil]; return [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding]; } ...
ios,objective-c,iphone,avaudioplayer
I'm not sure if I'm interpreting your code correctly, but it looks like you might be instantiating your player every frame with would explain the slowness. You need to set your player up ahead of time. Then on your timer, call updateMeters right before you get averagePowerForChannel. I'm not familiar...
ios,objective-c,iphone,swift,parse.com
I suggest to implement a simple beforeSave trigger, on Parse Cloud code, in order to check if the new entry song already exist (basically you're going to make one or more field uniques. For example: Parse.Cloud.beforeSave("Musics", function(request, response) { var newEntrySong = request.object; var querySongs = new Parse.Query("Musics"); querySongs.equalTo("title", newEntrySong.get("title"));...
ios,iphone,xcode,swift,uiimageview
Another good option is you can save your Image into Document Directory of your app and you can retrieve that image from anywhere like shown in below code: func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { self.dismissViewControllerAnimated(true, completion: nil) let tempImage = info[UIImagePickerControllerOriginalImage] as! UIImage // save your image...
You have to allow all orientations in the project settings, then only orientations allowed are Portrait or Upside down portrait in your viewController except the GameViewController: // BaseViewController override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { if UIDevice.currentDevice().userInterfaceIdiom == .Phone { return UIInterfaceOrientationMask.Portrait.rawValue | UIInterfaceOrientationMask.PortraitUpsideDown.rawValue } else { return .All } }...
Yes, you need to install Xcode 7 in order to develop for iOS 9. You are able to keep Xcode 6 running alongside Xcode 7.
I guess auto-play feature is not supported in iOS. Check this Apple documentation: User Control of Downloads Over Cellular Networks In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. Here...
I just read the app description you are referring, and I don't think intercept could be the right word to use. You will need to read more about Terms of Service from SnapShat and probably try to read if they provide any official api so you can use it. What...
ios,iphone,xcode,storyboard,autolayout
Just give top, left , right, height and equal width constraints to all label.... ...
ios,iphone,cbcentralmanager,ios-bluetooth,cbperipheralmanager
Save the discovered CBPeripheral instance. var activePeripheral: CBPeripheral! Or adding it into an array. If you are discovering more than one peripherals. var knownPeripherals = [CBPeripheral]() This way you can reconnect to whichever CBPeripheral you need (if it is available, obviously). This delegate method is invoked when a peripheral is...
First you need to detect that the database is the old one. One way of doing that is to have a metadata table with name/value text columns (value is a reserved word, so use a different column name) and keep the current schemaVersion in there. If this doesn't exist then...
Found a hack !! :( you should write this line before setting up the text, [btnTermOfUse titleLabel].numberOfLines = 0; This will show you the line on device too....
Usage: Create a property (or any other variable to hold the VideoTranscoder) self.videoTranscoder = [SCVideoTranscoder new]; self.videoTranscoder.asset = PUT_UR_AVASSET_HERE; self.videoTranscoder.outputURL = PUT_A_FILE_URL_HERE; __weak typeof(self) weakSelf = self; self.videoTranscoder.completionBlock = ^(BOOL success){ //PUT YOUR CODE HERE WHEN THE TRANSCODING IS DONE... }; [self.videoTranscoder start]; You can cancel the transcoding process, if...
Yes, this is possible using CloudKit. You'll need a CKContainer, and you'll ask it to fetch the user record ID. That record ID is unique for your apps, but is also stable for that user this means the same iCloud account will have the same record ID, regardless of which...
javascript,ios,iphone,javascript-events,jquery-hover
To emulate the hover you simply add an event listener to the element you want to have a hover event, you can use touchstart and touchend events instead of using hover if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { $(".menu li a").bind('touchstart', function(){ console.log("touch started"); }); $(".menu li a").bind('touchend', function(){ console.log("touch ended");...
javascript,jquery,ios,iphone,ipad
Mobile Safari doesn't allow for the play() method on a <video> to be called unless it's triggered by a MouseEvent. Since the SproutVideo player API uses Window.postMessage() to communicate with the player iframe, the MouseEvent is lost and Safari will not allow the play() function to be called. This is...
Try the below code: You have not assigned any value to firstLineHeadIndent property, that's why it is not working. NSMutableParagraphStyle *paragraphStyles = [[NSMutableParagraphStyle alloc] init]; paragraphStyles.alignment = NSTextAlignmentJustified; //justified text paragraphStyles.firstLineHeadIndent = 1.0; //must have a value to make it work NSDictionary *attributes = @{NSParagraphStyleAttributeName: paragraphStyles}; NSAttributedString *attributedString = [[NSAttributedString...
ios,objective-c,iphone,cgimageref
Actually, you should ask Core Foundation authors about it =) CGImage is a C-struct. It means, that it is being copied each time passed as a parameter or return value. Or, even, being assigned to some variable. I imagine that something like CGImage is reeeeealy large thing. So, simply passing...
create a subclass of UITabBarController set this custom class of your TabBarController now you override UITabBarController ViewDidLoad Method there you can access all the TabItems and change their text/images before a ViewController get loaded. class CustomTabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() let allItems:[AnyObject] = self.tabBar.items! var item1:UITabBarItem...
You can do it using NSCalendar method dateBySettingHour as follow: let df = NSDateFormatter() df.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z" if let dateFromString = df.dateFromString("2015-06-11T00:00:00.000Z") { let hour = 4 if let dateFromStringWithTime = NSCalendar.currentCalendar().dateBySettingHour(4, minute: 0, second: 0, ofDate: dateFromString, options: nil) { let df = NSDateFormatter() df.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z" let resultString...
Your design view represents only one possible size, if looks good there it doesn't mean it will look good on all sizes. You say you have 2 options to make your content adapt to different sizes Use autolayout constraints Use autoresizingmask Both of them can be set on interface builder...
ios,iphone,swift,uialertcontroller
In viewDidLoad your view has not been displayed yet. Move the call to rate it me from viewDidLoad to viewDidAppear. EDIT Since it's a rate me. I think better it's put in appDelegate in applicationDidFinishLaunchWithOptions. ...
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...
ios,objective-c,iphone,xcode,uiimagepickercontroller
Please use the following code to select video from iOS gallery UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; videoPicker.mediaTypes =[UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4];...
ios,objective-c,iphone,objective
understand the autoresize concept , the following image is the description that how to we use the autoresizing on Left, right , top and bottom. So, I used to think according to this snapshot: Scenario 1: (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight) // it automatically set the width, height, left and bottom: Scenario...
ios,iphone,swift,nsmutablearray,nsuserdefaults
Of course you can have not more than two objects because your spArr is declared locally and it means that you create a new spArr object each time you call appendArrays. You need to create it var spArr: NSMutableArray = NSMutableArray() outside the function and instead of doing: spArr =...
You have a size class enabled (note the blue bar across the center-bottomish). My guess is that all those views are missing in that size class. Click the bar, turn it back to Any x Any.
ios,iphone,swift,ios8,optional
It looks like you aren't giving the CLLocationManager enough time to update the location. I looked at the documentation, and in the statement locationManager.location.coordinate.latitude, location is the only one that's an optional. It's implicitly unwrapped, so that's why you don't need an ! after it. In the printCurrentCoordinates method, you...