Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ profile
DerivedData
*.hmap
*.ipa
.swiftpm

# Bundler
.bundle
Expand Down
17 changes: 8 additions & 9 deletions CleanyModal/Classes/CleanyAlertActionTableViewCell.xib
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="actionCell" rowHeight="72" id="KGk-i7-Jjw" customClass="CleanyAlertActionTableViewCell" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="actionCell" rowHeight="72" id="KGk-i7-Jjw" customClass="CleanyAlertActionTableViewCell" customModule="CleanyModal">
<rect key="frame" x="0.0" y="0.0" width="350" height="72"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="350" height="71.5"/>
<rect key="frame" x="0.0" y="0.0" width="350" height="72"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6V8-Zi-Jsd">
<rect key="frame" x="20" y="25" width="310" height="21"/>
<rect key="frame" x="20" y="25.5" width="310" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Wcq-tL-Cxm">
<rect key="frame" x="317" y="26" width="18" height="18"/>
<rect key="frame" x="317" y="27" width="18" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="KO8-EO-7bz"/>
<constraint firstAttribute="width" constant="18" id="Wx8-yJ-GgB"/>
Expand Down
5 changes: 2 additions & 3 deletions CleanyModal/Classes/CleanyAlertViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ open class CleanyAlertViewController: CleanyModalViewController {
if let nibName = customNibName {
super.init(nibName: nibName, bundle: nil)
} else {
super.init(nibName: "CleanyAlertViewController", bundle: Bundle(for: CleanyAlertViewController.self))
super.init(nibName: "CleanyAlertViewController", bundle: .current)
}
}

Expand Down Expand Up @@ -289,9 +289,8 @@ open class CleanyAlertViewController: CleanyModalViewController {
actionsTV.dataSource = self
actionsTV.delegate = self

let bundle = Bundle(for: CleanyAlertActionTableViewCell.self)
actionsTV.register(
UINib(nibName: "CleanyAlertActionTableViewCell", bundle: bundle),
UINib(nibName: "CleanyAlertActionTableViewCell", bundle: .current),
forCellReuseIdentifier: kCellReuseIdentifier
)
}
Expand Down
18 changes: 18 additions & 0 deletions CleanyModal/Classes/Helper/Bundle+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Bundle+Extension.swift
// CleanyModal
//
// Created by Afnan Mirza on 5/14/22.
//

import Foundation

extension Bundle {
static var current: Bundle? {
#if SWIFT_PACKAGE
return .module
#else
Bundle(for: CleanyAlertViewController.self)
#endif
}
}
20 changes: 20 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swift-tools-version:5.5

import PackageDescription

let package = Package(
name: "CleanyModal",
platforms: [.iOS(.v13)],
products: [
.library(
name: "CleanyModal",
targets: ["CleanyModal"]
)
],
targets: [
.target(
name: "CleanyModal",
path: "CleanyModal"
)
]
)
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,24 @@ See example project to see all abilities to customize, enjoy !

## Installation

### Cocoapods
CleanyModal is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'CleanyModal'
```

### Swift Package Manager
CleanyModal is also available through [Swift Package Manager](https://www.swift.org/package-manager/). To install
it using SPM, simply add the following line to your `Package.swift` file:

``` swift
dependencies: [
.package(name: "CleanyModal", url: "https://github.com/loryhuz/CleanyModal.git", branch: "master"),
]
```

## Author

lory huz, lory.huz@gmail.com
Expand Down