<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daria Leonova on Medium]]></title>
        <description><![CDATA[Stories by Daria Leonova on Medium]]></description>
        <link>https://medium.com/@marcushaldd_23?source=rss-6b3a5dc86057------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Yoxcsf-NH5E4MgT1z8Zqlg.jpeg</url>
            <title>Stories by Daria Leonova on Medium</title>
            <link>https://medium.com/@marcushaldd_23?source=rss-6b3a5dc86057------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:34:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcushaldd_23/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SceneKit. Start guide.]]></title>
            <link>https://medium.com/@marcushaldd_23/scenekit-start-guide-0411e1746c3e?source=rss-6b3a5dc86057------2</link>
            <guid isPermaLink="false">https://medium.com/p/0411e1746c3e</guid>
            <category><![CDATA[3d]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[scenekit]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Daria Leonova]]></dc:creator>
            <pubDate>Thu, 08 Feb 2024 17:58:09 GMT</pubDate>
            <atom:updated>2024-02-08T17:58:09.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I decided to experiment with 3d graphics and put together basic concepts along the way. If you want to take your first steps in 3D graphics on your iPhone, then this article is just for you. I will show the main components of the SceneKit and the way they work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFmHli6rYZCVwz5t5gKzzA.png" /></figure><p>First of all, let’s recall basic things about 3-dimensional space. We have 3 axes there — X, Y, Z, and the position of any point is described by vector like {x, y, z}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUBWEMXouGf-zD95N14mMg.png" /></figure><p>3D space in SceneKit is absolutely the same. However, in these digital 3D graphics, there is an additional important part that we don’t usually pay attention to in mathematics class: <strong>point of view</strong>. Or, in other words, the camera.</p><p>Let’s dive into the components at this stage.</p><p>At the heart of integrating 3D content into SwiftUI is the <strong>SceneView</strong> component. It is a View wrapper around your 3D Scene (<strong>SCNScene</strong>), the core of SceneKit, representing the 3D scene. Essentially, it’s a container for your 3D world with all objects, cameras, and lighting. Finally, each object that you add to the scene is described with nodes (<strong>SCNNode</strong>), the fundamental building block in SceneKit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*g5pzync5rapFjz0qpOdwhA.png" /></figure><p>Everything is understood better with practice. So, let’s just try to create our first object. We will need to make a new scene and add a node to it.</p><pre>class MyScene: SCNScene {<br><br>    override init() {<br>        super.init()<br><br>        let sphere = SCNSphere(radius: 0.1) // 3<br>        sphere.firstMaterial?.diffuse.contents = UIColor.systemGreen<br><br>        let node = SCNNode(geometry: sphere) // 1<br>        node.position = SCNVector3(0, 0, 0) // 2<br><br>        rootNode.addChildNode(node) // 4<br>    }<br><br>    required init?(coder aDecoder: NSCoder) {<br>        fatalError(&quot;init(coder:) has not been implemented&quot;)<br>    }<br>}</pre><p>Pay attention, numbers <strong>are not</strong> in order. We are starting with creating a node (3) and setting its position to the origin of the coordinates (2). But without filling, our node is just an invisible block in space; that’s why we are creating an object — a sphere<strong>*</strong> (1) and putting it inside our node. Finally, we are just adding the node inside the scene.</p><p><strong>*</strong>SceneKit provides many implemented forms out of the box, like spheres, boxes, pyramids and others. You can create your own forms with <a href="https://developer.apple.com/documentation/scenekit/scngeometrysource">SCNGeometrySource</a> and <a href="https://developer.apple.com/documentation/scenekit/scngeometryelement">SCNGeometryElement</a>.</p><p>Now, we need to put our scene on view and [!] set up a camera. <strong>Camera: SCNCamera</strong> determines the perspective from which the scene is rendered. By default, the camera is positioned at the origin, so you’ll likely need to move it to get a complete view of the scene.</p><p>The camera is placed on the scene exactly like any other object — via node.</p><pre>static func createCameraNode() -&gt; SCNNode {<br>  let cameraNode = SCNNode()<br>  cameraNode.camera = SCNCamera()<br>  cameraNode.position = .init(x: 0, y: 0, z: 3)<br>  return cameraNode<br>}</pre><p>I suggest adding a coordinates axis to our scene — it will allow us to navigate in space. And also it is a chance to practice just a little bit.</p><pre>func addAxis(eulerAngles: SCNVector3) {<br>  let axis = SCNNode(geometry: SCNCylinder(radius: 0.005, height: 2)) // 1<br>  axis.geometry?.firstMaterial?.diffuse.contents = UIColor.black.withAlphaComponent(0.4)<br>  axis.position = SCNVector3(0, 0, 0) // 3<br>  axis.eulerAngles = eulerAngles // 2<br>  rootNode.addChildNode(axis)<br>}</pre><p>Let’s take a cylinder as an axis (1), set its center in the origin of the coordinates (2) and then rotate the cylinder (3) to set it in the correct position. To rotate the object I use a vector with radians.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOXF2pOkdC7cUBvCEP_MWw.png" /></figure><p>Great! We are totally ready to put our 3D scene on a screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*q38tbySbYcWhVMQDP7QHXg.png" /></figure><p><em>.allowsCameraControll</em> (1) option gives you the possibility to move the camera by panGesture, which actually gives the impression that you rotate objects.</p><p>One more notable option that you can find handy is .<em>autoEnablesDefaultLightning</em>, which provides default scene lighting. It adds a light source with direct lightning in a camera node.</p><p>While SceneKit’s capabilities are a boon for game development, its utility extends to various other domains:</p><ul><li>Educational Applications: 3D visualization can be used for creating interactive educational content like models of historical artefacts, scientific diagrams, or celestial bodies.</li><li>Architecture/Interior Design: 3D visualization aids in creating or viewing models of buildings, rooms, or entire houses.</li><li>E-commerce: Enables customers to view products from all angles before making a purchase.</li><li>HealthCare: Some apps use anatomical 3D models for online consultations.</li><li>Advanced Navigation Apps: Utilize 3D visualization to create realistic representations of terrain, buildings, and landmarks.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0411e1746c3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 3 things you do wrong as a newbie in mobile development]]></title>
            <link>https://medium.com/@marcushaldd_23/top-3-things-you-do-wrong-as-a-newbie-in-mobile-development-d103c6a3a671?source=rss-6b3a5dc86057------2</link>
            <guid isPermaLink="false">https://medium.com/p/d103c6a3a671</guid>
            <category><![CDATA[problems]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mistakes-to-avoid]]></category>
            <dc:creator><![CDATA[Daria Leonova]]></dc:creator>
            <pubDate>Sat, 06 Jan 2024 19:03:49 GMT</pubDate>
            <atom:updated>2024-01-06T19:03:49.145Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_pqY2_1qRUIY6Ms0ZeXpw.png" /></figure><p>You have completed a course or, watched a series of videos on YouTube, or read a series of articles about iOS development, and now you feel ready to write your first pet project.</p><p>Firstly, well done! That’s awesome. You’re cool! 💪</p><p>Secondly, a pet project is a fantastic boost to your skills. When you start doing something on your own, not following instructions — you have to spend a ton of time and effort, google a lot, read heaps of new information, and try to filter and fit it precisely into your case. In short, it’s already a real task that will boost you five times.</p><p>However, most beginners ignore key things (not out of their initiative, but without understanding their importance). Over the past six months, I have been actively <a href="https://meander.so/m/9cdbb622-1b47-4843-9464-6b960e675de4">mentoring</a> and helping newcomers with their questions and problems, including pet projects. I have identified the top 3 points that you, as a beginner, should incorporate into your must-have list, master, understand, and use.</p><h3>Access level</h3><p>At first, almost no one pays attention to the <strong>private</strong> modifier. Meanwhile, everyone can instantly explain SOLID if you wake them up in the middle of the night. Having read various smart articles, people try to create a bunch of classes according to the idea of ’S’ (single responsibility). And then, with a clear conscience, they change the property of class A from class B and vice versa.</p><pre>class A {<br>    <br>    var someAValue: Int?<br><br>}<br><br>class B {<br><br>    let a = A()<br><br>    func foo() {<br>        a.someAValue = 1<br>    }<br><br>}</pre><p>In general, if it’s still unclear, here’s the plan: always write <strong>private </strong>everywhere, and when the compiler complains — think, is it okay to access this property or function from the outside? And if it is — remove <strong>private</strong>.</p><p>When you think, guide yourself with real-world comparisons. For example, if your class is a store, then the ‘goods’ property should obviously be accessible to the external customer. But the <strong>moneyInCashRegister</strong> can clearly only be changed by an internal store employee. After all, a customer shouldn’t have access to the cash register, even with ‘put’, let alone ‘fetch’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h7eYJj5WFAMDOXgYvuMjWg.jpeg" /></figure><p>One might argue, “I understand perfectly well which property can be touched and which cannot even without a ‘private’ modifier”. However, writing access level modifiers is part of the design. I am sure you wouldn’t create a blueprint for a house with a door on the third floor leading outside. And then just remember not to open it. After all, it’s likely that others will use your code too.</p><p>By the way, a similar situation exists with <strong>var</strong> and <strong>let</strong>. Again, always use <strong>let</strong> unless you’re immediately sure you’ll change the value.</p><h3>Architecture Simplicity</h3><p>I’ve noticed a tendency where beginners try to plan everything in advance. While this is commendable, developers often make mistakes due to their lack of experience. They pre-prepare overly complex managers (usually copied from <a href="https://stackoverflow.com/">StackOverflow</a>) with many complicated methods, which they eventually never use. As a result, the amount and complexity of the code grows. Instead of what seemed like a convenient, ready-made service, our programmer end up with only problems and misunderstandings. The same goes for architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3KNMtAOtYKC0aNotRkVfw.jpeg" /></figure><p>Let me briefly journey you through the history of programming to convey my point. By the end of the 1960s, as the popularity of programming began to grow, the sizes of programs also increased. As you can understand, a larger program size means more lines of code, leading to increased complexity and difficulty in understanding the program. To address this issue, structured programming emerged — functions and procedures that allowed programs to be divided into smaller, manageable parts. The code became modular, reusable, and more understandable.</p><p>The advent of structuring led to further growth in programs until they again reached their size and complexity limits. Therefore, by the late 1970s and early 1980s, the object-oriented programming approach was formed. This solution enabled creating flexible and scalable systems, addressing increasingly complex tasks.</p><p>In the next decade, we witnessed the boom of computer games. The reaction to user actions (clicks, presses) turned out to be critical, leading to the emergence of Event-Driven Programming. And for organizing code in web and desktop applications — when the same data needed to be rearranged from different perspectives — the MVC pattern (i.e., separating the model from its visual representation) emerged.</p><p>You’ve grasped the main idea: a problem arises, -&gt; a solution emerges. <strong>Problem -&gt; Solution</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Diiczl1kNpCSFHa8-J6NYQ.jpeg" /></figure><p>So why do beginner programmers now start applying solutions (architectures) at a time when the problems have yet to arise? Tutorials immediately suggest choosing at least an MVP. Test tasks for one/two screens always specify NOT to use MVC. During interviews, a person who has written a couple of pet projects with the same one/two screens is asked about VIPER problems. How could he know about the problems if he has not yet encountered them?</p><p>People often talk about the convenience of testability in the context of architecture, but they haven’t ever written tests. And if they have, it was based solely on some tutorial, focusing only on unit tests without tying them to an actual application. They can explain the MVP scheme in simple terms, but they often get confused when it comes to protocols with similar names, like <strong>ViewInput</strong> and <strong>ViewOutput</strong>. Deep down, they already see all of this as some overhead.</p><p>Conclusion: Don’t create problems for yourself. Don’t be ashamed of MVC. When your controller grows too large, or you encounter inconveniences, you’ll understand it’s time to look for new approaches.</p><h3>UI Simplicity</h3><p>Front-end development is a dopamine paradise for beginners. You write code and immediately see the result on the screen — receiving your reward. It’s undeniably motivating. However, there’s a flip side to this coin. Beginners often strive to create overly complex UI right away. Moreover, complex features tend to follow complex UI. Even though SwiftUI simplifies the task today, one can still spend much time adding bells and whistles without making real progress.</p><p>I learned iOS development in a course where we formed teams and worked on a single project. In my team, a guy suggested starting our app development by choosing fonts and colors for the dark mode. Overall, he spent the entire course on it, and it’s worth noting that the fonts and colors turned out fabulous. However, the guy wrote approximately zero lines of actual code during all that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uHNqH_AZ3QpDpAPw91YGw.png" /></figure><p>Undoubtedly, the beauty and functionality of your application are crucial. Eventually, you’ll have to spend time on this aspect. It’s just better to start with something simpler. Develop an MVP (minimum viable product), focus on the most critical features, and launch from there. The <a href="https://en.wikipedia.org/wiki/Pareto_principle">80–20 rule</a> applies here — create the fundament of the application, and then add the extras. The opposite approach will lead to grappling with complex nuances and constantly dealing with a main functionality that keeps breaking.</p><p>For newcomers in mobile development, there’s a risk of adopting complex solutions prematurely. While the visual rewards of front-end development can be enticing, starting with a simple MVP is often wiser. Historical trends suggest that solutions should evolve in response to genuine challenges. Understanding foundational principles and addressing real-world problems as they arise is critical to effective development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d103c6a3a671" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift & Xcode tips for beginners]]></title>
            <link>https://medium.com/@marcushaldd_23/swift-xcode-tips-for-beginners-1984f45dd995?source=rss-6b3a5dc86057------2</link>
            <guid isPermaLink="false">https://medium.com/p/1984f45dd995</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Daria Leonova]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 16:58:52 GMT</pubDate>
            <atom:updated>2023-10-06T16:58:52.935Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, developer! Swift is a cool and convenient programming language with lots of handy features. However, at the beginning of the journey, it can be challenging to use its capabilities to the fullest, as it&#39;s not easy to know about all of its features. In this article, I tried to collect some not widely known but, nevertheless, useful tips that will help you in writing more &#39;Swift&#39;-ish code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDbP9AYjJ4N7gdTJbZ_glQ.jpeg" /></figure><p>Let’s get started with some code improvements.</p><ul><li>If you have a bool value inside an optional one, instead of optional chaining you can <strong>compare bool values directly</strong>.</li></ul><pre>struct Person {<br>    let isMinor: Bool<br>}<br>var person: Person?<br><br>// instead of<br>if let person,<br>   person.isMinor {<br>    ...<br>}<br>// use<br>if person?.isMinor == true {<br>   ...<br>}</pre><ul><li>If you have some additional logic related to how a property is stored or computed on reading, you probably need <strong>PropertyWrappers</strong>.</li></ul><pre>// instead of<br>struct User {<br>    var firstName: String<br>    var lastName: String<br><br>    init(firstName: String, lastName: String) {<br>        self.firstName = firstName.capitalized(with: .current)<br>        self.lastName = lastName.capitalized(with: .current)<br>    }<br>}<br><br>// use<br>@propertyWrapper struct Capitalized {<br>    var wrappedValue: String {<br>        didSet { wrappedValue = wrappedValue.capitalized }<br>    }<br><br>    init(wrappedValue: String) {<br>        self.wrappedValue = wrappedValue.capitalized<br>    }<br>}<br><br>struct User {<br>    @Capitalized var firstName: String<br>    @Capitalized var lastName: String<br></pre><ul><li>When you are using enum it’s not always necessary to apply <strong>switch</strong> — it is enough to code <strong>if</strong>. It is especially handy when you are interested only in one case.</li></ul><pre>enum Enum {<br>    case one, two(String), three(Int), four<br>}<br><br>func foo(e: Enum) {<br>    // instead of<br>    switch e {<br>    case .two(let string):<br>        if string.isEmpty {<br>            ...<br>        }<br>    default:<br>        break<br>    }<br><br>    // use<br>    if case .two(let string) = e, string.isEmpty {<br>        ...<br>    }<br>}</pre><ul><li>Multilines strings can be used pretty often, particularly in mock data. So there is a small tip for you — instead of difficult to read “\n” use multiline <strong>String syntax</strong></li></ul><pre><br>// instead of<br>let value = &quot;Lorem ipsum,\n sed do eiusmod\n ut labore\n et aliqua.&quot;<br><br>// use<br>let value = &quot;&quot;&quot;<br>Lorem ipsum<br>sed do eiusmod<br>ut labore<br>et aliqua.<br>&quot;&quot;&quot;</pre><p>Here are a few more tips to enhance your productivity with Xcode that I want to share.</p><ul><li>During development, we often have to write similar code. Like, <strong>guard let self…</strong>, <strong>// MARK:</strong> , [<strong>weak</strong> <strong>self</strong>] and so on. This commonly used code patterns you can wrap in <strong>Code Snippets. </strong>This can not only save you time but also ensure consistency in your code</li><li>You may be aware of a tool like <strong>SwiftLint</strong>. I want to highlight that it is a good practice to integrate it event in your pet project. It will help to build good coding habits and learn best practices. You can find a lot of ready SwiftLint configurations on GitHub.</li><li><strong>Search</strong> is a powerful instrument in Xcode. Besides the standard text search you can use regular expressions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*ecyOjs4B-pekkWWxfYQyvw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1984f45dd995" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>