Skip to content

Commit

Permalink
various improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nedley committed Jul 4, 2019
1 parent 4aa9921 commit 593d3b0
Show file tree
Hide file tree
Showing 33 changed files with 169 additions and 59 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ Carthage/Build
/Cartfile.resolved
/exportOptions.plist
.DS_Store
nanopb.framework/
GoogleUtilities.framework/
GoogleMobileAds.framework/
GoogleAppMeasurement.framework/
/install
/build
/AppDB.sketch
4 changes: 0 additions & 4 deletions appdb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
816010CF1F8FEFF5003BA61E /* PortraitScreenshotSearchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 816010CE1F8FEFF5003BA61E /* PortraitScreenshotSearchCell.swift */; };
81603A6B216E63A400F18E34 /* TrendingCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81603A6A216E63A400F18E34 /* TrendingCollectionViewCell.swift */; };
81638F58229E9CE400B2F891 /* Credits.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81638F57229E9CE400B2F891 /* Credits.swift */; };
81638F5A229EA0D300B2F891 /* Credits+Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81638F59229EA0D300B2F891 /* Credits+Images.swift */; };
8167A6131DAC246000F96AC2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8167A6121DAC246000F96AC2 /* AppDelegate.swift */; };
816B343C20B727500019DE5C /* DeepDiff.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 816B343B20B727500019DE5C /* DeepDiff.framework */; };
816CEED91DBCE8A2002CFF6E /* Categories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 816CEED81DBCE8A2002CFF6E /* Categories.swift */; };
Expand Down Expand Up @@ -302,7 +301,6 @@
816010CE1F8FEFF5003BA61E /* PortraitScreenshotSearchCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortraitScreenshotSearchCell.swift; sourceTree = "<group>"; };
81603A6A216E63A400F18E34 /* TrendingCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrendingCollectionViewCell.swift; sourceTree = "<group>"; };
81638F57229E9CE400B2F891 /* Credits.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credits.swift; sourceTree = "<group>"; };
81638F59229EA0D300B2F891 /* Credits+Images.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Credits+Images.swift"; sourceTree = "<group>"; };
8167A60F1DAC246000F96AC2 /* appdb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = appdb.app; sourceTree = BUILT_PRODUCTS_DIR; };
8167A6121DAC246000F96AC2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8167A61E1DAC246000F96AC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -681,7 +679,6 @@
isa = PBXGroup;
children = (
81638F57229E9CE400B2F891 /* Credits.swift */,
81638F59229EA0D300B2F891 /* Credits+Images.swift */,
81C274D7229FFA57000D8BEB /* Credits+Views.swift */,
);
path = Credits;
Expand Down Expand Up @@ -1551,7 +1548,6 @@
81EC006C1DAD7728009EEFFA /* Global.swift in Sources */,
81F055EA2298144400E76874 /* Observation.swift in Sources */,
8155094A22748F0E00509B20 /* LibrarySectionHeaderView.swift in Sources */,
81638F5A229EA0D300B2F891 /* Credits+Images.swift in Sources */,
81876E33227B723D00E27CB8 /* MessagesFactory.swift in Sources */,
81EC00771DAD89D7009EEFFA /* Banner.swift in Sources */,
814F4FBB2196FA35005A8111 /* UpdateableApp.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions appdb/Other/Images.xcassets/Credits/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/aesign.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "aesign.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "aesign-1.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "aesign-2.jpg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/appdb.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "appdb.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "appdb-1.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "appdb-2.jpg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/github.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "github.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "github-1.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "github-2.jpg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/ned.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ned.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ned-1.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ned-2.jpg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/tnt.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "tnt.jpeg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "tnt-1.jpeg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "tnt-2.jpeg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions appdb/Other/Images.xcassets/Credits/zond.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "zond.jpeg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "zond-1.jpeg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "zond-2.jpeg",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions appdb/Startup/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@ extension String {
func toBase64() -> String {
return Data(self.utf8).base64EncodedString()
}

// Decodes image from base 64 string
func imageFromBase64() -> UIImage? {
if let url = URL(string: self), let data = try? Data(contentsOf: url), let image = UIImage(data: data) {
return image
}
return nil
}
}

// MARK: - Separators
Expand Down
4 changes: 4 additions & 0 deletions appdb/Tabs/Downloads/Downloading/AdBlocker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ let blockRules = """
"""

let ads: Set = [
"cidimesaun.pro",
"wysasys.com",
"usd.franciscus-ful.com",
"butheptesitrew.pro",
"parronnotandone.info",
"1d619628c5f.traffic-c.com",
"traffic-clicks.clickbyte-media.net",
Expand Down
1 change: 1 addition & 0 deletions appdb/Tabs/Downloads/Library/Library+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ extension Library {
if let error = error {
Messages.shared.showError(message: error.prettified)
} else {
guard self.myAppstoreIpas.indices.contains(indexPath.row) else { return }
self.myAppstoreIpas.remove(at: indexPath.row)
self.collectionView.deleteItems(at: [indexPath])
if self.myAppstoreIpas.isEmpty {
Expand Down
34 changes: 0 additions & 34 deletions appdb/Tabs/Settings/Credits/Credits+Images.swift

This file was deleted.

8 changes: 4 additions & 4 deletions appdb/Tabs/Settings/Credits/Credits+Views.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ final class CreditsStaticCell: SimpleStaticCell {

accessoryType = row.accessory.type

if let base64ImageString = row.context?["base64Image"] as? String {
icon.image = base64ImageString.imageFromBase64()
if let imageName = row.context?["imageName"] as? String {
icon.image = UIImage(named: imageName)
}

primaryLabel.text = row.text
Expand Down Expand Up @@ -136,13 +136,13 @@ class CreditsIconView: UIView {
return button
}()*/

