ios – How to use XCode, UIKit and Interface Builder?

These days I'm into iOS development and I'm very confused about XCode and the Apple Dev ecosystem.

First of all, there are no more storyboards & interface builder tutorials in the official Apple Docs (or I have not seen one yet).

There is also no way to enter iOS development.
It seems that XCode is not a good tool.

There is no good separation between What you should do programmatically and what you should do in Interface Builder,

When I look at some open source projects, it seems like the full programmatic approach is far preferable to the Interface Builder, but it is still necessary to have at least one storyboard.

XCode feels inconsistent in its condition. I've seen that Apple is developing SwiftUI, which seems to be full programmatically and declaratively.

Here is my true question: Is Apple in a transitional phase after a design error (Interface Builder)?

If it's a no, How do you think the Apple tools should be used?

I do not know if it's opinion-based, but I want to get to know the "good way" and best practices of iOS development.

Input Fields – How to Display Text with Caption in the Material Interface?

On a single page, I want to display text boxes for user input and text that are static but have captions. I tried to use the same textboxes with disabled attributes:

Enter image description here

However, I am not happy that deactivated fields are not bright enough. Actually, these fields should never be editable, so the status does not seem to be disabled for them. I also searched some of the Material UI elements that are caption text but could not find anything suitable.

How does the Material UI display items with important text and captions?

Interface – monthly payment and one-time payment in the same place

Good morning, I make a payment area where the user can buy a monthly product and a single purchase product. The project owner requires that the payment be the same for both forms. It can be a credit card or a bank receipt. However, it does not make sense to pay for a product that is paid monthly in installments with a single purchase. Would anyone have any suggestions?

Enter image description here

16.04 – How to set up the Ubuntu / KVM network interface to connect to a Windows 7 VM

I want to create a gameserver in a Windows VM on my Ubuntu 16.04 server with KVM.

I have already installed the vm and it works fine.
I deactivated the Windows Firewall directly in the VM.

The Windows VM communicates with the Internet via a network bridge, which also works.

For my server I have released these ports in the Ubuntu Firewall (Iptables):

TCP: 2302,27015-27030,27036-27037
UDP: 2302,4380,27000-27031,27036

The port forwarding I realized according to the following instructions: https://www.cyberciti.biz/faq/kvm-forward-ports-to-guests-vm-with-ufw-on-linux/

on iptables -L FORWARD -nv --line_number reconfirm this:

root @ s1 ~ # iptables -L FORWARD -nv --line_number
Chain FORWARD (Policy ACCEPT 0 packets, 0 bytes)
number pkts bytes target prot opt ​​in out source destination
1 2532 201K ACCEPT all - * virbr0 0.0.0.0/0 192.168.122.0/24 ctstate RELATED, ESTABLISHED
2 5720 842K ACCEPT all - virbr0 * 192.168.122.0/24 0.0.0.0/0
3 0 0 ACCEPT all - virbr0 virbr0 0.0.0.0/0 0.0.0.0/0
4 0 0 REJECT all - * virbr0 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
5 0 0 REJECT all - virbr0 * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
6 0 0 ACCEPT all - * virbr0 192.168.2.0/24 192.168.122.0/24 state NEW, RELATED, ESTABLISHED

on iptables-save -t filter | grep FORWARD reconfirm this:

root @ s1 ~ # iptables-save -t filter | grep FORWARD
: FORWARD ACCEPT [0:0]
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m conntrack -ctstate RELATED, ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT -reject-with-icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT - Reject-with ICMP port-unavailable
-A FORWARD -s 192.168.2.0/24 -d 192.168.122.0/24 -o virbr0 -m state -state NEW, RELATED, ESTABLISHED -j ACCEPT

My network interface looks like this:

### Hetzner Online GmbH installation picture

