Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resources signing #693

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ChattoAdditions.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Pod::Spec.new do |s|
s.public_header_files = "ChattoAdditions/Source/**/*.h"
s.requires_arc = true
s.swift_version = '5.3'
s.resource_bundle = { 'ChattoAdditionsResources' => ["ChattoAdditions/Source/**/*.xib", "ChattoAdditions/Source/**/*.storyboard", "ChattoAdditions/Source/**/*.xcassets"] }
s.resources = ["ChattoAdditions/Source/**/*.xib", "ChattoAdditions/Source/**/*.storyboard", "ChattoAdditions/Source/**/*.xcassets"]
s.dependency 'Chatto', s.version.to_s
end
158 changes: 12 additions & 146 deletions ChattoAdditions/ChattoAdditions.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

26 changes: 0 additions & 26 deletions ChattoAdditions/ChattoAdditionsResources/Info.plist

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,16 @@ public extension BaseMessageCollectionViewCellDefaultStyle { // Default values

static func createDefaultBubbleBorderImages() -> BubbleBorderImages {
return BubbleBorderImages(
borderIncomingTail: UIImage(named: "bubble-incoming-border-tail", in: Bundle.resources, compatibleWith: nil)!,
borderIncomingNoTail: UIImage(named: "bubble-incoming-border", in: Bundle.resources, compatibleWith: nil)!,
borderOutgoingTail: UIImage(named: "bubble-outgoing-border-tail", in: Bundle.resources, compatibleWith: nil)!,
borderOutgoingNoTail: UIImage(named: "bubble-outgoing-border", in: Bundle.resources, compatibleWith: nil)!
borderIncomingTail: UIImage(named: "bubble-incoming-border-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
borderIncomingNoTail: UIImage(named: "bubble-incoming-border", in: Bundle(for: Class.self), compatibleWith: nil)!,
borderOutgoingTail: UIImage(named: "bubble-outgoing-border-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
borderOutgoingNoTail: UIImage(named: "bubble-outgoing-border", in: Bundle(for: Class.self), compatibleWith: nil)!
)
}

static func createDefaultFailedIconImages() -> FailedIconImages {
let normal = {
return UIImage(named: "base-message-failed-icon", in: Bundle.resources, compatibleWith: nil)!
return UIImage(named: "base-message-failed-icon", in: Bundle(for: Class.self), compatibleWith: nil)!
}
return FailedIconImages(
normal: normal(),
Expand All @@ -231,8 +231,8 @@ public extension BaseMessageCollectionViewCellDefaultStyle { // Default values
maxContainerWidthPercentageForBubbleView: 0.68)
}

private static let selectionIndicatorIconSelected = UIImage(named: "base-message-checked-icon", in: Bundle.resources, compatibleWith: nil)!.bma_tintWithColor(BaseMessageCollectionViewCellDefaultStyle.defaultOutgoingColor)
private static let selectionIndicatorIconDeselected = UIImage(named: "base-message-unchecked-icon", in: Bundle.resources, compatibleWith: nil)!.bma_tintWithColor(UIColor.bma_color(rgb: 0xC6C6C6))
private static let selectionIndicatorIconSelected = UIImage(named: "base-message-checked-icon", in: Bundle(for: Class.self), compatibleWith: nil)!.bma_tintWithColor(BaseMessageCollectionViewCellDefaultStyle.defaultOutgoingColor)
private static let selectionIndicatorIconDeselected = UIImage(named: "base-message-unchecked-icon", in: Bundle(for: Class.self), compatibleWith: nil)!.bma_tintWithColor(UIColor.bma_color(rgb: 0xC6C6C6))

static func createDefaultSelectionIndicatorStyle() -> SelectionIndicatorStyle {
return SelectionIndicatorStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extension DefaultCompoundBubbleViewStyle.BubbleMasks {
}

public static var `default`: DefaultCompoundBubbleViewStyle.BubbleMasks {
let bundle = Bundle.resources
let bundle = Bundle(for: DefaultCompoundBubbleViewStyle.self)
return DefaultCompoundBubbleViewStyle.BubbleMasks(
incomingTail: UIImage(named: "bubble-incoming-tail", in: bundle, compatibleWith: nil)!,
incomingNoTail: UIImage(named: "bubble-incoming", in: bundle, compatibleWith: nil)!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ open class PhotoMessageCollectionViewCellDefaultStyle: PhotoMessageCollectionVie
}()

lazy private var placeholderIcon: UIImage = {
return UIImage(named: "photo-bubble-placeholder-icon", in: Bundle.resources, compatibleWith: nil)!
return UIImage(named: "photo-bubble-placeholder-icon", in: Bundle(for: Class.self), compatibleWith: nil)!
}()

open func maskingImage(viewModel: PhotoMessageViewModelProtocol) -> UIImage {
Expand Down Expand Up @@ -176,10 +176,10 @@ public extension PhotoMessageCollectionViewCellDefaultStyle { // Default values

static func createDefaultBubbleMasks() -> BubbleMasks {
return BubbleMasks(
incomingTail: UIImage(named: "bubble-incoming-tail", in: Bundle.resources, compatibleWith: nil)!,
incomingNoTail: UIImage(named: "bubble-incoming", in: Bundle.resources, compatibleWith: nil)!,
outgoingTail: UIImage(named: "bubble-outgoing-tail", in: Bundle.resources, compatibleWith: nil)!,
outgoingNoTail: UIImage(named: "bubble-outgoing", in: Bundle.resources, compatibleWith: nil)!,
incomingTail: UIImage(named: "bubble-incoming-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
incomingNoTail: UIImage(named: "bubble-incoming", in: Bundle(for: Class.self), compatibleWith: nil)!,
outgoingTail: UIImage(named: "bubble-outgoing-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
outgoingNoTail: UIImage(named: "bubble-outgoing", in: Bundle(for: Class.self), compatibleWith: nil)!,
tailWidth: 6
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public extension TextMessageCollectionViewCellDefaultStyle { // Default values

static func createDefaultBubbleImages() -> BubbleImages {
return BubbleImages(
incomingTail: UIImage(named: "bubble-incoming-tail", in: Bundle.resources, compatibleWith: nil)!,
incomingNoTail: UIImage(named: "bubble-incoming", in: Bundle.resources, compatibleWith: nil)!,
outgoingTail: UIImage(named: "bubble-outgoing-tail", in: Bundle.resources, compatibleWith: nil)!,
outgoingNoTail: UIImage(named: "bubble-outgoing", in: Bundle.resources, compatibleWith: nil)!
incomingTail: UIImage(named: "bubble-incoming-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
incomingNoTail: UIImage(named: "bubble-incoming", in: Bundle(for: Class.self), compatibleWith: nil)!,
outgoingTail: UIImage(named: "bubble-outgoing-tail", in: Bundle(for: Class.self), compatibleWith: nil)!,
outgoingNoTail: UIImage(named: "bubble-outgoing", in: Bundle(for: Class.self), compatibleWith: nil)!
)
}

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion ChattoAdditions/Source/Input/ChatInputBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class ChatInputBar: ReusableXibView {
@IBOutlet var tabBarContainerHeightConstraint: NSLayoutConstraint!

class open func loadNib() -> ChatInputBar {
let view = Bundle.resources.loadNibNamed(self.nibName(), owner: nil, options: nil)!.first as! ChatInputBar
let view = Bundle(for: self).loadNibNamed(self.nibName(), owner: nil, options: nil)!.first as! ChatInputBar
view.translatesAutoresizingMaskIntoConstraints = false
view.frame = CGRect.zero
return view
Expand Down
24 changes: 11 additions & 13 deletions ChattoAdditions/Source/Input/ChatInputBar.xib
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G12a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="ChatInputBar" customModule="ChattoAdditions">
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="ChatInputBar" customModule="ChattoAdditions" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="600" height="123"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" verticalHuggingPriority="249" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="fsh-hH-hKG" userLabel="TextView" customClass="ExpandableTextView" customModule="ChattoAdditions">
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" verticalHuggingPriority="249" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="fsh-hH-hKG" userLabel="TextView" customClass="ExpandableTextView" customModule="ChattoAdditions" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hkz-tq-X6j" userLabel="Tab selector container">
<rect key="frame" x="0.0" y="79" width="600" height="44"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WNX-pj-5AB" customClass="HorizontalStackScrollView" customModule="ChattoAdditions">
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WNX-pj-5AB" customClass="HorizontalStackScrollView" customModule="ChattoAdditions" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="506" height="44"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</scrollView>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hE9-hU-Ci1">
<rect key="frame" x="506" y="0.0" width="94" height="44"/>
Expand All @@ -35,7 +33,7 @@
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="hE9-hU-Ci1" secondAttribute="trailing" id="ABn-ah-JYL"/>
<constraint firstItem="WNX-pj-5AB" firstAttribute="leading" secondItem="hkz-tq-X6j" secondAttribute="leading" id="Jk5-7M-Mh8"/>
Expand All @@ -55,13 +53,13 @@
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b1n-fp-7di" userLabel="Top border">
<rect key="frame" x="0.0" y="0.0" width="600" height="1"/>
<color key="backgroundColor" red="0.66666668653488159" green="0.66666668653488159" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="1" identifier="top-border-height" id="IIv-qg-Tlp"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="fsh-hH-hKG" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="0hb-TC-77u"/>
<constraint firstItem="hkz-tq-X6j" firstAttribute="top" secondItem="fsh-hH-hKG" secondAttribute="bottom" id="4Vl-vV-gaa"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public struct LiveCameraCellAppearance {
public static func createDefaultAppearance() -> LiveCameraCellAppearance {
return LiveCameraCellAppearance(
backgroundColor: UIColor(red: 24.0/255.0, green: 101.0/255.0, blue: 245.0/255.0, alpha: 1),
cameraImage: UIImage(named: "camera", in: Bundle.resources, compatibleWith: nil),
cameraLockImage: UIImage(named: "camera_lock", in: Bundle.resources, compatibleWith: nil)
cameraImage: UIImage(named: "camera", in: Bundle(for: LiveCameraCell.self), compatibleWith: nil),
cameraLockImage: UIImage(named: "camera_lock", in: Bundle(for: LiveCameraCell.self), compatibleWith: nil)
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions ChattoAdditions/Source/Input/Photos/PhotosChatInputItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ open class PhotosChatInputItem: ChatInputItemProtocol {

public static func createDefaultButtonAppearance() -> TabInputButtonAppearance {
let images: [UIControlStateWrapper: UIImage] = [
UIControlStateWrapper(state: .normal): UIImage(named: "camera-icon-unselected", in: Bundle.resources, compatibleWith: nil)!,
UIControlStateWrapper(state: .selected): UIImage(named: "camera-icon-selected", in: Bundle.resources, compatibleWith: nil)!,
UIControlStateWrapper(state: .highlighted): UIImage(named: "camera-icon-selected", in: Bundle.resources, compatibleWith: nil)!
UIControlStateWrapper(state: .normal): UIImage(named: "camera-icon-unselected", in: Bundle(for: Class.self), compatibleWith: nil)!,
UIControlStateWrapper(state: .selected): UIImage(named: "camera-icon-selected", in: Bundle(for: Class.self), compatibleWith: nil)!,
UIControlStateWrapper(state: .highlighted): UIImage(named: "camera-icon-selected", in: Bundle(for: Class.self), compatibleWith: nil)!
]
return TabInputButtonAppearance(images: images, size: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class PhotosInputPlaceholderCell: UICollectionViewCell {
private func commonInit() {
self.imageView = UIImageView()
self.imageView.contentMode = .center
self.imageView.image = UIImage(named: Constants.imageName, in: Bundle.resources, compatibleWith: nil)
self.imageView.image = UIImage(named: Constants.imageName, in: Bundle(for: PhotosInputPlaceholderCell.self), compatibleWith: nil)
self.contentView.addSubview(self.imageView)
self.contentView.backgroundColor = Constants.backgroundColor
self.accessibilityIdentifier = Constants.accessibilityIdentifier
Expand Down
4 changes: 2 additions & 2 deletions ChattoAdditions/Source/Input/ReusableXibView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import UIKit
@objc open class ReusableXibView: UIView {

func loadViewFromNib() -> UIView {
let bundle = Bundle.resources
let bundle = Bundle(for: type(of: self))
let nib = UINib(nibName: type(of: self).nibName(), bundle: bundle)
let view = nib.instantiate(withOwner: nil, options: nil).first as! UIView
return view
Expand All @@ -38,7 +38,7 @@ import UIKit
return self
}

let bundle = Bundle.resources
let bundle = Bundle(for: type(of: self))
if let loadedView = bundle.loadNibNamed(type(of: self).nibName(), owner: nil, options: nil)?.first as? UIView {
loadedView.frame = frame
loadedView.autoresizingMask = autoresizingMask
Expand Down
Loading