[Solved] How can I parse each items into it’s on uicollection view cell

Please check : OsuHomeController let cellId = “cellId” struct AnimeJsonStuff: Decodable { let data: [AnimeDataArray] } struct AnimeLinks: Codable { var selfStr : String? private enum CodingKeys : String, CodingKey { case selfStr = “self” } } struct AnimeAttributes: Codable { var createdAt : String? var slug : String? let synopsis: String? private enum CodingKeys … Read more

[Solved] How can I parse each items into it’s on uicollection view cell

Introduction Parsing items into individual UICollectionView cells can be a great way to organize and display data in an efficient and visually appealing way. This tutorial will provide step-by-step instructions on how to parse items into individual UICollectionView cells. We will cover topics such as setting up the UICollectionView, creating custom cells, and populating the … Read more

[Solved] Swift enum: “Extraneous ‘.’ in enum ‘case’ declaration” [closed]

Swift enumeration cases are defined as case someName, not case .someName. This is an easy syntax error when declaring a new enum’s cases, as in most other situations you will be typing .someName via dot syntax. But when first declaring that enum case, it’s case someName without the period. enum SomeEnum { case one case … Read more

[Solved] Swift enum: “Extraneous ‘.’ in enum ‘case’ declaration” [closed]

Introduction The Swift programming language is a powerful and versatile language that allows developers to create robust and efficient applications. One of the features of Swift is the ability to create enumerations, or enums, which are used to define a set of related values. However, when declaring an enum case, it is important to be … Read more

[Solved] Upload an image from device to firebase

Well, I don’t know whats going on but, this works for me, Make sure your pods has at least these in there. PODFILE pod ‘Firebase/Storage’ pod ‘Firebase/Auth’ #Auth isn’t needed but, you should really use it. View controller import UIKit import FirebaseStorage class TestView: UIViewController { var imageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() imageView … Read more

[Solved] filter array of json in swift

Considering this is your JSON var myJSON = “”” [{ “status” : “true”, “score” : “3”, “correct” : “3”, “chapter” : “34”, “answer” : “342432”, “solutionText” : “abcd” }, { “status” : “true”, “score” : “0”, “correct” : “2”, “chapter” : “35”, “answer” : “35854”, “solutionText” : “abc” }] “”” Simply create a Decodable struct … Read more

[Solved] Make one view center as buttom of second view in Auto Layout – iOS [closed]

Just constrain the centerY anchor of the greenView to the bottom anchor of the image view: greenView.centerYAnchor.constraint(equalTo: imageView.bottomAnchor).isActive = true greenView.centerXAnchor.constraint(equalTo: imageView.centerXAnchor).isActive = true 1 solved Make one view center as buttom of second view in Auto Layout – iOS [closed]

[Solved] Decode from Base64 format in swift

finally I found solution for my issue am getting exact out put. extension Character { var isAscii: Bool { return unicodeScalars.allSatisfy { $0.isASCII } } } extension RangeReplaceableCollection where Self: StringProtocol { var asciiPrintable: Self { return filter { $0.isAscii } } } class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let base64Encoded = … Read more

[Solved] How to set the position of title of button [closed]

Use this let button = UIButton(type: .roundedRect) button.frame = CGRect(x: 20, y: 20, width: 200, height: 72) button.setTitle(“مرحبا”, for: .normal) button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0) button.contentHorizontalAlignment = .center self.view.addSubview(button) And change the button.titleEdgeInsets as preferred. solved How to set the position of title of button [closed]

[Solved] Swift – UIAlert with image

Try the below code in swift saveAction.setValue(UIImage(named: “name.png”).withRenderingMode(UIImageRenderingMode.alwaysOriginal), forKey: “image”) or try this saveAction.setValue(zdjecieGlowne.withRenderingMode(UIImageRenderingMode.alwaysOriginal), forKey: “image”) 2 solved Swift – UIAlert with image

[Solved] Counting Vowels in Swift [closed]

You could do something like this: extension String { var numberOfVowels: Int { let vowels = “aeiou” let vowelsSet = NSCharacterSet(charactersInString: vowels) let strippedComponents = lowercaseString.componentsSeparatedByCharactersInSet(vowelsSet) let stripped = strippedComponents.joinWithSeparator(“”) return characters.count – stripped.characters.count } } “Hello”.numberOfVowels 5 solved Counting Vowels in Swift [closed]