Implement Infinite Scroll or Pagination in #ios #uitableview using #swift 5
Infinite scroll is one of the basic requirements of the modern apps. It is a design pattern where content is continually loaded into the interface as the user scrolls downwards. Also called endless scroll, the point is that the user never reaches the end of the page. Instead they are presented with a perpetual content stream without having to click or spend cognitive load on paginated navigation.Sound familiar? It should do. Most people use infinite scroll on the daily in their social media browsing — think Facebook, Instagram or Twitter.Advantages of using Infinite ScrollInfinite scrolling definitely has its upsides; if it didn’t, big tech giants wouldn’t be using the pattern. For example:Users consume vastly more content on an infinite scroll page.Interaction costs are basically zero, and (...)
Creating A Photo Gallery in #swift Using #firebase & INSPhotoGallery
I am currently building a travel app called i-Travel Journal and one of the functionalities that I wanted to add was the ability to allow users to upload and delete photos from a gallery. I was searching the internet for a blog post that not only used Firebase on the back-end, but also used the awesome INSPhotoGallery Pods Framework to get the job done, but to my dismay I could not find one that showed all the intricate details. Therefore, to help my fellow coder, I decided to put out a post to help someone get their photo gallery up and running.To keep this blog post short, I will provide links to the Firebase Documentation to help you get started, if you do not have it already integrated into your application.Firebase SDK iOS get startedFirebase Realtime Database get started1. First (...)
Part 2: Apache OpenWhisk and IBM CloudYou’d Think I’d Worry About Baking Bread…Recall from Part 1 of this post — Serverless Computing with Swift: Swift and AWS Lambda — that I have decided to form a startup, It’s The Yeast I Can Do, an online bakery specializing in gourmet bread. My CLO (Chief Leavening Officer) is willing to go along with my prioritizing cloud infrastructure over actually baking product. But she’s concerned that we haven’t fully explored our options. In this article, I’ll re-write the code from Part 1 to run under Apache OpenWhisk.OpenWhisk is an open source platform for serverless computing. You can host it on your own servers, with or without containers (such as Docker). You can even run it on AWS. For this article, I will use IBM Cloud, the cloud services infrastructure formerly (...)
The Only Time You Should Use for iOS App Development is #swift — Here’s Why
The Only Time You Should Use Swift for iOS App Development is ALL THE TIME— Here’s Why!Old programming languages don’t die quickly, but the companies that cling on using them do.Whether you’re a startup, mobile app development agency or just an individual developer, if you’ve not investigated Swift yet, you should.The reason is because Swift not only has the potential to develop responsive, feature-rich iOS apps for years to come, but it has also already taken over Objective-C.A study by Upwork also revealed that Swift is one of the fastest growing skills for freelance developers, app development shops, and startups.In fact, Swift is already being used by tech giants including Hubspot, Lyft, Asana, Pandora, and 1,120 more companies.Thanks to several key features & benefits (which we will (...)
How to create a list in #ios App?
A beginners guide to UICollectionViewIntroduction of UICollectionViewUICollectionView is a part of UIKit Framework which enables you to add list view in your iOS App. This is highly flexible to meet your custom requirements. You can show list in any fashion i.e. Horizontal columns, Vertical rows, and grid etc.In this tutorial, we are going to see how we can add a list to ViewController programmatically (We will not use storyboards).Project setupCreate a new XCode Project. XCode prepares the project and opens the General TabXcode project initial setupSince we are not going to use Storyboards , we need to do some basic operations.Delete Main.storyboard (from project folder)Delete LaunchScreen.storyboard (from project folder)Clear Main Interface field in Deployment Info section of General (...)
#swift 5.0: What’s new, what’s changed, what’s missing, and what’s next?
It’s more than a month from final branching of swift 5, we should expect it soon as it was announced to be released early this year. Some say that it will come later in April because the same methodology was used for Swift 4.2; the final branching for it was April 20, 2018, and it was released September 17, 2018.Anyhow, we are eagerly waiting for swift 5.0 as it will allow us to develop apps in a beautiful manner.The improving swiftABI StabilityOne of the top priorities for Swift right now is compatibility across future Swift versions. One major component of this is ABI stability, which enables binary compatibility between applications and libraries compiled with different versions of Swift.If Swift becomes ABI Stable, Swift will live within the #ios Operating System and it’s ABI will be (...)
#swift Multi-Threading using GCD For Beginners.
Introduction: What is Grand Central Dispatch (GCD)According to Apple:“GCD provides and manages FIFO queues to which your application can submit tasks in the form of block objects. Work submitted to dispatch queues are executed on a pool of threads fully managed by the system. No guarantee is made as to the thread on which a task executes.”In other words, GCD is an API provided by apple to allow you to manage concurrent operations in a smooth way, in order to avoid freezing of your application and keep it always responsive for users.Types of Queues:When dealing with GCD, there are 3 types of queues:1- The Main Queue:This Queue has the highest priority of all , and it runs on the main thread.All UI updates should be done on this thread or otherwise lagging and weird crashes will occur in your (...)
#swift: Avoiding Memory Leaks by Examples
▻https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Art/memory_management_2x.pngIn Swift Automatic Reference Counting (ARC) is used to manage memory usage in an #ios application.Each time you create a new instance of a class #arc allocates a chunk of memory to store information about it, and automatically frees this memory when that instance is no longer in need.You as a developer don’t need to do anything for that management , except for 3 cases were you need to tell ARC more information about relations between instances to avoid “Retain Cycles”.In this article we will walk together in the process of managing these 3 cases , and see real examples of retain cycles and how to get rid of them. But first, what are retain cycles and why we need to avoid (...)
Google Maps sucks for cyclists
But it doesn’t need to stay that way.Don’t get me wrong, I love Google Maps. Its a borderline miraculous service that has given me superb driving directions, public transport timetables, and walking routes. All over the world. For free.However, when I tried to get #cycling directions to a store a short distance across town I encountered some issues. I plugged in my headphones, put away my phone, and was promptly directed to take a left onto a four lane highway.Never mind that Maps’ network of cycle lanes are a disjointed nightmareThe root of the issues is that Maps treats cyclists like cars that have a few extra roads, rather than a distinct mode of transport. The key differences that Maps ignores are:Cyclists tend to be more discerning about which roads they take, sticking in their own (...)
How Plato Delivers Mobile News Feed Content using a Headless CMS
Plato’s mission is to bring people together through meaningful & social games. Plato combines chat & games seamlessly, as the first messenger built from the ground up to support full multiplayer games. With a team comprised of Yahoo! and gaming veterans, plus backing from WhatsApp, Plato is available now on iOS & Android.Plato had a home-built CMS that, between operational costs and the engineering salaries to maintain it, was costing far too much. The team decided to replace their internal system with Cosmic JS to allow their developers to build new content models when they need to while empowering editors to manage content without bottlenecking the development team.Plato’s new tech stack is #golang-based and hosted on AWS. Plato’s mobile clients, written in #swift and #kotlin, (...)
In this article I’m going to introduce MVVM design pattern in iOS programming and of course with RxSwift.This article divides into two parts. In part 1 design pattern explained briefly and basics of RxSwift, and in part 2 , we have an example project of MVVM with RxSwift.Design patterns:At first ,It’s better to explain why we should use design patterns? In short: In order to avoid our code getting spaghetti ? and of course this is not the only reason. One of the reasons is testability . There are bunch of design patterns and we can point some of the popular ones to MVC,MVVM,MVP and VIPER. There is a good picture from NSLondon slides that compare design pattern to Distribution,Testability and Ease of use.Compare of design patterns ( from NSLondon )All of these design patterns have its own (...)
Wanna know how I got these scars? I’ve tried to publish to the app store.
Everyone knows that a successful product launch consists of many pieces. Development, design, marketing, promotion, custdev are just parts of it. But all this might be useless if you do not follow the guidelines. Here I will talk about my first experience with indie development and why my application will not see any users.I’ve been developing applications for about five years. So this is not my first application. However, it is the first one which I’ve done from idea to implementation.Why did I decide to make an app? The answer is simple, I wanted to remember code skills and check my product skills at the same time. Last year I did not write code at all but was managing people as a product manager. I thought I would never code again because it is too boring. But two months ago I (...)
Creating Custom Operators in #swift ☕
Create clear, concise, and occasionally entertaining code using custom operators.When I first came across Swift code that contained custom operators I immediately dismissed them as just another one of those advanced language features that the average tinkerer like myself would never have a need for. However, after I ended up using them as a very basic package example in an earlier post, I’ve decided that in addition to being convenient they can also make your code more readable, even when using non-standard operators.What are Operators?Taken straight from Wikipedia:(Operators are) constructs which behave generally like functions, but which differ syntactically or semantically from usual functions.If you’ve done any #programming you’ve used operators. You’re probably familiar with the (...)
A basic understanding of Swift and Node.js is needed to follow this tutorial.One of the most common elements on applications (web or otherwise) is counters. YouTube, for instance, uses counters to see how many people have viewed a particular video. Facebook also does the same for videos on their platform.Most of the counters on these sites, however, only update the count when you have refreshed the page. This leaves a lot to be desired, as sometimes you just want to see the number increase in realtime. This gives you the impression that the item is being viewed by many people at the moment.In this article, we are going to explore how we can leverage the realtime nature of #pusher to create a counter that updates in realtime. We will be creating a video viewer #ios application with a (...)
Creating awesome animations in iOS apps with Lottie
Nowadays, high-quality software consists of many factors like:MaintainabilityEfficiencyScalabilitySecurityUsabilityIn this story, I would like to focus on the last factor which is Usability. Let’s start with a definition, what is usability?Usability is the degree of ease with which products such as software and Web applications can be used to achieve required goals effectively and efficiently. Usability assesses the level of difficulty involved in using a user interface. (Retrieved from Techopedia)I strongly believe that a good UI/UX is a must-have in the modern software. No matter what kind of software you are developing, good design helps to attract users, to keep users using your app, to distinguish it from its competitors. It does not really matter what platform you are developing (...)
Making plans for a new world order
L’#Allemagne exhorte à la création d’un système de paiement international indépendant du #dollar
Maas est en faveur de la mise en place d’un système de paiement mondial indépendant du dollar. Cela permettrait à l’#Europe de continuer à faire des affaires avec l’Iran. « Nous ne devons pas simplement accepter que Washington prenne des décisions sans nous consulter, à nos frais », écrit Maas (à droite de la photo, à côté de Merkel).
Maas réagit à la décision unilatérale des #États-Unis d’exclure l’Iran de la communauté internationale à partir du 4 novembre, en coupant le pays du réseau #SWIFT, qui relie plus de 11 000 banques à travers le monde et permet aux pays d’effectuer des paiements à l’étranger.
Routing in Clean #swift (VIP) Architecture
Learn how to use the Router component properly▻https://clean-swift.com/clean-swift-ios-architecture/Please make sure that you have read Introducing Clean Swift (VIP) Architecture before proceeding with this tutorial.The Router component is responsible for passing data and handling transitions between view controllers. This is a very useful component if we utilize it properly.For the purposes of this tutorial, I have created an example project with 2 scenes called Login and Register. There would be 2 scenarios presented below.Transitioning from Login to RegisterPassing data from Login to RegisterTransitioningI will start by showing you how to transition to the next view controller. The Router component already contains example methods that we can adapt for our needs.LoginRouterWe will edit (...)
Swift// Defining a Base Classclass Vehicle var currentSpeed = 0.0 var description: String return "traveling at \(currentSpeed) miles per hour" func makeNoise() // do nothing - an arbitrary vehicle doesn’t necessarily make a noise let someVehicle = Vehicle()print("Vehicle: \(someVehicle.description)")// Vehicle: traveling at 0.0 miles per hour// Subclassingclass SomeSubclass: SomeSuperclass // subclass definition goes hereclass Bicycle: Vehicle var hasBasket = falselet bicycle = Bicycle()bicycle.hasBasket = truebicycle.currentSpeed = 15.0print("Bicycle: \(bicycle.description)")// Bicycle: traveling at 15.0 miles per hour// Subclasses can themselves be subclassedclass Tandem: Bicycle var (...)
A summary of AR at #wwdc 2018
This summer I’ve started building an AR & machine learning prototype with a friend. We’re seeing if the technology is ready for an app idea we’d love to work on.As part of the knowledge ramp up, I’ve decided to compile a list with the key points on each AR related session from this this year’s recent WWDC. I find that WWDC is sometimes information overload, and sometimes I’m a little fragmented about what areas a collection of sessions focuses on.My essential WWDC sessions that I had to see live.It’s not easy to curate the sessions based on Apple’s website and app. Thankfully they do make it easy to integrate the WWDC app with your calendar, so if you’re anal with setting yourself alerts like me, you can.However, a title isn’t enough. I just need a small set of bullet points summing up what’s (...)
Using gRPC (with HTTP/2 Stream) for Mobile-Backend networking to optimize UX responsiveness / reactiveness and simplify Mobile App development without touching your backend REST Api.gRPC Mobile BFFThis tutorial is focused on how Backend For Frontend (BFF) design patternrepresent Mobile App developer “Best Friend Forever” and in particular how different technology could help implementing the best BFF that will result on best reactiveness and responsiveness for Mobile Apps.Generally speaking BFF goal is to simplify client app development time decoupling “service API” calls, potentially reducing the number of calls and sharing eventually some logic across different client implementations optimizing in general Networking and Data transformation while adding shared capability for data Joining, (...)
Ever tried to parse #json in swift? I know! right, the sheer magnitude of boilerplate with so many nil checks makes it a really bad experience.I am here to provide you a solution to this problem with the newly introduced Swift 4, with it Apple has finally answered the question of parsing JSON painlessly.Let’s start with the basicsLet’s take a basic JSON structure▻https://medium.com/media/51286e1285e65abf3240eb22418ee1f4/hrefOur swift mapping model will look something like this:▻https://medium.com/media/febe5cc059eea4e8d910c4c22d6e6f0d/hrefAnd to convert this JSON data to our model, this is literally all the code that we have to write▻https://medium.com/media/da8cac90b87ddbd6913f047e4ab5d57a/hrefYou can encode this model to JSON as (...)
The Best Features of #ios 11 and What’s New with #swift 4
The Worldwide Developers Conference (WWDC) in June 2017 saw the new Apple iOS 11 introduced to the world. After giving us a peek into the wonders offered within it through 10 betas, you can expect the new OS to feature in the new iPhone 8S, 8S Plus and iPhone X devices. The conference only showed a teeny-weeny bit into what is offered through the new OS, so you can brace up for a lot more. Here are some of features:ARKitAugmented Reality still rules the world. The ARKit allows developers to build apps with complete AR experiences where your users can enjoy a blend of digital objects and the real environment to have an immersive experience.Document Scanning in NotesThe Notes app in the phone comes with a document scanner, making it easier for you to take photos of the document, crop the (...)
SwiftyWebRTC — RTCClient using #webrtc
How to get video/audio call working using WebRTC frameworkRecently i required to make video call enabled in an #ios app, A lot of apps do it now a days, right. We all use WebRTC for client to client video conversations in our iOS apps. WebRTC is an open-source project (libjingle_peerConnection) maintained by google with high-level API implementations for both iOS and Android. Framework can be built as described in here, or you can download a prebuilt binary that is made available by many open source project.Before going with the tutorial, It is assumed that you know about WebRTC concept and APIs. if you don’t , it can be checked in here.This blog is basically to get WebRTC working in our #swift based app. There are lot of open source libraries with prebuilt libraries and wrappers to include (...)