Add SF Symbols icons

This commit is contained in:
Shadowfacts 2019-06-11 10:21:22 -07:00
parent 6ecad62b94
commit 9d4782c63c
Signed by: shadowfacts
GPG Key ID: 83FB3304046BADA4
10 changed files with 109 additions and 88 deletions

View File

@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
04496BD721625361001F1B23 /* ContentLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04496BD621625361001F1B23 /* ContentLabel.swift */; };
0450531F22B0097E00100BA2 /* Timline+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450531E22B0097E00100BA2 /* Timline+UI.swift */; };
0461A3902163CBAE00C0A807 /* Cache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0461A38F2163CBAE00C0A807 /* Cache.framework */; };
0461A3912163CBAE00C0A807 /* Cache.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0461A38F2163CBAE00C0A807 /* Cache.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
04DACE8C212CB14B009840C4 /* MainTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04DACE8B212CB14B009840C4 /* MainTabBarViewController.swift */; };
@ -235,6 +236,7 @@
/* Begin PBXFileReference section */
04496BD621625361001F1B23 /* ContentLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentLabel.swift; sourceTree = "<group>"; };
0450531E22B0097E00100BA2 /* Timline+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Timline+UI.swift"; sourceTree = "<group>"; };
0461A38F2163CBAE00C0A807 /* Cache.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Cache.framework; sourceTree = BUILT_PRODUCTS_DIR; };
04DACE8B212CB14B009840C4 /* MainTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabBarViewController.swift; sourceTree = "<group>"; };
04DACE8D212CC7CC009840C4 /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = "<group>"; };
@ -772,6 +774,7 @@
D6333B362137838300CE884A /* AttributedString+Helpers.swift */,
D6333B782139AEFD00CE884A /* Date+TimeAgo.swift */,
D67C57AE21E28EAD00C3118B /* Array+Uniques.swift */,
0450531E22B0097E00100BA2 /* Timline+UI.swift */,
);
path = Extensions;
sourceTree = "<group>";
@ -1355,6 +1358,7 @@
D6C693F92162E4DB007D6A6D /* StatusContentLabel.swift in Sources */,
D6D58DF922074B74009C8DD9 /* LinkLabel.swift in Sources */,
D6285B5121EA6E6E00FE4B39 /* AdvancedTableViewController.swift in Sources */,
0450531F22B0097E00100BA2 /* Timline+UI.swift in Sources */,
D667E5F52135BCD50057A976 /* ConversationTableViewController.swift in Sources */,
D6F953F021251A2900CF0F2B /* MastodonController.swift in Sources */,
D62D2426217ABF63005076CC /* UserActivityType.swift in Sources */,

View File

@ -0,0 +1,43 @@
// Timline+UI.swift
// Tusker
//
// Created by Shadowfacts on 6/11/19.
// Copyright © 2019 Shadowfacts. All rights reserved.
//
import UIKit
import Pachyderm
extension Timeline {
var title: String {
switch self {
case .home:
return "Home"
case let .public(local):
return local ? "Local" : "Federated"
case let .tag(hashtag):
return "#\(hashtag)"
case .list:
return "List"
case .direct:
return "Direct"
}
}
var tabBarImage: UIImage? {
switch self {
case .home:
return UIImage(systemName: "house.fill")
case let .public(local):
if local {
return UIImage(systemName: "person.and.person.fill")
} else {
return UIImage(systemName: "globe")
}
default:
return nil
}
}
}

View File

@ -81,6 +81,7 @@ class ComposeViewController: UIViewController {
super.init(nibName: "ComposeViewController", bundle: nil)
title = "Compose"
tabBarItem.image = UIImage(systemName: "pencil")
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonPressed))
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Post", style: .done, target: self, action: #selector(postButtonPressed))

View File

