Data dodania Pytanie
2017-06-16 19:06 Swift 4 JSON Decodable simplest way to decode type change »
With swift4's Codable protocol there's a great level of under the hood date and data conversion strategies. Given the JSON: { "name": "Bob", ...
(3) odpowiedzi
2017-06-16 16:06 Swift regex for checking if string has at least one uppercase letter »
I have tried several things like: ^(?=.*?[A-Z]) ^(?=.*?[A-Z])$ ^(.*?[A-Z])$ nothing works static func atLeastOneUpperCase(_ input: String) -> B...
(3) odpowiedzi
2017-06-16 02:06 How best to manage an array of optionals in Swift? »
I'm looking to manage an array of optionals and to achieve the following behavior: Initialize with nil to some constant size (going to use generic ty...
(1) odpowiedzi
2017-06-15 20:06 Swift: Functions called in the wrong order? »
So, I've been working on a Weather App with the following brief Data Model class CurrentWeather { private var _cityName: String! private var ...
(2) odpowiedzi
2017-06-15 14:06 When change root view controller, initial view controller is displaying for one or half second »
In the app FIRSTViewController is initial View Controller set from storyboard. Login, Register, etc option available there. Login screen is presented ...
(1) odpowiedzi
2017-06-15 13:06 How to call a generic function with parameter of associated type in Swift 3 »
Here's my sample code: protocol P { } protocol B { associatedtype ID: P } class MyClass: B { enum ID: P { case one case two } } f...
(2) odpowiedzi
2017-06-15 08:06 How to animate scrambling letters on its position in Swift? »
I wanted to create animation in which random letters scramble at its position and stops at a specific letter. Can this be achieved using UIView.animat...
(1) odpowiedzi
2017-06-15 08:06 Thread1:EXC_BAD_INSTRACTION »
I got an error Thread1:EXC_BAD_INSTRACTION. I am making Swift app and I wanna make a system in my app which upload a image to my Django server. When I...
(2) odpowiedzi
2017-06-14 17:06 How to decode a nested JSON struct with Swift Decodable protocol? »
Here is my JSON { "id": 1, "user": { "user_name": "Tester", "real_info": { "full_name":"Jon Doe" } },...
(2) odpowiedzi
2017-06-14 13:06 How to create up/down swipeable UITableView? »
I have a UITableView in the bottom of UIViewController and tableview height is 100 point now. The tableview has 20 cells and tableview's header vie...
(4) odpowiedzi
2017-06-14 08:06 Google SignIn not responding on click »
I created a google signIn button programmatically in viewDidLoad() method of my ViewController, but it does nothing when I click on that button. If I ...
(0) odpowiedzi
2017-06-14 04:06 How to autolayout ImageView inside CollectionView so that cell to edge has same spacing as inner cells spacing? »
I created UIImageView inside CollectionViewCell. I wanted for the layout to have the same spacing between the left most cell to left edge as spacing b...
(1) odpowiedzi
2017-06-13 11:06 Landscape view controller presented from portrait view controller occasionally appears in portrait orientation with landscape bounds »
I have a simple app in which a portrait UINavigationController presents a landscape UINavigationController. Usually it works fine. Sometimes though, t...
(0) odpowiedzi
2017-06-13 08:06 What is difference between Any , Hashable , AnyHashable in Swift 3? »
I scratch my head through lots of tutorial to understand difference between above 3 terms and find new term type erased container, now it become confu...
(1) odpowiedzi
2017-06-13 03:06 Swift: Load level class by integer »
I'm making a Swift game with a lot of levels. Each level is in a file with sequential names: Level1.swift Level2.swift Level3.swift ... And each fi...
(2) odpowiedzi
2017-06-13 00:06 Swift: Labels not showing up »
I am trying to make labels defined by an array in Swift but when I try to do this and I run the app, they just don't show up. My code for the view con...
(1) odpowiedzi
2017-06-12 17:06 Cast object to Class stored in variable »
Is it possible to store a class type in a variable and later use that variable to cast an object to that class type? I seem to be able to store the c...
(1) odpowiedzi
2017-06-12 10:06 How to update each custom tableview cell data at the same time? »
I am using Xcode 8.2.1 with Swift3.I have one custom tableview cell containing UITextView.When I type the data to textView the custom cell automatical...
(4) odpowiedzi
2017-06-12 06:06 How to replace the first occurence in Swift? »
How can I use the replacingOccurrences with regex and only replace the first occurrence? Example var str = "= 1 = 2 = 3" str = str.replacingOccurre...
(2) odpowiedzi
2017-06-11 22:06 How does the view update the viewcontroller? »
I learned Swift from the CS193P class. It recommends the following API for a ViewController FaceViewController to update its view FaceView: var expre...
(2) odpowiedzi
2017-06-11 16:06 Swift 4 Cannot invoke 'index' with an argument list of type »
I have a problem with calling the array method index(of:). MyClass inherits from UIViewController and conforms to the MyDelegate protocol. //self.vie...
(1) odpowiedzi
2017-06-11 13:06 Converting mutable struct to immutable in Swift »
I've searched a lot, read up on functional programming, and can't seem to find a straightforward answer to my problem. I'm creating a game utility lib...
(1) odpowiedzi
2017-06-11 13:06 Next Button like Navigation's Back Button »
I want to display Next Button just like Back Button but the rightBarButton does not touch to end of the screen like the back barButton. let b...
(1) odpowiedzi
2017-06-10 21:06 Change the color of all nodes in a scene? »
So this may seem like a stupid question; however, I'll see if anyone has an answer. Is there any way to change the color of all nodes in a scene in ...
(1) odpowiedzi
2017-06-10 16:06 Get notified of HLS segment requests in Swift »
I am writing an iOS app in Swift for HLS live streaming. I want my app logic to be notified when each HLS segment request is initiated during playback...
(1) odpowiedzi
2017-06-10 15:06 Capture image with GPUImage filter on Swift »
I'm using GPUImage Framework for Image filters. I have applied the ToonFilter() on camera for cartoon filter effect. My issue is while capture image...
(0) odpowiedzi
2017-06-10 01:06 Most optimal method of implementing tappable shapes? »
I'm building an app that provides an editable canvas similarly to photoshop or illustrator (currently using SpriteKit). I'm encountering some performa...
(1) odpowiedzi
2017-06-09 22:06 Why would an empty NSMutableData be optional? »
I'm converting a project from Objective-C to Swift. In it, there is a NSMutableData object that was originally instantiated like this: NSMutableData...
(2) odpowiedzi
2017-06-09 22:06 PhotoPicker discovery error: Error Domain=PlugInKit Code=13 »
I'm trying to display an image from the photo library in a UIImageView The full error is: 2017-06-09 21:55:59.063307+0200 firstapp2.0[12873:11207...
(1) odpowiedzi
2017-06-09 17:06 How to convert a UIImage to a CVPixelBuffer »
Apple's new CoreML framework has a prediction function that takes a CVPixelBuffer. In order to classify a UIImage a conversion must be made between th...
(1) odpowiedzi
2017-06-09 04:06 iOS - Load cells one by one »
I want to load the cell of a collection view one by one using the API collectionView.insertItems(at:). There are many answers online which accomplish ...
(2) odpowiedzi
2017-06-09 01:06 Is there any risk upgrading to Xcode 9 while working on projects to be released soon? »
I'm currently working on an app that is soon to be released. This would tend to push me to wait before upgrading to Xcode 9 beta just to make sure my ...
(1) odpowiedzi
2017-06-08 17:06 Thread 1: signal SIGABRT AppDelegate.swift »
I tried to compile my first iOS Hello app. I have ViewController.swift // // ViewController.swift // My First Project import UIKit class ViewC...
(3) odpowiedzi
2017-06-08 13:06 iOS - Today extension widget cleared over time »
Situation as it should be We have a today widget that shows a maximum of 6 buttons depending on data set in the corresponding app. This data is sha...
(0) odpowiedzi
2017-06-08 12:06 Expanding the cell based on the web-content same like Skype iOS application »
I have a requirement where I need to create the UI same like Skype iOS application for display the web-content. For that I used the UICollectionView...
(0) odpowiedzi