Questions tagged as 'swift'

4
answers

Switch / case very interesting in Swift - What other languages support this?

The Swift language has a very interesting and intuitive way to work with switch-case breaks, with partial-matching, pattern-matching, etc. techniques, see these examples: let age = 33 switch(age){ case let x where x >= 0 && x <=...
asked by 30.06.2016 / 02:44
1
answer

Type Int8 in Swift does not store the maximum integer 255

Doing some play on the Playground, With Swift 2.2 we can declare constant let testeIntOitoBits: Int8 = 127 //maximo - deveria ser 255 let testeIntOitoBits2: UInt8 = 255 Why can not I store 255 in type Int8 and in type UInt8 yes?     
asked by 18.06.2016 / 01:36
1
answer

IOS - how to make the app screen always lit?

I'm making an app for IOS that I already have ready on Android, I wanted to make a method that would leave the screen always on, but I'm not able to On Android I did it this way: MainActivity: PowerManager pm = (PowerManager) getSystemSe...
asked by 01.02.2016 / 12:58
2
answers

Conversion from the project's Alamofire to swift 3.0

I have the following code when I want to make a call to the server: let mutableURLRequest = NSMutableURLRequest(url: URL) mutableURLRequest.httpMethod = "POST" let parameters = ["SessionID": sessionID] do { mutableURLRequest....
asked by 10.10.2016 / 18:48
1
answer

How to get SHA1 from a String in Swift?

I know that the SHA1 object exists but I'm still learning the syntax, so, my beginner question is, given a simple string: var greeting = "Hello!" How to get SHA1 from greeting to Swift ?     
asked by 27.07.2014 / 14:21
1
answer

What is the difference between viewDidLoad and awakeFromNib?

What is the main difference between viewDidLoad and awakeFromNib in Swift development for iOS?     
asked by 03.11.2017 / 14:31
2
answers

Swift 3 / Xcode 8 - How to change the native language of my App?

I'm finalizing an application and I could not help noticing that some components of my app are in English: How to change the native language of the app? How to make it change automatically according to the language of my device?    ...
asked by 17.03.2017 / 23:08
2
answers

IOS - How to edit a view's scale by Swift?

I have a viewview viewV and would like to change your Width and Height shown in the image below via Swift code.     
asked by 29.03.2016 / 14:32
1
answer

Save latitude and longitude in swift

I have this code in my ViewController to capture the users current location: @IBOutlet weak var userMapView: MKMapView! var locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationManager = CLL...
asked by 12.09.2016 / 19:30
3
answers

Rotation on certain screens

How do I set only a UIViewController to be enabled in rotation? The scenario is as follows:    I have 5 screens, and in all of them I should only enable the mode   portrait. But I have a sixth screen, and it must be enabled   the la...
asked by 16.12.2014 / 17:27