Data dodania Pytanie
2018-02-19 14:02 Swift ISO8601 format to Date »
I have the following string: 20180207T124600Z How can I turn this into a Date object? Here is my current code but it returns nil: let dateString =...
(4) odpowiedzi
2018-02-19 04:02 iOS UIPageViewController Gets Confused and ViewControllers Are Not Displayed »
We have left and right buttons set up for the user to page through different cars quickly. Our Page View Controller loses the view controller if the u...
(2) odpowiedzi
2018-02-19 03:02 Is it safe to force unwrap an optional after checking it is not nil »
I have a network method that return me a completion closure with an Error as the parameter. I usually avoid force unwrapping, but in that case, I use...
(1) odpowiedzi
2018-02-18 12:02 When adding a filter, the photo is stretched »
When adding a filter, the photo is stretched and does not respond to the aspectFit let photoProcess = CIFilter(name: "CIPhotoEffectProcess") ...
(1) odpowiedzi
2018-02-18 11:02 How to load pdf files as URL with my application in in the Open in... menu »
I am implementing an application that I want to open pdf files Which I received from emails in my application. my application is in the list of open i...
(1) odpowiedzi
2018-02-18 10:02 What is the difference between combining array by using reduce or joined? »
Consider the following array -of strings-: let arrayStrings = ["H", "e", "l", "l", "o"] For combining its elements (to get "Hello" as single String...
(2) odpowiedzi
2018-02-18 06:02 How does typecasting/polymorphism work with this nested, closure type in Swift? »
I know that (Int) -> Void can't be typecasted to (Any) -> Void: let intHandler: (Int) -> Void = { i in print(i) } var anyHandler: (Any) ...
(2) odpowiedzi
2018-02-17 19:02 Invite Facebook friends? »
I would like to add a function to let the possibility to users to invite their Facebook friends. My problem is that there is no documentation (https:...
(1) odpowiedzi
2018-02-17 15:02 Why does a property observer run when a member of the existing value is changed? »
Please consider this Swift code. I have a class which wraps an instance of another class. When I set a property on the held value, the wrapper class's...
(4) odpowiedzi
2018-02-17 12:02 how to show user google search engine result in a browser project »
I am implementing a browser with UIWebView with swift for iPhone, iPad. all works fine but the problem is that when users type wrong or not completed ...
(1) odpowiedzi
2018-02-17 11:02 how to make the label proportional to the screen size? »
I am a beginner, I am trying to do an autolayout. I am trying to make the label 'HRIS' and 'Please login to continue' to be proportional to the scre...
(3) odpowiedzi
2018-02-16 14:02 How to implement ktf.image.resize_images in CoreML Custom Layer? »
I am trying to implement a custom layer in CoreML that solves the Lambda layer that performs ktf.image.resize_images function as a custom layer class ...
(0) odpowiedzi
2018-02-16 05:02 Alternate approach to inheritance for Swift structs? »
I'm using structs instead of classes to store data in my iOS app because of the obvious advantage of value vs reference types. However, I'm trying to ...
(1) odpowiedzi
2018-02-16 03:02 Swift Generics, Constraints, and KeyPaths »
I'm aware of the limitations of generics in Swift and why they exist so this is not a question about compiler errors. Rather, I occasionally run into ...
(3) odpowiedzi
2018-02-15 22:02 The app crashes after view is dismissed through navigation controller? »
After the view is dismissed in a navigation controller the app crashes is it possible to reload the cell during a navigation controller unwind. After...
(1) odpowiedzi
2018-02-15 20:02 Are implicitly unwrapped optionals truly optionals? »
In Swift 4.0, the following code doesn't compile: var str: String! func someFunc(_ s: inout String?) {} someFunc(&str) Now I imagine that str i...
(1) odpowiedzi
2018-02-15 14:02 Naming conflict between two classes from my project and a pod »
Is there a way the solve class naming conflicts between two different classes coming from my project and a pod framework ? I think the best solution ...
(1) odpowiedzi
2018-02-15 14:02 Is Facebook SDK Documentation for Swift outdated? What is the corresponding SDK version? »
I am building an iOS app which requires sharing on Facebook. I am using Swift(4) on Xcode(9). So I started using the documentation from the official p...
(1) odpowiedzi
2018-02-15 06:02 Swift flatMap gives unexpected result while using with optional array »
We have an array of the Person objects and each object has another array of String, which is optional. We want the consolidated list of car names in o...
(3) odpowiedzi
2018-02-14 21:02 Why does this switch compile when it's not exhaustive? »
I have this Result enum: public enum Result<T> { case success(T) case failure(Error) } And wanted to implement CustomStringConvertibl...
(1) odpowiedzi
2018-02-14 16:02 how to use HOST_VM_INFO_COUNT in swift file »
I trying to use HOST_VM_INFO_COUNT in my swift file. In objective C it is working. I have tried by importing #import <mach/host_info.h> usin...
(1) odpowiedzi
2018-02-14 14:02 Swift4 unit testing: ViewController not found when type casting »
I am currently writing test on a MyViewController class with the following code: let viewController = UIStoryboard(name: "Main", bundle: Bundle.main)...
(2) odpowiedzi
2018-02-14 07:02 Swift how does my function exceed O(n)? »
I am trying to work on a leetcode problem that asks for Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appe...
(1) odpowiedzi
2018-02-13 16:02 Touch ID Local Authentication produces Thread 12: EXC error »
Currently, I have the following code in place. if localAuthenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &amp...
(1) odpowiedzi
2018-02-13 14:02 Swift Json Encoder with Order »
I am trying to parse my Object into Json using swift's Codable. my class is something like this: struct MyObject : Codable { let rate : String? ...
(0) odpowiedzi
2018-02-13 13:02 Loops in didSet »
We came across this odd behaviour when using loops in a didSet. The idea was that we have a data type with a tree structure and in each element we wan...
(2) odpowiedzi
2018-02-13 13:02 How to test a function/computed property that uses the User's calendar/eventstore? »
I'm developing a calendar app where I'm struggling to create tests for the functions that utilize the calendars on the users device. The calendar: EK...
(0) odpowiedzi
2018-02-13 05:02 Cannot share link to facebook »
I am working with Xcode 9 and Swift 4.0. I need to share a link to Facebook when clicking a button. I have integrated Facebook SDK.I have completed al...
(1) odpowiedzi
2018-02-12 19:02 Empty array can be cast to array of any type »
It seems empty arrays in Swift can be cast to any array type. See the following example: var obj = [Int]() // compiler warns that this cast alway...
(1) odpowiedzi
2018-02-12 15:02 Background Text To Speech on iOS »
I've read many many articles, read many StackOverflow posts and tried different solutions, but I can't get it to work. For an app that communicates w...
(0) odpowiedzi
2018-02-12 12:02 Error: Extra parameter in request i used Swift 4. Why i have to pass parameters of type [String: Any]? »
Alamofire.request(APPURL.GetAccounts, method: .post, parameters: transactionData, encoding: JSONEncoding....
(1) odpowiedzi
2018-02-11 22:02 Confusion about where should put the [unowned self] »
I have a retained cycle so my viewcontroller's deinit won't be called, and I'm trying to resolve this my adding [unowned self], but I'm not too sure w...
(1) odpowiedzi
2018-02-11 20:02 CoreData is setValue(_:forKey:) necessary in Swift? »
When updating an entity in CoreData, is it necessary to use setValue(_:forKey:), or can you just set the value using the default setter? someEntity....
(2) odpowiedzi
2018-02-11 05:02 Can enabling static_framework in podspec break existing apps? »
I'm maintaining a library written in Swift and distributed via CocoaPods. Since version 1.4.0 cocoapods introduced the static_framework=true setting t...
(1) odpowiedzi
2018-02-10 19:02 Using DateFormatter to show future dates instead of past dates in Swift »
I have the following code where input is being sent as 10/01/77 and DateFormatter is converting it into 1977 but the expected year is 2077. How can th...
(1) odpowiedzi