Posts

iOS Tutorial - Easy and flexible custom fonts in the runtime without so much code !

Image
Problem:  You may find your app needs custom fonts but in many different ways and a lot of fonts  fonts can change the whole user experience of an application even making the user prefer one application to another in android for example : they have a powerful font system you can declare your custom fonts in the xml file and you can even inherit one font from another  in This tutorial we gonna make the ios easier to customize even in the story board  the final result you will be able to write the name of custom font in interface builder inspector to be applied in the runtime You can type "TSRegularLight_small" in text_style field of a button or label applies to it  #1st step:  Create the enums to represent your font sizes, fonts and font type(bold, italic etc)  enum UIFontSizes   : Int {     case xSmall = 12     case small = 14     case large = 18     case medium = 16     case xLarge = 22 }

iOS Tutorial - The standard login screen but in rx and mvvm !

Image
In this tutorial we gonna explain how mvvm can be used along with rx What is MVVM pattern? Model . (M) Model  refers either to a  domain model , which represents real state content (an object-oriented approach), or to the  data access layer , which represents content (a data-centric approach). [ citation needed ] View (V) As in the  model-view-controller  (MVC) and  model-view-presenter  (MVP) patterns, the  view  is the structure, layout, and appearance of what a user sees on the screen. [6]  It displays a representation of the model and receives the user's interaction with the view (clicks, keyboard, gestures, etc.), and it forwards the handling of these to the view model via the  data binding  (properties, event callbacks, etc.) that is defined to link the view and view model. View model (VM) The  view model  is an abstraction of the view exposing public properties and commands. Instead of the controller of the MVC pattern, or the presenter of the MVP

iOS Tutorial - Twitter profile view controller

Image
Storyboard configurations: First we add the header which will contains the background image ( we will insert UIImageView by code later) with trailing, leading, top to super view with a constant of its height we should also maintain a reference to the header view in the view controller Second step:  we add the scroll view which will contain the data for example you can embed an empty view in it OR a UITableView with a fixed height to it  with the shown constraints  You will notice a red flash booms to your face from the Xcode , its normal the scroll view is a special class that have a view to scroll , interface builder don't know the actual height or width for the scroll  we will fix this now  interface builder issues:  We will add a dummy container view with constraints to scrollview we will called "Spacer"  , Wow the red flash gone ! Optional : we can add another container view that can embedded anoth