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
44 changes: 44 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: iOS starter workflow

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
name: Build and Test default scheme using any available iPhone simulator
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['schemes'][0]")
echo $default | cat >default
echo Using default scheme: $default
- name: Build
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
- name: Test
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hide_documentation_coverage: true
clean: true

module: NVActivityIndicatorView
module_version: 5.0.0
module_version: 5.2.0
build_tool_arguments:
- -scheme
- NVActivityIndicatorView-Package
Expand Down
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## [5.2.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/5.2.0)

- Add privacy manifest (#349)

## [5.1.1](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/5.1.1)

- Fix #319 (amendment)
Expand Down
4 changes: 2 additions & 2 deletions Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.1.1</string>
<string>5.2.0</string>
<key>CFBundleVersion</key>
<string>47</string>
<string>48</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
Expand Down
28 changes: 21 additions & 7 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,38 @@ class ViewController: UIViewController, NVActivityIndicatorViewable {

override func viewDidLoad() {
super.viewDidLoad()

self.view.backgroundColor = UIColor(red: CGFloat(237 / 255.0), green: CGFloat(85 / 255.0), blue: CGFloat(101 / 255.0), alpha: 1)
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let safeArea = view.safeAreaLayoutGuide.layoutFrame

let cols = 4
let rows = 8
let cellWidth = Int(self.view.frame.width / CGFloat(cols))
let cellHeight = Int(self.view.frame.height / CGFloat(rows))
var cols = 4
var rows = Int(ceil(Double(presentingIndicatorTypes.count) / 4.0))
if safeArea.width > safeArea.height {
//Landscape
cols = Int(ceil(Double(presentingIndicatorTypes.count) / 4.0))
rows = 4
}
let cellWidth = Int(safeArea.width / CGFloat(cols))
let cellHeight = Int(safeArea.height / CGFloat(rows))

self.view.subviews.forEach {
$0.removeFromSuperview()
}

for (index, indicatorType) in presentingIndicatorTypes.enumerated() {
let x = index % cols * cellWidth
let y = index / cols * cellHeight
let x = index % cols * cellWidth + Int(safeArea.origin.x)
let y = index / cols * cellHeight + Int(safeArea.origin.y)
let frame = CGRect(x: x, y: y, width: cellWidth, height: cellHeight)
let activityIndicatorView = NVActivityIndicatorView(frame: frame,
type: indicatorType)
let animationTypeLabel = UILabel(frame: frame)

animationTypeLabel.text = String(index)
animationTypeLabel.sizeToFit()
animationTypeLabel.allowsDefaultTighteningForTruncation = true
animationTypeLabel.textColor = UIColor.white
animationTypeLabel.frame.origin.x += 5
animationTypeLabel.frame.origin.y += CGFloat(cellHeight) - animationTypeLabel.frame.size.height
Expand Down
2 changes: 1 addition & 1 deletion NVActivityIndicatorView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'NVActivityIndicatorView'
s.version = '5.1.1'
s.version = '5.2.0'
s.summary = 'A collection of awesome loading animations'
s.homepage = 'https://github.com/ninjaprox/NVActivityIndicatorView'
s.screenshot = 'https://raw.githubusercontent.com/ninjaprox/NVActivityIndicatorView/master/Demo.gif'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.1.1</string>
<string>5.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>47</string>
<string>48</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.1.1</string>
<string>5.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>47</string>
<string>48</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
Loading