source /etc/network/interfaces.d/*

car lo
iface lo inet loopback
iface lo inet6 loopback

car br0
iface br0 inet static
address 
  Netmask 255.255.255.192
gate 
  # Route  over 
  up route add -net  Netmask 255.255.255.192 gw  dev eth0
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
iface br0 inet6 car

iface eth0 inet6 static
address 
  Netmask 64
gate 

Actually, it looks good to me, but I do not have much experience with kvm yet, because when I try to connect to the game server, the client does not … I think there is still a problem with port forwarding ,

Is there someone who can give me a hint? Many Thanks πŸ™‚

What is the best ternary data interface widget?

In a form design wizard, users can define check boxes and then indicate how important they are. Some fields will always be in shape (for other purposes). In such a field, however, a person can specify three "levels" of their functioning:

  • Required (Field is required and must not be left blank by the end user)
  • Optional (field is optional / can be left blank)
  • Disabled (field can not be edited by user / always remains empty).

Because each of these options is mutually exclusive, using multiple check boxes / sliders is not the way to go.

One option is to use 3 radio buttons – but this takes up a lot of space for such a simple definition.

Is there a better tool? Where can I just show the ternary status and have a simple feedback (also on the phone)?

Best interface for choosing a birthday?

I design a form in which the user must select his birthday. only day and monthnot the year.

Since this is only the day and the month, the standard procedures for date picker programs do not necessarily apply, though some do.

Nielsen and Norman recommend splitting the fields and, if possible, specifying the month. UX movement recommends the use of plain text fields. This excludes the possibility of spelling the month. There is also the question of whether the focus should automatically be moved to the next field – Lukas Mathis recommends talking against it, but without this, an extra click is required if two fields are used.

I should also mention that the UI should only consist of standard elements. I know there are big custom pickers, but this project does not have the budget to build one for such a small feature.

linux – difference between network interface and link

(*) Sorry if this question seems trivial to some people.

I am not sure if I understand the term shortcut and his relationship with Network Interface (physical / virtual).

As far as I understand, shortcut is the connection between two network devices.

Technically, we use one Network Interface on each device to make the connection.


Now some cases that illustrate my confusion:

  1. If we use that ip Command from the iproute2 package, which is a subcommand for managing network interfaces shortcut (why not something like interface)?

  2. When we execute IP address (or ifconfig For those who still use it, we can see the following interface types: Link / loopback. link / ether,

  3. According to this IP Layer Network Administration Guide for Linux, the possible values ​​for the scope of the IP address are: global. Page? Λ… . host and.. shortcut,

  4. I searched for an answer and found the following resource – OSPF for IPv6, which added even more confusion:

2.1. Protocol processing per connection, not per subnet

IPv6 uses the term "link" to indicate "a communication device or"
Medium over which nodes can communicate on the link layer "([IPV6]).
"Interfaces" connect to links. Multiple IPv6 subnets can be assigned
to a single connection, and two nodes can talk directly about a single connection,
even if they do not have a common IPv6 subnet (IPv6 prefix).

For this reason, OSPF is run for IPv6 instead of IPv4
Behavior per IP subnet. The terms "network" and "subnet" in
the IPv4 OSPF specification ([OSPFV2]) should generally be replaced
by link. Likewise, an OSPF interface is now connected to a link
an IP subnet.

This change affects the reception of OSPF protocol packets that
Content of hello packets and content of network LSAs.

Any help is appreciated (:


Output example:

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group standard qlen 1000
link / loopback 00: 00: 00: 00: 00: 00 brd 00: 00: 00: 00: 00: 00
inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 :: 1/128 scope host valid_lft forever preferred_lft forever
2: enp0s3: mtu 1500 qdisc fq_code state UP group default qlen 1000
link / ether 02: 00: 45: 5c: 22: af brd ff: ff: ff: ff: ff: ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3 valid_lft 73534sec preferred_lft 73534sec
inet6 1234 :: 44: 455ff: fe555c: bcaf / 64 scope link valid_lft forever preferred_lft forever

Design Pattern – DDD and Infrastructure Micro-Services – How should the interface be designed?

We've extracted our email delivery into an email service – this is a microservice that provides resiliency and abstracts the email logic into an infrastructure service.
The question is how to define the interface to the EmailService in relation to the information it needs via the EmailService [User] domain

Approach 1:
EmailService provides an interface that covers all the fields of the [User] Domain that needs it.

Approach 2:
The EmailService interface only accepts the user identification, The EmailService then queries the UserService with this ID to retrieve the required fields

Each approach has some obvious advantages and disadvantages.
Approach1 requires the calling service to know everything about a user that the Email services even if it is not part of the domain representation of a user of the caller. On the other hand, the contract between the services is explicit and clear.

Approach2 ensures that the [User] Fields are fetched as late as possible to minimize consistency issues. However, this creates an implicit contract with the UserService (with its own problems)

I've done a lot of research here and in terms of SO, but I could not find anything about this specific interface design problem. Which approach is correct considering the DDD principles?

design – Should the attributes of a class be part of the public interface, even if they could break their methods?

As a minimal example, consider the following (in Python):

Class Foo:
def __init __ (self, bar):
# Suppose the bar is valid at this time
self.bar = bar

def divide_by_bar (self, num):
return num / self.bar

If the attribute bar is public, my understanding is that it is valid for the client to do something like:

>>> foo = Foo (1)
>>> foo.bar = 0
>>> foo.divide_by_bar (2)
Tracing (last call last):
...
ZeroDivisionError: Divide by zero

There has been a more complex version of this on our team, and I have suggested making the attribute private or read-only (or treating the treatment as an exception). However, I've received the answer that it's okay to leave it that way because it's only used at one point in our codebase. I have agreed, but I have found numerous examples of this practice in our codebase, and I am not sure when to proceed stricter in these cases. Should I ignore it until it is used in several places?