Skip to content

Commit

Permalink
ios 13/14 fix
Browse files Browse the repository at this point in the history
pic.re api does not work :(
  • Loading branch information
cranci1 committed Apr 14, 2024
1 parent 8f464cc commit 4b3a999
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 19 deletions.
Binary file not shown.
Binary file added AnimeGen/Assets.xcassets/Icons/.DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions AnimeGen/Assets.xcassets/Icons/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
21 changes: 21 additions & 0 deletions AnimeGen/Assets.xcassets/Icons/hisoty.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "history_FILL0_wght200_GRAD200_opsz40.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Assets.xcassets/Icons/share.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ios_share_FILL0_wght200_GRAD200_opsz24.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Assets.xcassets/Icons/undo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "undo_FILL0_wght200_GRAD200_opsz48.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions AnimeGen/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="AnimeGen" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="133" y="117"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
4 changes: 2 additions & 2 deletions AnimeGen/History/HistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ struct HistoryView: View {
NavigationView {
if #available(iOS 15.0, *) {
ImageGrid(selectedImage: $selectedImage, isSaveAlertPresented: $isSaveAlertPresented)
.navigationBarTitle("History")
.navigationBarTitle("History - \(ImageHistory.images.count) images")
} else {
ImageGridiOS13(selectedImage: $selectedImage, isSaveAlertPresented: $isSaveAlertPresented)
.navigationBarTitle("History")
.navigationBarTitle("History - \(ImageHistory.images.count) images")
}
}
.navigationViewStyle(StackNavigationViewStyle())
Expand Down
2 changes: 1 addition & 1 deletion AnimeGen/Settings/SettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ struct SettingsPage: View {
struct SettingsPage_Preview: PreviewProvider {
static var previews: some View {
SettingsPage()
.preferredColorScheme(.light)
.preferredColorScheme(.dark)
}
}
38 changes: 27 additions & 11 deletions AnimeGen/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,22 @@ class ViewController: UIViewController {

// History Button
historyButton = UIButton(type: .system)
let historyIcon = UIImage(systemName: "clock.arrow.circlepath")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
historyButton.setImage(historyIcon, for: .normal)
if #available(iOS 14.0, *) {
let historyIcon = UIImage(systemName: "clock.arrow.circlepath")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
historyButton.setImage(historyIcon, for: .normal)
} else {
let customHistoryIcon = UIImage(named: "hisoty")
historyButton.setImage(customHistoryIcon, for: .normal)
}
historyButton.tintColor = .systemGray
historyButton.setTitleColor(.white, for: .normal)
historyButton.addTarget(self, action: #selector(historyButtonTapped), for: .touchUpInside)
historyButton.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(historyButton)





// Settings Button
settingsButton = UIButton(type: .system)
let settingsIcon = UIImage(systemName: "gear")?
Expand Down Expand Up @@ -155,9 +161,14 @@ class ViewController: UIViewController {

// Rewind Button
rewindButton = UIButton(type: .system)
let rewindImage = UIImage(systemName: "arrowshape.turn.up.backward.circle.fill")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 35, weight: .bold))
rewindButton.setImage(rewindImage, for: .normal)
if #available(iOS 14.0, *) {
let rewindImage = UIImage(systemName: "arrowshape.turn.up.backward.circle.fill")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 35, weight: .bold))
rewindButton.setImage(rewindImage, for: .normal)
} else {
let customRewindIcon = UIImage(named: "undo")
rewindButton.setImage(customRewindIcon, for: .normal)
}
rewindButton.tintColor = .systemGreen
rewindButton.setTitleColor(.white, for: .normal)
rewindButton.titleLabel?.font = UIFont.systemFont(ofSize: 35, weight: .bold)
Expand All @@ -168,9 +179,14 @@ class ViewController: UIViewController {

// Share Button
shareButton = UIButton(type: .system)
let shareImage = UIImage(systemName: "square.and.arrow.up.circle.fill")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 25, weight: .bold))
shareButton.setImage(shareImage, for: .normal)
if #available(iOS 15.0, *) {
let shareImage = UIImage(systemName: "square.and.arrow.up.circle.fill")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 25, weight: .bold))
shareButton.setImage(shareImage, for: .normal)
} else {
let customShareIcon = UIImage(named: "share")
shareButton.setImage(customShareIcon, for: .normal)
}
shareButton.tintColor = .systemPurple
shareButton.setTitleColor(.white, for: .normal)
shareButton.titleLabel?.font = UIFont.systemFont(ofSize: 25, weight: .bold)
Expand Down

0 comments on commit 4b3a999

Please sign in to comment.