retrieve id and increment it swift3

I have a id whose format is 1223-3939-ABC.1 and I would like to retrieve the last value i.e. 1 and increment it so now it looks like 1223-3939-ABC.2. But its possible that "1" is not there so in that case, I would like to append ".1" I

I need to add a custom tab bar controller in Appdelegate Swift

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtInd

How to add an image to TextView with UIButton

I want to add an ability for a user to add an image to TextView when the button is pressed and the image is selected like it's done in Apple Notes app. I've tried some code, however with no luck... There's an example of how I expect it to look like:

How to manage SWRevealViewController with the button

I tried to implemented the SWRevealViewController to my project, but I want to do it with a button and all documentations I found are for barbuttonitems that have this code: = revealViewController() detailButton.action = #selector

Swift - IOS: UIalertController position

I'm trying to create a custom alertView but i'm facing a problem with the size of the Alert so my question is : how could i know the X position of the left corner and the x position of the right corner ?You can get x position something like, x = self

Exit application using an UIAlertController

If a user opens up the application without an internet connection, a window pops up that says a connection is required, and there is an ok button. I want to the ok button to exit the application. Here is what I have: if !isConnectedToNetwork(){ let a

Change iPhone tone color from an application

Recently, I have installed Twilight on my Android phone. Apparently is adds a color tone effect on the screen. Here are two screen shots taken from PlayStore. Now my question is that is there a way to develop similar system display tone color set up

Draw the VU counter using Core Graphics in iOS

I'm trying to draw a somewhat similar image to this, using Core Graphics: I was able to draw the main arc, but I am not able to understand, how to divide arc into parts/draw graduation on arc? My current code to draw the arc is: [path addArcWithCente

How to modify a button in the cell by clicking on swift ios?

I have a table layout inside a view which as a custom cell,The problem I'm facing is that the cells inside has a button i want to hide the button in cell on clicking it(only the one that is clicked should be hidden) how can i do thing in correct meth

New FBSDK 4.0+, log in or share using an access token

I am using new FBSDK. Able to get access token generated by FBSDK using [[FBSDKAccessToken currentAccessToken]tokenString] How can I use this to share or post without prompting user to login again? Scenario : User Logs in via Facebook, access token g

How do I view a UIPageViewController that has no data?

I'm using a UIPageViewController as a way to swipe through the photos in a photo library. It works when photos exist, but crashes if no photos exist on the phone. The errors: 2015-04-19 16:27:05.305 MyApp[2566:1278254] *** Assertion failure in -[MyPa

Keyboard notification

I am trying to get a keyboard size from userInfo using keyboard extension. I add NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardDidShowNotification, object: nil) inside my KeyboardViewContro

Incorporating an Iframe into an Image

I have a web page in which I have an iframe which plays various youtube videos. Now I want this iframe to be display inside an image (The image is basically an iPad Image and I want that the iframe should be embedded inside the screen area of the iPa

What do we actually do with the property in the code?

First of all I am very new in Objective C and iOS development. Currently I am trying to use TableView I have property @property (strong, nonatomic) IBOutlet UITableView *tableView;//for table view Now I seen something like this, -(NSInteger)tableView

UIActivityViewController in iOS 7 missing options

I was using the following code with iOS 6 SDK to implement UIActivityViewController: -(IBAction)Share:(id)sender { NSArray *activityItems = @[self.title, urlString]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithAct

Creating a pop out menu without a navigation bar

I'm trying to create a pop out menu in my app just like the facebook app uses. I found this really good tutorial and got it working in their example. In their example, they use a nav bar

parse xml in UITableView

I have an XML file on my server and I need to parse it into my iOS app and then I need to put it into a UITableView. My XML looks like this: <plan> <action> <id>1</id> <name>item 1</name> </action> <action>

UIDocumentInteractionController and File from Web

I want to open file from the web in other apps. My code: NSURLRequest *req = [[NSURLRequest alloc] initWithURL:url]; [NSURLConnection sendAsynchronousRequest:req queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *resp, NSData *resp

How to add UIImage in MKMapView in iPhone?

I want to add a UIImage in MKMapview. i.e.: One a particular location, I want to add an image called "apple.jpg". I don't know how to do that. As I have already added a draggable pin as an annotation. But I don't know if I can add multiple image

What grateful gesture does the Photo application use?

What gesture recogniser should I use if I want to the user to swipe between 2 UIView's in the same way they swipe between photos in the Photo app? No the zooming just the transition between 2 photos. Should I use the swipe or the pan gesture? I am al

How do I know if a float has a decimal point?

I'm building a simple calculator for a classroom, this is the code to show the result: - (void)doTheMathForPlus:(float)val { float conto = self.contBox + val; self.myDisplay.text = [NSString stringWithFormat:@"%.02f", conto]; } I need to know if

Writing files with std on iOS

i added a save.txt to my iPhone resource in xCode, with a same text "..." i write some strings to the file, and than read it, but when i read it, i only get the old content.. so there is nothing new written into it NSString* resources = [ [ NSBu

Problem Cocos2d shake / accelerometer

So I a little backstory. I wanted to implement a particle effect and sound effect that both last about 3 sec or so when the user shakes their iDevice. But first issue arrived when the build in UIEvent for shakes refused to work. So I took the advice