Software Development Notes
Home
Swift
Python
About
Software Development Notes
  • Save an image to MacOS file system with SwiftUI

    May 22, 2022 · 7 min read · NSSavePanel image file macos swiftui  ·
    Share on:
    Save an image to MacOS file system with SwiftUI

    SwiftUI does not have a control to present an open/save dialog to the user to allow saving files to the macOS filesystem. One could build such a view from scratch, but it is easier to use NSSavePanel from AppKit. This article demonstrates how to use NSSavePanel to get the URL for the file to be saved and use …

    Read More
  • Use Dependency Injection to Unit Test a ViewModel in Swift

    Apr 17, 2022 · 8 min read · dependency injection di unit test swiftui  ·
    Share on:
    Use Dependency Injection to Unit Test a ViewModel in Swift

    Dependency Injection is a technique to pass in one or more dependent object to another object. This article will build on the Weather App to pass in the weather service to the weather ViewModel at initialisation. This will allow the use of a mock weather service to test the ViewModel in unit tests without requiring any …

    Read More
  • Consistent Swift style in Xcode with SwiftLint

    Mar 27, 2022 · 26 min read · swiftlint style swiftui  ·
    Share on:
    Consistent Swift style in Xcode with SwiftLint

    Code style can be a controversial topic and lead to some passionate debates between developers. The use of a tool to enforce a set of rules on style can be very helpful to avoid contentious arguments and ensure the code is consistent throughout a project. SwiftLint can easily be incorporated into Xcode projects to flag …

    Read More
  • Display loading screen when fetching data in Swift

    Mar 20, 2022 · 7 min read · progressview async await swiftui  ·
    Share on:
    Display loading screen when fetching data in Swift

    Last week, we retrieved weather data from Open Weather API to demonstrate how to parse JSON data. The weather data is retrieved asynchronously, which may result in a delay before the UI is updated. This article shows how to display a progress view while the data is being fetched, to provide feedback that something is …

    Read More
  • Read JSON with codeable in Swift

    Mar 13, 2022 · 9 min read · json JSONDecoder swiftui  ·
    Share on:
    Read JSON with codeable in Swift

    Reading JSON data from local files and url is now much easier with codeable in Swift 5. This article shows how to load JSON data from a local file as well as from the open weather data api.

    Read More
  • Saving a SwiftUI view to Photos

    Mar 6, 2022 · 8 min read · photo shape swiftui  ·
    Share on:
    Saving a SwiftUI view to Photos

    Many shapes and patterns can be created using Path and Canvas in SwiftUI. It would be great to be able to save these as images in the Photo Library. This is possible using UIKit, by first converting the SwiftUI View to UIImage and then saving this image to Photos.

    Read More
    • ««
    • «
    • 1
    • 2
    • 3
    • 4
    • 5
    • »
    • »»

Eric Callanan

Lifelong learner, Software Engineering Manager, Passionate, Curious
Read More

Recent Posts

  • Reduce in Swift
  • Save an image to MacOS file system with SwiftUI
  • Map on collections in Swift
  • Iterating over a Dictionary in Swift
  • Exploring data with Swift TabularData and DataFrame
  • Use Dependency Injection to Unit Test a ViewModel in Swift
  • Consistent Swift style in Xcode with SwiftLint
  • Display loading screen when fetching data in Swift

Tags

SWIFTUI 58 PYTHON 27 SWIFT 13 PATH 12 PANDAS 11 MVVM 8 MATPLOTLIB 7 PLOTLY 7 ANIMATION 6 BAR-CHART 6 CANVAS 6 COVID-19 5 SHAPE 5 TIC-TAC-TOE 5
All Tags
2D2 3D2 ACTIVITY-RING1 ADDCURVE1 ALGORITHM1 ANGULARGRADIENT1 ANIMATABLEDATA4 ANIMATION6 ASYNC1 AWAIT1 AXIS2 BAR-CHART6 BUTTON1 BUTTONSTYLE1 CANVAS6 CARD1 CHART1 COMPACTMAP1 CONCAT1 COVID2 COVID-195 CROSS-PRODUCT1 DATAFRAME2 DEPENDENCY-INJECTION1 DI1 DICTIONARY1 DIVISION1 DOT-PRODUCT1 ENUMERATE1 FIBONACCI1 FILE1 FILTER1 FLATMAP1 FLIP1 FLOOR1 FOREACH1 FORM1 GEOMETRYREADER1 GEOPANDAS1 GEOPLOT1 HSTACK1 ILOC1 IMAGE2 INDEX1 IPYWIDGETS1 ITERATE1 JSON1 JSONDECODER1 LINE-CHART1 LIST1 LOC1 LOOP1 MACOS1 MAP1 MAPVALUES1 MATHPLOTLIB4 MATPLOTLIB7 MINIMAX3 MODAL1 MONTY-HALL3 MVVM8 NAVIGATION1 NSSAVEPANEL1 PANDAS11 PATH12 PERFORMANCE2 PHOTO1 PIE-CHART1 PLOTLY7 POLYGON1 PROBABILITY3 PROGRESS1 PROGRESSVIEW1 PUZZLE1 PYTHON27 QR-CODE1 RECURSION1 REDUCE1 ROMAN-NUMERALS1 SHADING1 SHAPE5 SLIDER1 SPEED1 STAR3 STYLE1 SWIFT13 SWIFTLINT1 SWIFTUI58 TABULAR-DATA1 TABVIEW1 TDD4 TEXT2 TIC-TAC-TOE5 TIMELINEVIEW4 TIMING1 UI-TESTING1 UNIT-TEST1 UNIT-TESTING1 USERDEFAULTS1 VECTOR4 VECTORARITHMETIC4 VSTACK1 WHERE1 ZIP1 ZSTACK1
[A~Z][0~9]