Posts

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

We need to talk

Image
Hi, I am Uberdeviant, you don’t know about me anything yet, so let me tell you first information - I’m staying in China and this internet sucks (thanks, China Mobile). China is a good place for inspiration, especially Hong Kong. Wait a second, I wasn’t going to write about story of my life, the main reason I’m here is coding.  When I’ve finished reading one of the books about swift programming I was ready   to create a game that stuck in my mind from the childhood. The main idea was to build a cool mobile game where a user would create his own country and think over about politics, economy and all the ways of developing his ownership. Actually when I was twelve I liked to read some courses and books about society, economy and politic science, I got to know which differences an empire and federation or confederation had, or how to build dictatorship or democracy. China, Hong Kong, South Korea where I traveled and North Korea that I saw through the river proved all that I read