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

Is there a public API for the UI UI displayed on iOS 10?

The Music app in iOS 10 adopts a new card-like appearance: Now Playing screen slides up, while the view below in the hierarchy zooms out, protruding slightly at the top of the screen. Here is the example from Mail compose window: This metaphor can al

Swift 3: Call the Accounting Steps of the Health Kit

Updated: I am trying to call on a function that accesses the HealthKit and returns the number of steps taken that day. I have created a function and now I am trying to call it. The code for the function is as follows: //Reading data from Health app.

How can I prevent table row highlighting in the next segment?

When I select a table row and click 'Ok' under city tab, it is highlighting the row but when I change the tab to town, it is highlighting the same row in the town tab even though I did not select it.That is if I highlight second and third row under c

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

Testing @IBOutlets and @IBActions @ private

We can make @IBOutlets and @IBAction private. Example: class MyViewController: UIViewController { @IBOutlet private weak var myLabel: UILabel! @IBAction private func nextTapped(sender: UIButton) { // Do something } } We haven't access to this propert

Error in the Beacon project

let region = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: "(the appropriate UUID for my beacons)", identifier: "Estimotes") The above line of code in my project is giving me an error stating: init(UUIDString;)' has been renamed to

How can I hide a section when UISwitch is changed?

Here is my tableView and want to hide the section "eventdays" how can i do that ? Hope you can help me. override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // set data within

The Bar button element is not added

Im facing a problem, i have a viewController that has both navigationController and tabBarController. Whenever in code i try to add a right or left barButtonItem or even to add a title to the navigationBar nothing happens. Is it because of the tab ba

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

Swift-can not present Game Center with SpriteKit

This the code block I'm having trouble with.It gives me error because of 'presentViewController' func authenticateLocalPlayer(){ let localPlayer = GKLocalPlayer.localPlayer() localPlayer.authenticateHandler = {(viewController, error) -> Void in if (v

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

How to use the MKMapViewDelegate methods in the MVVM

In my view controller, there is an outlet to a MKMapView and the view controller naturally conforms to MKMapViewDelegate to perform MapKit operations. I'm trying to migrate to the MVVM model before further progress in the project in order to keep it

Share a link via a URL schema (via Telegram for example)

I want to share a link via URL scheme lets say for Telegram. I have created this: tg://msg?text = The link, opens telegram but nothing else happens. I have used the same code for Viber, and it works: viber://forward?text = www.ex

Swift date formatting with NSDateFormatter

i have a json object that contains a date from database: var showDateRaw = v["feedDate"].description println(showDateRaw) showDateRaw variable's type is String and looks like this way after parsing the json object: 2015-05-10T18:39:55+02:00 i wo

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

Downcasting in Swift with like and like?

What's the difference between these two code snippets: let cell = tableView.dequeueReusableCellWithIdentifier("cellId") as UITableViewCell? // vs let cell = tableView.dequeueReusableCellWithIdentifier("cellId") as? UITableViewCell Isn'

Can not roll Optional.None. I can not understand how or what

I have looked over multiple pages here on Stack Overflow and can't wrap my head around it sadly. Maybe its the heat. Don't know. Anyway, could anyone please help me and explain how to unwrap? It breaks at: self.txt = dict.valueForKey("menuPunkt"