Skip to content

Instantly share code, notes, and snippets.

@pavel-sazonov
Created December 2, 2021 12:09
Show Gist options
  • Select an option

  • Save pavel-sazonov/a686c8df96ab9966c6d8ef6f0f2cbf13 to your computer and use it in GitHub Desktop.

Select an option

Save pavel-sazonov/a686c8df96ab9966c6d8ef6f0f2cbf13 to your computer and use it in GitHub Desktop.

Revisions

  1. pavel-sazonov created this gist Dec 2, 2021.
    13 changes: 13 additions & 0 deletions addLogoToNavigationBar.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    private func addLogoToNavigationBar() {
    let imageView = UIImageView()
    imageView.contentMode = .scaleAspectFit
    imageView.image = Images.Loyalty.lamodaClub.templatedImage

    let contentView = UIView()
    navigationItem.titleView = contentView
    navigationItem.titleView?.addSubview(imageView)

    imageView.snp.makeConstraints { make in
    make.center.equalTo(contentView)
    }
    }