Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ShihabM committed Apr 18, 2020
1 parent 5cb7fcf commit 690845e
Show file tree
Hide file tree
Showing 14 changed files with 694 additions and 62 deletions.
Binary file added Assets/Screens/Watch/Watch1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Screens/Watch/Watch2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Screens/Watch/Watch3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Screens/Watch/Watch4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 58 additions & 57 deletions Mast/Mast.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<key>MastShare.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>9</integer>
<integer>10</integer>
</dict>
<key>MastStickers.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>10</integer>
<integer>11</integer>
</dict>
<key>MastWatch (Notification).xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -37,7 +37,7 @@
<key>MastWatch.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>11</integer>
<integer>9</integer>
</dict>
<key>macBundle.xcscheme_^#shared#^_</key>
<dict>
Expand Down
9 changes: 9 additions & 0 deletions Mast/Mast.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"object": {
"pins": [
{
"package": "Kingfisher",
"repositoryURL": "https://github.com/onevcat/Kingfisher",
"state": {
"branch": "master",
"revision": "0abe23a6b7909b011eb6e4cee85d509db768f41a",
"version": null
}
},
{
"package": "SDWebImage",
"repositoryURL": "https://github.com/SDWebImage/SDWebImage",
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions Mast/MastExtension/MainFeedCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation
import UIKit
import SDWebImage
import Kingfisher

class MainFeedCell: UITableViewCell {

Expand Down Expand Up @@ -125,7 +125,7 @@ class MainFeedCell: UITableViewCell {
self.timestamp.text = timeAgoSince(stat.reblog?.createdAt ?? stat.createdAt)

guard let imageURL = URL(string: stat.reblog?.account.avatar ?? stat.account.avatar) else { return }
self.profile.sd_setImage(with: imageURL, completed: nil)
self.profile.kf.setImage(with: imageURL)
self.profile.layer.masksToBounds = true
// if stat.reblog?.account.displayName == nil {
// self.profile2.alpha = 0
Expand Down
110 changes: 110 additions & 0 deletions Mast/MastWatch Extension/AEXML/Document.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/**
* https://github.com/tadija/AEXML
* Copyright (c) Marko Tadić 2014-2019
* Licensed under the MIT license. See LICENSE file.
*/

import Foundation
#if canImport(FoundationXML)
import FoundationXML
#endif

/**
This class is inherited from `AEXMLElement` and has a few addons to represent **XML Document**.

XML Parsing is also done with this object.
*/
open class AEXMLDocument: AEXMLElement {

// MARK: - Properties

/// Root (the first child element) element of XML Document **(Empty element with error if not exists)**.
open var root: AEXMLElement {
guard let rootElement = children.first else {
let errorElement = AEXMLElement(name: "Error")
errorElement.error = AEXMLError.rootElementMissing
return errorElement
}
return rootElement
}

public let options: AEXMLOptions

// MARK: - Lifecycle

/**
Designated initializer - Creates and returns new XML Document object.

- parameter root: Root XML element for XML Document (defaults to `nil`).
- parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`).

- returns: Initialized XML Document object.
*/
public init(root: AEXMLElement? = nil, options: AEXMLOptions = AEXMLOptions()) {
self.options = options

let documentName = String(describing: AEXMLDocument.self)
super.init(name: documentName)

// document has no parent element
parent = nil

// add root element to document (if any)
if let rootElement = root {
addChild(rootElement)
}
}

/**
Convenience initializer - used for parsing XML data (by calling `loadXMLData:` internally).

- parameter xmlData: XML data to parse.
- parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`).

- returns: Initialized XML Document object containing parsed data. Throws error if data could not be parsed.
*/
public convenience init(xml: Data, options: AEXMLOptions = AEXMLOptions()) throws {
self.init(options: options)
try loadXML(xml)
}

/**
Convenience initializer - used for parsing XML string (by calling `init(xmlData:options:)` internally).

- parameter xmlString: XML string to parse.
- parameter encoding: String encoding for creating `Data` from `xmlString` (defaults to `String.Encoding.utf8`)
- parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`).

- returns: Initialized XML Document object containing parsed data. Throws error if data could not be parsed.
*/
public convenience init(xml: String,
encoding: String.Encoding = String.Encoding.utf8,
options: AEXMLOptions = AEXMLOptions()) throws {
guard let data = xml.data(using: encoding) else { throw AEXMLError.parsingFailed }
try self.init(xml: data, options: options)
}

// MARK: - Parse XML

/**
Creates instance of `AEXMLParser` (private class which is simple wrapper around `XMLParser`)
and starts parsing the given XML data. Throws error if data could not be parsed.

- parameter data: XML which should be parsed.
*/
open func loadXML(_ data: Data) throws {
children.removeAll(keepingCapacity: false)
let xmlParser = AEXMLParser(document: self, data: data)
try xmlParser.parse()
}

// MARK: - Override

/// Override of `xml` property of `AEXMLElement` - it just inserts XML Document header at the beginning.
open override var xml: String {
var xml = "\(options.documentHeader.xmlString)\n"
xml += root.xml
return xml
}

}
Loading

0 comments on commit 690845e

Please sign in to comment.