Skip to content

ArcBlock/did-motif-ios

Repository files navigation

DID Motif iOS

Swift Package Manager compatible

Install

Swift Package Manager

You can use Swift Package Manager and specify dependency in Package.swift by adding this:

.package(url: "https://github.com/ArcBlock/did-motif-ios.git", .upToNextMajor(from: "1.0.0"))

See: Package.swift - manual

Usage

Render DID Motif:

  1. Add view
let motifView = DIDMotifView()

// recomend to set size as square.
// DIDMotif will render it as it real shape
motifView.frame = CGRect(x: 0, y: 0, width: 40, height: 40) 
  1. Render with specific shape
motifView.renderWith(address: "zNKb2kbCvDHo9APDhD1trbAV1EVoYF6PcSJ3", shape: .square)

motifView.renderWith(address: "zNKb2kbCvDHo9APDhD1trbAV1EVoYF6PcSJ3", shape: .circle)
        
motifView.renderWith(address: "zNKb2kbCvDHo9APDhD1trbAV1EVoYF6PcSJ3", shape: .rectangle)
        
motifView.renderWith(address: "zNKb2kbCvDHo9APDhD1trbAV1EVoYF6PcSJ3", shape: .hexagon)

image image image image

  1. Render with origin shape by DID
// DApp
motifView.renderWith(address: "zNKeLKixvCM32TkVM1zmRDdAU3bvm3dTtAcM", shape: nil)

// TOKEN: PLAY 3
motifView.renderWith(address: "z35n3kwEXMakjzfaf24DLd67dTJRByTf8y1FN", shape: nil)
        
// Account
motifView.renderWith(address: "z1imdeFgjsR7n1PhBpyW7uu1zr617sCN64x", shape: nil)
        
// NFT
motifView.renderWith(address: "zjdov4taExQmjyFV4Jt5YPGF5yVUg57pPtQY", shape: nil)

image image image image

License

Copyright 2018-2022 ArcBlock

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.