@ -25,7 +25,9 @@ class NotificationsTableViewController: EnhancedTableViewController {
init() {
super.init(style: .plain)
self.title = "Notifications"
title = "Notifications"
tabBarItem.image = UIImage(systemName: "bell.fill")
self.refreshControl = UIRefreshControl()
refreshControl!.addTarget(self, action: #selector(refreshNotifications(_:)), for: .valueChanged)
}

View File

@ -85,6 +85,6 @@ class OnboardingViewController: UIViewController {
extension OnboardingViewController: ASWebAuthenticationPresentationContextProviding {
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
return UIApplication.shared.delegate!.window!!
return view.window!
}
}

View File

@ -14,19 +14,22 @@ class MyProfileTableViewController: ProfileTableViewController {
super.init(accountID: nil)
title = "My Profile"
tabBarItem.image = UIImage(systemName: "person.fill")
MastodonController.getOwnAccount { (account) in
self.accountID = account.id
ImageCache.avatars.get(account.avatar, completion: { (data) in
guard let data = data else { return }
var image = UIImage(data: data)!
image = UIGraphicsImageRenderer(size: CGSize(width: 30, height: 30)).image(actions: { (_) in
image.draw(in: CGRect(x: 0, y: 0, width: 30, height: 30))
})
image = image.withRenderingMode(.alwaysOriginal)
DispatchQueue.main.async {
self.tabBarItem.image = image
let image = UIImage(data: data)!
let size = CGSize(width: 30, height: 30)
let tabBarImage = UIGraphicsImageRenderer(size: size).image { (_) in
image.draw(in: CGRect(origin: .zero, size: size))
}
let alwaysOriginalImage = tabBarImage.withRenderingMode(.alwaysOriginal)
self.tabBarItem.image = alwaysOriginalImage
}
})
}
@ -42,6 +45,10 @@ class MyProfileTableViewController: ProfileTableViewController {
super.viewDidLoad()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
@objc func preferencesPressed() {
present(PreferencesTableViewController.create(), animated: true)
}

View File

@ -42,18 +42,8 @@ class TimelineTableViewController: EnhancedTableViewController {
super.init(style: .plain)
switch timeline {
case .home:
title = "Home"
case let .public(local):
title = local ? "Local" : "Federated"
case let .tag(hashtag):
title = "#\(hashtag)"
case .list:
title = "List"
case .direct:
title = "Direct"
}
title = timeline.title
tabBarItem.image = timeline.tabBarImage
self.refreshControl = UIRefreshControl()
refreshControl!.addTarget(self, action: #selector(refreshStatuses(_:)), for: .valueChanged)

View File

@ -5,6 +5,7 @@
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14766.13"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<capability name="iOS 13.0 system colors" minToolsVersion="11.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@ -48,7 +49,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="@username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MIj-OR-NOR">
<rect key="frame" x="144" y="190" width="215" height="18"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" cocoaTouchSystemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="DfO-uD-UNI">
@ -80,13 +81,10 @@
</subviews>
</stackView>
<button opaque="NO" alpha="0.59999999999999998" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qiv-gB-kiX">
<rect key="frame" x="309" y="117" width="50" height="25"/>
<constraints>
<constraint firstAttribute="width" secondItem="qiv-gB-kiX" secondAttribute="height" multiplier="2:1" id="5iw-fx-9ax"/>
<constraint firstAttribute="height" constant="25" id="9Ch-uS-uEA"/>
</constraints>
<rect key="frame" x="340.5" y="120" width="18.5" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="tintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" image="More"/>
<state key="normal" image="ellipsis" catalog="system"/>
<connections>
<action selector="morePressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="0go-4p-qDa"/>
</connections>
@ -133,6 +131,6 @@
</view>
</objects>
<resources>
<image name="More" width="60" height="30"/>
<image name="ellipsis" catalog="system" width="64" height="20"/>
</resources>
</document>

View File

@ -18,7 +18,7 @@
<rect key="frame" x="16" y="8" width="343" height="184"/>
<subviews>
<view contentMode="scaleToFill" verticalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="Cnd-Fj-B7l">
<rect key="frame" x="0.0" y="0.0" width="343" height="156"/>
<rect key="frame" x="0.0" y="0.0" width="343" height="158"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mB9-HO-1vf">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
@ -40,7 +40,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="Content" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TgY-hs-Klo" customClass="StatusContentLabel" customModule="Tusker" customModuleProvider="target">
<rect key="frame" x="0.0" y="54" width="343" height="102"/>
<rect key="frame" x="0.0" y="54" width="343" height="104"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -72,58 +72,46 @@
</constraints>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IF9-9U-Gk0">
<rect key="frame" x="0.0" y="160" width="343" height="0.0"/>
<rect key="frame" x="0.0" y="162" width="343" height="0.0"/>
<color key="backgroundColor" cocoaTouchSystemColor="secondarySystemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" priority="999" constant="200" id="UMv-Bk-ZyY"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="3Bg-XP-d13">
<rect key="frame" x="0.0" y="164" width="343" height="20"/>
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="3Bg-XP-d13">
<rect key="frame" x="0.0" y="166" width="343" height="18"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2cc-lE-AdG">
<rect key="frame" x="0.0" y="0.0" width="27" height="20"/>
<constraints>
<constraint firstAttribute="width" secondItem="2cc-lE-AdG" secondAttribute="height" multiplier="205:151" id="1Nc-Ix-kYQ"/>
</constraints>
<state key="normal" image="Reply"/>
<rect key="frame" x="0.0" y="0.0" width="21.5" height="18"/>
<state key="normal" image="arrowshape.turn.up.left.fill" catalog="system"/>
<connections>
<action selector="replyPressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="hsh-gx-Swo"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DhN-rJ-jdA">
<rect key="frame" x="101" y="0.0" width="21" height="20"/>
<constraints>
<constraint firstAttribute="width" secondItem="DhN-rJ-jdA" secondAttribute="height" multiplier="137:131" id="POd-P3-n6S"/>
</constraints>
<state key="normal" image="Favorite"/>
<rect key="frame" x="107.5" y="0.0" width="22.5" height="18"/>
<state key="normal" image="star.fill" catalog="system"/>
<connections>
<action selector="favoritePressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="Hkh-Zo-9Qu"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GUG-f7-Hdy">
<rect key="frame" x="196" y="0.0" width="33" height="20"/>
<constraints>
<constraint firstAttribute="width" secondItem="GUG-f7-Hdy" secondAttribute="height" multiplier="927:558" id="V8H-aT-eIJ"/>
</constraints>
<state key="normal" image="Reblog"/>
<rect key="frame" x="215.5" y="0.0" width="23" height="18"/>
<state key="normal" image="repeat" catalog="system"/>
<connections>
<action selector="reblogPressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="SAf-RN-q8N"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ujo-Ap-dmK">
<rect key="frame" x="303" y="0.0" width="40" height="20"/>
<constraints>
<constraint firstAttribute="width" secondItem="Ujo-Ap-dmK" secondAttribute="height" multiplier="2:1" id="9DR-cM-JaD"/>
</constraints>
<state key="normal" image="More"/>
<rect key="frame" x="324.5" y="0.0" width="18.5" height="18"/>
<state key="normal" image="ellipsis" catalog="system"/>
<connections>
<action selector="morePressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="dWb-67-CoL"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="bqe-m8-5Lo"/>
<constraint firstAttribute="height" constant="18" id="bqe-m8-5Lo"/>
</constraints>
</stackView>
</subviews>
@ -157,9 +145,9 @@
</view>
</objects>
<resources>
<image name="Favorite" width="390" height="371"/>
<image name="More" width="60" height="30"/>
<image name="Reblog" width="679" height="406"/>
<image name="Reply" width="155" height="114"/>
<image name="arrowshape.turn.up.left.fill" catalog="system" width="64" height="52"/>
<image name="ellipsis" catalog="system" width="64" height="20"/>
<image name="repeat" catalog="system" width="64" height="50"/>
<image name="star.fill" catalog="system" width="64" height="58"/>
</resources>
</document>

View File

@ -24,7 +24,7 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" verticalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="ve3-Y1-NQH">
<rect key="frame" x="0.0" y="28.5" width="343" height="82.5"/>
<rect key="frame" x="0.0" y="28.5" width="343" height="79.5"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QMP-j2-HLn">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
@ -60,7 +60,7 @@
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Content" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HrJ-t9-KcD" customClass="StatusContentLabel" customModule="Tusker" customModuleProvider="target">
<rect key="frame" x="58" y="24.5" width="285" height="58"/>
<rect key="frame" x="58" y="24.5" width="285" height="55"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -79,58 +79,46 @@
</constraints>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nbq-yr-2mA">
<rect key="frame" x="0.0" y="115" width="343" height="0.0"/>
<rect key="frame" x="0.0" y="112" width="343" height="0.0"/>
<color key="backgroundColor" cocoaTouchSystemColor="secondarySystemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" priority="999" constant="200" id="J42-49-2MU"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="Zlb-yt-NTw">
<rect key="frame" x="0.0" y="119" width="343" height="15"/>
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="Zlb-yt-NTw">
<rect key="frame" x="0.0" y="116" width="343" height="18"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rKF-yF-KIa">
<rect key="frame" x="0.0" y="0.0" width="20.5" height="15"/>
<constraints>
<constraint firstAttribute="width" secondItem="rKF-yF-KIa" secondAttribute="height" multiplier="205:151" id="eCt-en-YfI"/>
</constraints>
<state key="normal" image="Reply"/>
<rect key="frame" x="0.0" y="0.0" width="21.5" height="18"/>
<state key="normal" image="arrowshape.turn.up.left.fill" catalog="system"/>
<connections>
<action selector="replyPressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="Ohg-uU-d3Z"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x0t-TR-jJ4">
<rect key="frame" x="104.5" y="0.0" width="15.5" height="15"/>
<constraints>
<constraint firstAttribute="width" secondItem="x0t-TR-jJ4" secondAttribute="height" multiplier="137:131" id="MRT-Ae-MgD"/>
</constraints>
<state key="normal" image="Favorite"/>
<rect key="frame" x="107.5" y="0.0" width="22.5" height="18"/>
<state key="normal" image="star.fill" catalog="system"/>
<connections>
<action selector="favoritePressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="gKJ-Hu-za3"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6tW-z8-Qh9">
<rect key="frame" x="204" y="0.0" width="25" height="15"/>
<constraints>
<constraint firstAttribute="width" secondItem="6tW-z8-Qh9" secondAttribute="height" multiplier="927:558" id="lV9-JI-Q4e"/>
</constraints>
<state key="normal" image="Reblog"/>
<rect key="frame" x="215.5" y="0.0" width="23" height="18"/>
<state key="normal" image="repeat" catalog="system"/>
<connections>
<action selector="reblogPressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="JQI-VT-wTt"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="982-J4-NGl">
<rect key="frame" x="313" y="0.0" width="30" height="15"/>
<constraints>
<constraint firstAttribute="width" secondItem="982-J4-NGl" secondAttribute="height" multiplier="2:1" id="v0d-ft-gmZ"/>
</constraints>
<state key="normal" image="More"/>
<rect key="frame" x="324.5" y="0.0" width="18.5" height="18"/>
<state key="normal" image="ellipsis" catalog="system"/>
<connections>
<action selector="morePressed:" destination="iN0-l3-epB" eventType="touchUpInside" id="dcV-Ez-EIe"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="15" id="TKC-Uc-C4K"/>
<constraint firstAttribute="height" constant="18" id="TKC-Uc-C4K"/>
</constraints>
</stackView>
</subviews>
@ -165,9 +153,9 @@
</view>
</objects>
<resources>
<image name="Favorite" width="390" height="371"/>
<image name="More" width="60" height="30"/>
<image name="Reblog" width="679" height="406"/>
<image name="Reply" width="155" height="114"/>
<image name="arrowshape.turn.up.left.fill" catalog="system" width="64" height="52"/>
<image name="ellipsis" catalog="system" width="64" height="20"/>
<image name="repeat" catalog="system" width="64" height="50"/>
<image name="star.fill" catalog="system" width="64" height="58"/>
</resources>
</document>