init(text: String, base64Image: String, easterDelegate: Easter) {
init(text: String, imageName: String, easterDelegate: Easter) {
super.init(frame: .zero)

self.easterDelegate = easterDelegate

icon.isUserInteractionEnabled = true
icon.image = base64Image.imageFromBase64()
icon.image = UIImage(named: imageName)
label.text = text

let gesture = UITapGestureRecognizer(target: self, action: #selector(animate))
Expand Down
18 changes: 9 additions & 9 deletions appdb/Tabs/Settings/Credits/Credits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ class Credits: TableViewController {
struct Credit {
var name: String
var detail: String?
var base64Image: String
var imageName: String
var type: CreditType
var handle: Handle
}

lazy var credits: [Credit] = [
Credit(name: "ned", detail: nil, base64Image: nedImage, type: .developer, handle: .telegram(username: Global.telegramUsername)),
Credit(name: "View project on GitHub".localized(), detail: nil, base64Image: githubImage, type: .developer, handle: .website(site: Global.githubSite)),
Credit(name: "ned", detail: nil, imageName: "ned", type: .developer, handle: .telegram(username: Global.telegramUsername)),
Credit(name: "View project on GitHub".localized(), detail: nil, imageName: "github", type: .developer, handle: .website(site: Global.githubSite)),

Credit(name: "appdb team", detail: nil, base64Image: appdbImage, type: .specialThanks, handle: .website(site: Global.mainSite)),
Credit(name: "Alessandro Chiarlitti (aesign)", detail: "Icon and banner designer".localized(), base64Image: aesignImage, type: .specialThanks, handle: .website(site: "https://aesign.me")),
Credit(name: "appdb team", detail: nil, imageName: "appdb", type: .specialThanks, handle: .website(site: Global.mainSite)),
Credit(name: "Alessandro Chiarlitti (aesign)", detail: "Icon and banner designer".localized(), imageName: "aesign", type: .specialThanks, handle: .website(site: "https://aesign.me")),

Credit(name: "TNT 🇪🇸", detail: nil, base64Image: tntImage, type: .translations, handle: .twitter(username: "tnttaolin2")),
Credit(name: "Zond80 🇷🇺", detail: nil, base64Image: zondImage, type: .translations, handle: .website(site: "https://github.com/Zond80"))
Credit(name: "TNT 🇪🇸", detail: nil, imageName: "tnt", type: .translations, handle: .twitter(username: "tnttaolin2")),
Credit(name: "Zond80 🇷🇺", detail: nil, imageName: "zond", type: .translations, handle: .website(site: "https://github.com/Zond80"))
]

convenience init() {
Expand Down Expand Up @@ -72,15 +72,15 @@ class Credits: TableViewController {

var sections = [Static.Section]()

sections.append(Section(header: .autoLayoutView(CreditsIconView(text: "appdb v\(Global.appVersion)", base64Image: appdbImage, easterDelegate: self))))
sections.append(Section(header: .autoLayoutView(CreditsIconView(text: "appdb v\(Global.appVersion)", imageName: "appdb", easterDelegate: self))))

for creditType in CreditType.allCases {
var section: Static.Section = Section(header: .title(creditType.rawValue.localized()), rows: [])
for credit in credits where credit.type == creditType {
section.rows.append(
Row(text: credit.name.localized(), detailText: credit.detail, selection: { [unowned self] _ in
self.handleTap(for: credit.handle)
}, accessory: .disclosureIndicator, cellClass: CreditsStaticCell.self, context: ["base64Image": credit.base64Image])
}, accessory: .disclosureIndicator, cellClass: CreditsStaticCell.self, context: ["imageName": credit.imageName])
)
}
if !section.rows.isEmpty { sections.append(section) }
Expand Down

0 comments on commit 593d3b0

Please sign in to comment.