Posts

Showing posts with the label learn ios

Swift 5 Quick Learning Tutorials with Snippets

Swift 5 key feature : 1.ABI Stability: Swift is now stable language. 2.Result<Success, Failure: Error>: remove 2 callback(success and failure) for API calling. 3.Handling Future Enum Cases: @unknown default 4.Filter And Count With “count(where:)” 5.Integer Multiples With “isMultiple(of:)” 6.Remove nil from Dictionaries “compactMapValues()” . --------------- --------------- --------------- --------------- --------------- --------------- ----- Swift 5 - Integer Multiples With “isMultiple(of:)” Swift 4 Syntax let result = 5 % 2 == 0 print(result) // Output: false Swift 5 Syntax let number = 42 if number.isMultiple(of: 2) { print("\(number) is even!") } --------------- --------------- --------------- --------------- --------------- --------------- -----

UICollectionView Swift Example Programmatically [Git Project]

Image
Lets Create UICollectionView Working project GitHub link:  https://github.com/shaunak-jagtap/UICollectionView There’s a lot of tutorials about how to create a  UICollectionView  using storyboards or just nib files. I don’t like Interface Builder and prefer to do everything in code. Most of the time it’s easier, it creates less bugs, so in this tutorial we will create  UICollectionView  programmatically. UICollectionView  is highly customizable class for presenting your content in almost any layout you want. It implements in a similar way to  UITableView  — using  UICollectionViewDataSource  and  UICollectionViewDelegate  protocols. Let’s take a look at how to do it using Swift. Create an Xcode project. Unfortunately, Xcode 9 doesn’t allow us to choose an empty project with only an App Delegate, so we’ll choose one close to it. Select   Single View Application  and click  Next . Name your project as you ...