Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
d9f987f3
Commit
d9f987f3
authored
May 31, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished small widget layout
parent
066905ce
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
17 deletions
+103
-17
1Weather.xcodeproj/project.pbxproj
+20
-0
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+2
-2
1Weather/Info.plist
+2
-0
1Weather/Resources/Fonts/SF-Pro-Display-Light.otf
+0
-0
1Weather/Resources/Fonts/SF-Pro-Display-Regular.otf
+0
-0
OneWeatherWidget/Info.plist
+6
-0
OneWeatherWidget/OneWeatherWidget.swift
+35
-15
OneWeatherWidget/WidgetFont.swift
+38
-0
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
d9f987f3
...
@@ -66,6 +66,13 @@
...
@@ -66,6 +66,13 @@
CD3F6E6925FA59D4002DB99B
/* ForecastDetailPeriodButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3F6E6825FA59D4002DB99B
/* ForecastDetailPeriodButton.swift */
;
};
CD3F6E6925FA59D4002DB99B
/* ForecastDetailPeriodButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3F6E6825FA59D4002DB99B
/* ForecastDetailPeriodButton.swift */
;
};
CD3F6E6C25FA5A90002DB99B
/* PeriodButtonProtocol.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3F6E6B25FA5A90002DB99B
/* PeriodButtonProtocol.swift */
;
};
CD3F6E6C25FA5A90002DB99B
/* PeriodButtonProtocol.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3F6E6B25FA5A90002DB99B
/* PeriodButtonProtocol.swift */
;
};
CD4742D0261200500061AC95
/* TodayAlertCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4742CF261200500061AC95
/* TodayAlertCell.swift */
;
};
CD4742D0261200500061AC95
/* TodayAlertCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4742CF261200500061AC95
/* TodayAlertCell.swift */
;
};
CD483A942664D64A00CA53AB
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD1237CB255D5C5C00C98139
/* Assets.xcassets */
;
};
CD483A952664D77700CA53AB
/* SF-Pro.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CDD0F1E42572425200CF5017
/* SF-Pro.ttf */
;
};
CD483A982664DAB100CA53AB
/* WidgetFont.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD483A972664DAB100CA53AB
/* WidgetFont.swift */
;
};
CD483A9A2664DF7300CA53AB
/* SF-Pro-Display-Light.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD483A992664DF7300CA53AB
/* SF-Pro-Display-Light.otf */
;
};
CD483A9B2664DF7300CA53AB
/* SF-Pro-Display-Light.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD483A992664DF7300CA53AB
/* SF-Pro-Display-Light.otf */
;
};
CD483A9D2664E08200CA53AB
/* SF-Pro-Display-Regular.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD483A9C2664E08200CA53AB
/* SF-Pro-Display-Regular.otf */
;
};
CD483A9E2664E08200CA53AB
/* SF-Pro-Display-Regular.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD483A9C2664E08200CA53AB
/* SF-Pro-Display-Regular.otf */
;
};
CD55E0BB2615EE2400CC4DC7
/* PollutantView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD55E0BA2615EE2400CC4DC7
/* PollutantView.swift */
;
};
CD55E0BB2615EE2400CC4DC7
/* PollutantView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD55E0BA2615EE2400CC4DC7
/* PollutantView.swift */
;
};
CD5692B42653D46200A3CDBE
/* SplashAnimationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B32653D46100A3CDBE
/* SplashAnimationViewController.swift */
;
};
CD5692B42653D46200A3CDBE
/* SplashAnimationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B32653D46100A3CDBE
/* SplashAnimationViewController.swift */
;
};
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B52653D56700A3CDBE
/* splash.json */
;
};
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B52653D56700A3CDBE
/* splash.json */
;
};
...
@@ -330,6 +337,9 @@
...
@@ -330,6 +337,9 @@
CD3F6E6825FA59D4002DB99B
/* ForecastDetailPeriodButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastDetailPeriodButton.swift
;
sourceTree
=
"<group>"
;
};
CD3F6E6825FA59D4002DB99B
/* ForecastDetailPeriodButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastDetailPeriodButton.swift
;
sourceTree
=
"<group>"
;
};
CD3F6E6B25FA5A90002DB99B
/* PeriodButtonProtocol.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PeriodButtonProtocol.swift
;
sourceTree
=
"<group>"
;
};
CD3F6E6B25FA5A90002DB99B
/* PeriodButtonProtocol.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PeriodButtonProtocol.swift
;
sourceTree
=
"<group>"
;
};
CD4742CF261200500061AC95
/* TodayAlertCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TodayAlertCell.swift
;
sourceTree
=
"<group>"
;
};
CD4742CF261200500061AC95
/* TodayAlertCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TodayAlertCell.swift
;
sourceTree
=
"<group>"
;
};
CD483A972664DAB100CA53AB
/* WidgetFont.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
WidgetFont.swift
;
sourceTree
=
"<group>"
;
};
CD483A992664DF7300CA53AB
/* SF-Pro-Display-Light.otf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"SF-Pro-Display-Light.otf"
;
sourceTree
=
"<group>"
;
};
CD483A9C2664E08200CA53AB
/* SF-Pro-Display-Regular.otf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"SF-Pro-Display-Regular.otf"
;
sourceTree
=
"<group>"
;
};
CD55E0BA2615EE2400CC4DC7
/* PollutantView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PollutantView.swift
;
sourceTree
=
"<group>"
;
};
CD55E0BA2615EE2400CC4DC7
/* PollutantView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PollutantView.swift
;
sourceTree
=
"<group>"
;
};
CD5692B32653D46100A3CDBE
/* SplashAnimationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SplashAnimationViewController.swift
;
sourceTree
=
"<group>"
;
};
CD5692B32653D46100A3CDBE
/* SplashAnimationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SplashAnimationViewController.swift
;
sourceTree
=
"<group>"
;
};
CD5692B52653D56700A3CDBE
/* splash.json */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.json
;
path
=
splash.json
;
sourceTree
=
"<group>"
;
};
CD5692B52653D56700A3CDBE
/* splash.json */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.json
;
path
=
splash.json
;
sourceTree
=
"<group>"
;
};
...
@@ -643,6 +653,7 @@
...
@@ -643,6 +653,7 @@
CD1B713F2660F95000916E71
/* OneWeatherWidget.swift */
,
CD1B713F2660F95000916E71
/* OneWeatherWidget.swift */
,
CD1B71412660F95300916E71
/* Assets.xcassets */
,
CD1B71412660F95300916E71
/* Assets.xcassets */
,
CD1B71432660F95300916E71
/* Info.plist */
,
CD1B71432660F95300916E71
/* Info.plist */
,
CD483A972664DAB100CA53AB
/* WidgetFont.swift */
,
);
);
path
=
OneWeatherWidget
;
path
=
OneWeatherWidget
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1033,6 +1044,8 @@
...
@@ -1033,6 +1044,8 @@
CDD0F1E3257240F300CF5017
/* Fonts */
=
{
CDD0F1E3257240F300CF5017
/* Fonts */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
CD483A9C2664E08200CA53AB
/* SF-Pro-Display-Regular.otf */
,
CD483A992664DF7300CA53AB
/* SF-Pro-Display-Light.otf */
,
CDD0F1E42572425200CF5017
/* SF-Pro.ttf */
,
CDD0F1E42572425200CF5017
/* SF-Pro.ttf */
,
);
);
path
=
Fonts
;
path
=
Fonts
;
...
@@ -1420,6 +1433,7 @@
...
@@ -1420,6 +1433,7 @@
isa
=
PBXResourcesBuildPhase
;
isa
=
PBXResourcesBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
CD483A9A2664DF7300CA53AB
/* SF-Pro-Display-Light.otf in Resources */
,
CDD0F1E52572425200CF5017
/* SF-Pro.ttf in Resources */
,
CDD0F1E52572425200CF5017
/* SF-Pro.ttf in Resources */
,
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
,
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
,
CDD75F0D25DE68B10099ACDB
/* Localizable.strings in Resources */
,
CDD75F0D25DE68B10099ACDB
/* Localizable.strings in Resources */
,
...
@@ -1432,6 +1446,7 @@
...
@@ -1432,6 +1446,7 @@
CE13B88E26248A77007CBD4D
/* GoogleService-Info-Production.plist in Resources */
,
CE13B88E26248A77007CBD4D
/* GoogleService-Info-Production.plist in Resources */
,
CE13B810262480B3007CBD4D
/* StoriesNativeAdCell.xib in Resources */
,
CE13B810262480B3007CBD4D
/* StoriesNativeAdCell.xib in Resources */
,
CD1237CC255D5C5C00C98139
/* Assets.xcassets in Resources */
,
CD1237CC255D5C5C00C98139
/* Assets.xcassets in Resources */
,
CD483A9D2664E08200CA53AB
/* SF-Pro-Display-Regular.otf in Resources */
,
CD822FFA25D6890900A05501
/* OneWeatherColorsAsset.xcassets in Resources */
,
CD822FFA25D6890900A05501
/* OneWeatherColorsAsset.xcassets in Resources */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -1440,6 +1455,10 @@
...
@@ -1440,6 +1455,10 @@
isa
=
PBXResourcesBuildPhase
;
isa
=
PBXResourcesBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
CD483A942664D64A00CA53AB
/* Assets.xcassets in Resources */
,
CD483A952664D77700CA53AB
/* SF-Pro.ttf in Resources */
,
CD483A9B2664DF7300CA53AB
/* SF-Pro-Display-Light.otf in Resources */
,
CD483A9E2664E08200CA53AB
/* SF-Pro-Display-Regular.otf in Resources */
,
CD1B71422660F95300916E71
/* Assets.xcassets in Resources */
,
CD1B71422660F95300916E71
/* Assets.xcassets in Resources */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -1786,6 +1805,7 @@
...
@@ -1786,6 +1805,7 @@
isa
=
PBXSourcesBuildPhase
;
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
CD483A982664DAB100CA53AB
/* WidgetFont.swift in Sources */
,
CD1B71402660F95000916E71
/* OneWeatherWidget.swift in Sources */
,
CD1B71402660F95000916E71
/* OneWeatherWidget.swift in Sources */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
d9f987f3
...
@@ -12,12 +12,12 @@
...
@@ -12,12 +12,12 @@
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
5
1
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
5
3
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
55
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
49
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
...
...
1Weather/Info.plist
View file @
d9f987f3
...
@@ -392,6 +392,8 @@
...
@@ -392,6 +392,8 @@
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
UIAppFonts
<
/k
e
y
>
<
k
e
y
>
UIAppFonts
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
<
string
>
SF-Pro-Display-Light.otf
<
/string
>
<
string
>
SF-Pro-Display-Regular.otf
<
/string
>
<
string
>
SF-Pro.ttf
<
/string
>
<
string
>
SF-Pro.ttf
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
UIApplicationSupportsIndirectInputEvents
<
/k
e
y
>
<
k
e
y
>
UIApplicationSupportsIndirectInputEvents
<
/k
e
y
>
...
...
1Weather/Resources/Fonts/SF-Pro-Display-Light.otf
0 → 100755
View file @
d9f987f3
File added
1Weather/Resources/Fonts/SF-Pro-Display-Regular.otf
0 → 100755
View file @
d9f987f3
File added
OneWeatherWidget/Info.plist
View file @
d9f987f3
...
@@ -25,5 +25,11 @@
...
@@ -25,5 +25,11 @@
<
k
e
y
>
NSExtensionPointIdentifier
<
/k
e
y
>
<
k
e
y
>
NSExtensionPointIdentifier
<
/k
e
y
>
<
string
>
com.apple.widgetkit-extension
<
/string
>
<
string
>
com.apple.widgetkit-extension
<
/string
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
UIAppFonts
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
SF-Pro-Display-Regular.otf
<
/string
>
<
string
>
SF-Pro-Display-Light.otf
<
/string
>
<
string
>
SF-Pro.ttf
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
<
/plist
>
OneWeatherWidget/OneWeatherWidget.swift
View file @
d9f987f3
...
@@ -65,30 +65,50 @@ struct WidgetEntryView: View {
...
@@ -65,30 +65,50 @@ struct WidgetEntryView: View {
var
body
:
some
View
{
var
body
:
some
View
{
GeometryReader
{
geometry
in
GeometryReader
{
geometry
in
VStack
{
VStack
{
HStack
{
HStack
(
spacing
:
4
)
{
Text
(
"New York"
)
Text
(
"New York"
)
.
font
(
.
system
(
size
:
12
))
.
multilineTextAlignment
(
.
leading
)
.
padding
(
.
init
(
top
:
12
,
leading
:
10
,
bottom
:
0
,
trailing
:
0
))
.
font
(
WidgetFont
.
SFProDisplay
.
regular
(
size
:
12
))
Image
(
"location_arrow"
)
.
resizable
()
.
frame
(
width
:
8
,
height
:
8
,
alignment
:
.
center
)
.
foregroundColor
(
.
blue
)
Spacer
()
Spacer
()
}
}
HStack
{
.
padding
(
.
top
,
12
)
VStack
(
alignment
:
.
leading
,
spacing
:
0
){
.
padding
(
.
leading
,
10
)
HStack
(
spacing
:
0
)
{
VStack
(
alignment
:
.
leading
){
Text
(
"96°"
)
Text
(
"96°"
)
.
font
(
.
system
(
size
:
32
))
.
font
(
WidgetFont
.
SFProDisplay
.
light
(
size
:
32
))
.
padding
(
.
leading
,
10
)
.
padding
(
.
leading
,
10
)
.
padding
(
.
top
,
10
)
Text
(
"Partly Cloudy Cloudy"
)
Text
(
"Partly Cloudy Cloudy"
)
.
font
(
.
system
(
size
:
12
))
.
font
(
WidgetFont
.
SFProDisplay
.
regular
(
size
:
12
))
.
padding
(
.
top
,
2
)
.
frame
(
width
:
geometry
.
size
.
width
*
0.5
,
alignment
:
.
leading
)
.
padding
(
.
leading
,
10
)
.
padding
(
.
leading
,
10
)
.
frame
(
width
:
geometry
.
size
.
width
*
0.6
,
alignment
:
.
leading
)
Spacer
(
minLength
:
0
)
Text
(
"H 97° L 89°"
)
.
font
(
.
system
(
size
:
12
))
.
padding
(
.
leading
,
10
)
.
padding
(
.
top
,
20
)
}
}
.
background
(
Color
.
yellow
)
.
frame
(
height
:
70
)
Spacer
(
minLength
:
0
)
Image
(
"freezingFog"
)
.
resizable
()
.
aspectRatio
(
contentMode
:
.
fit
)
.
frame
(
width
:
70
,
height
:
70
,
alignment
:
.
center
)
.
shadow
(
color
:
Color
.
black
.
opacity
(
0.5
),
radius
:
16
,
x
:
2
,
y
:
0
)
.
padding
(
.
trailing
,
4
)
}
}
HStack
{
Text
(
"H 97°"
)
.
font
(
WidgetFont
.
SFProDisplay
.
regular
(
size
:
12
))
Text
(
"L 89°"
)
.
font
(
WidgetFont
.
SFProDisplay
.
regular
(
size
:
12
))
Spacer
()
}
.
padding
(
.
top
,
20
)
.
padding
(
.
leading
,
10
)
}
}
}
}
}
}
...
...
OneWeatherWidget/WidgetFont.swift
0 → 100644
View file @
d9f987f3
//
// WidgetFont.swift
// OneWeatherWidgetExtension
//
// Created by Dmitry Stepanets on 31.05.2021.
//
import
SwiftUI
public
struct
WidgetFont
{
public
struct
SFPro
{
static
func
regular
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF Pro"
,
size
:
size
)
}
static
func
bold
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF Pro"
,
size
:
size
)
.
weight
(
.
bold
)
}
static
func
medium
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF Pro"
,
size
:
size
)
.
weight
(
.
medium
)
}
static
func
semibold
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF Pro"
,
size
:
size
)
.
weight
(
.
semibold
)
}
}
public
struct
SFProDisplay
{
static
func
regular
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF-Pro-Display-Regular"
,
size
:
size
)
}
static
func
light
(
size
:
CGFloat
)
->
Font
{
Font
.
custom
(
"SF-Pro-Display-Light"
,
size
:
size
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment