Posts

Showing posts with the label iOS development

Message bubbles and TableView. Nuked Code [1]

Image
Still upgrading the Selfenger app. This video covers: How to work with UITableViewDelegate and UITableViewDataSource. Working with a custom cell, creating message bubbles and applying MVC pattern. 17 minutes of content just for you.

Simple app for beginners. Nuked Code [0]

Image
The code has been nuked. There is the pilot video on my channel. In this video you will learn how to make a simple app for iOS by using Swift 5 and Xcode. Also this video covers the basic information about constants and variables, Xcode interface and NSAttributedString or attributed, coloured text as a bonus. 12 minutes of puuuuure content. Used code: import UIKit class ViewController : UIViewController { @IBOutlet weak var messagesLabel : UILabel ! @IBOutlet weak var messageTextField : UITextField ! var messages = NSMutableAttributedString ( ) let firstAttribute : [ NSAttributedString . Key : Any ] = [ . foregroundColor : UIColor . blue ] let secondAttribute : [ NSAttributedString . Key : Any ] = [ . foregroundColor : UIColor . purple ] var useFirstAttribute : Bool = true override func viewDidLoad ( ) { super . viewDidLoad ( ) messagesLabel . text = nil ...

Multiple Inheritance in Swift or Protocol Oriented Programming

Image
Flexibility of protocols in Swift gives us an opportunity to write structs or classes that apply something like multiple inheritance. This article tries to explain a simple example of using that pattern. What is the main purpose of protocols in Swift? Of course protocols talk to structs and classes how they should look. If we signed our data type for the desired protocol and the type has no all the properties and methods which  our protocol needs, then compiler can’t launch the program. Besides we are able to sign one custom data type for many protcols and this possibility allows us to use some patterns from multiple inheritance. It's really cool and safe! For example, let's create a simple app that shows the information about nature object that we randomly get from an array. In the storyboard's scene we need to add an ImageView for object's image or animation, three labels for different information and a button for getting a random object, into the main vie...