Skip to content

Commit

Permalink
Merge pull request #134 from TwidereProject/feature/multi-column
Browse files Browse the repository at this point in the history
Add multi column layout for iPad
  • Loading branch information
MainasuK authored Jun 5, 2023
2 parents 8c2169b + 3f56a9f commit b7ba491
Show file tree
Hide file tree
Showing 78 changed files with 2,481 additions and 867 deletions.
2 changes: 1 addition & 1 deletion NotificationService/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleVersion</key>
<string>129</string>
<string>135</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
2 changes: 1 addition & 1 deletion ShareExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<key>CFBundleVersion</key>
<string>129</string>
<string>135</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
6 changes: 2 additions & 4 deletions TwidereSDK/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
.package(url: "https://github.com/Flipboard/FLAnimatedImage.git", from: "1.0.0"),
.package(url: "https://github.com/MainasuK/CommonOSLog", from: "0.1.1"),
.package(url: "https://github.com/TwidereProject/MetaTextKit.git", exact: "4.5.2"),
.package(url: "https://github.com/TwidereProject/MetaTextKit.git", exact: "4.6.0"),
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.5.0"),
.package(url: "https://github.com/Alamofire/AlamofireImage.git", from: "4.1.0"),
.package(url: "https://github.com/Alamofire/AlamofireNetworkActivityIndicator.git", from: "3.1.0"),
Expand All @@ -43,15 +43,14 @@ let package = Package(
.package(url: "https://github.com/aheze/Popovers.git", from: "1.3.2"),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2"),
.package(url: "https://github.com/siteline/SwiftUI-Introspect.git", from: "0.1.4"),
.package(url: "https://github.com/TwidereProject/twitter-text.git", exact: "0.0.3"),
.package(url: "https://github.com/MainasuK/DateTools", branch: "master"),
.package(url: "https://github.com/kciter/Floaty.git", branch: "master"),
.package(url: "https://github.com/MainasuK/FPSIndicator.git", from: "1.1.0"),
.package(url: "https://github.com/uias/Tabman.git", from: "3.0.1"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.6.0"),
.package(url: "https://github.com/tid-kijyun/Kanna.git", from: "5.2.7"),
.package(url: "https://github.com/JohnSundell/CollectionConcurrencyKit.git", from: "0.2.0"),
.package(url: "https://github.com/TwidereProject/TwitterSDK.git", exact: "0.8.0"),
.package(url: "https://github.com/TwidereProject/TwitterSDK.git", exact: "0.9.1"),
.package(name: "ArkanaKeys", path: "../dependencies/ArkanaKeys"),
.package(name: "CoverFlowStackLayout", path: "../CoverFlowStackLayout"),
],
Expand Down Expand Up @@ -106,7 +105,6 @@ let package = Package(
.product(name: "AlamofireImage", package: "AlamofireImage"),
.product(name: "AlamofireNetworkActivityIndicator", package: "AlamofireNetworkActivityIndicator"),
.product(name: "MetaTextKit", package: "MetaTextKit"),
.product(name: "TwitterText", package: "twitter-text"),
.product(name: "DateToolsSwift", package: "DateTools"),
.product(name: "CryptoSwift", package: "CryptoSwift"),
.product(name: "Kanna", package: "Kanna"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>CoreDataStack 7.xcdatamodel</string>
<string>CoreDataStack 8.xcdatamodel</string>
</dict>
</plist>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -169,30 +169,4 @@ extension MastodonList: AutoUpdatableObject {
}
}
// sourcery:end

// public func update(`private`: Bool) {
// if self.`private` != `private` {
// self.`private` = `private`
// }
// }
// public func update(memberCount: Int64) {
// if self.memberCount != memberCount {
// self.memberCount = memberCount
// }
// }
// public func update(followerCount: Int64) {
// if self.followerCount != followerCount {
// self.followerCount = followerCount
// }
// }
// public func update(theDescription: String?) {
// if self.theDescription != theDescription {
// self.theDescription = theDescription
// }
// }
// public func update(createdAt: Date?) {
// if self.createdAt != createdAt {
// self.createdAt = createdAt
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,44 @@ final public class MastodonNotificationSubscription: NSManagedObject {
}

extension MastodonNotificationSubscription {
@NSManaged private var mentionPreference: Data?
@NSManaged private var primitiveMentionPreferenceTransient: MentionPreference?
// sourcery: autoUpdatableObject, autoGenerateProperty
@objc public var mentionPreference: MentionPreference {
@objc public private(set) var mentionPreferenceTransient: MentionPreference {
get {
let keyPath = #keyPath(MastodonNotificationSubscription.mentionPreference)
let keyPath = #keyPath(mentionPreferenceTransient)
willAccessValue(forKey: keyPath)
let _data = primitiveValue(forKey: keyPath) as? Data
let mentionPreference = primitiveMentionPreferenceTransient
didAccessValue(forKey: keyPath)
do {
guard let data = _data, !data.isEmpty else { return MentionPreference() }
let mentionPreference = try JSONDecoder().decode(MentionPreference.self, from: data)
if let mentionPreference = mentionPreference {
return mentionPreference
} catch {
assertionFailure(error.localizedDescription)
return MentionPreference()
} else {
do {
let _data = self.mentionPreference
guard let data = _data, !data.isEmpty else {
primitiveMentionPreferenceTransient = MentionPreference()
return MentionPreference()
}
let mentionPreference = try JSONDecoder().decode(MentionPreference.self, from: data)
primitiveMentionPreferenceTransient = mentionPreference
return mentionPreference
} catch {
assertionFailure(error.localizedDescription)
return MentionPreference()
}
}
}
set {
let keyPath = #keyPath(MastodonNotificationSubscription.mentionPreference)
let data = try? JSONEncoder().encode(newValue)
willChangeValue(forKey: keyPath)
setPrimitiveValue(data, forKey: keyPath)
didChangeValue(forKey: keyPath)
let keyPath = #keyPath(mentionPreferenceTransient)
do {
let data = try JSONEncoder().encode(newValue)
mentionPreference = data
willChangeValue(forKey: keyPath)
primitiveMentionPreferenceTransient = newValue
didChangeValue(forKey: keyPath)
} catch {
assertionFailure()
}
}
}
}
Expand Down Expand Up @@ -124,7 +140,7 @@ extension MastodonNotificationSubscription: AutoGenerateProperty {
public let poll: Bool
public let createdAt: Date
public let updatedAt: Date
public let mentionPreference: MentionPreference
public let mentionPreferenceTransient: MentionPreference

public init(
id: ID?,
Expand All @@ -140,7 +156,7 @@ extension MastodonNotificationSubscription: AutoGenerateProperty {
poll: Bool,
createdAt: Date,
updatedAt: Date,
mentionPreference: MentionPreference
mentionPreferenceTransient: MentionPreference
) {
self.id = id
self.domain = domain
Expand All @@ -155,7 +171,7 @@ extension MastodonNotificationSubscription: AutoGenerateProperty {
self.poll = poll
self.createdAt = createdAt
self.updatedAt = updatedAt
self.mentionPreference = mentionPreference
self.mentionPreferenceTransient = mentionPreferenceTransient
}
}

Expand All @@ -173,7 +189,7 @@ extension MastodonNotificationSubscription: AutoGenerateProperty {
self.poll = property.poll
self.createdAt = property.createdAt
self.updatedAt = property.updatedAt
self.mentionPreference = property.mentionPreference
self.mentionPreferenceTransient = property.mentionPreferenceTransient
}

public func update(property: Property) {
Expand All @@ -190,7 +206,7 @@ extension MastodonNotificationSubscription: AutoGenerateProperty {
update(poll: property.poll)
update(createdAt: property.createdAt)
update(updatedAt: property.updatedAt)
update(mentionPreference: property.mentionPreference)
update(mentionPreferenceTransient: property.mentionPreferenceTransient)
}

// sourcery:end
Expand Down Expand Up @@ -290,9 +306,9 @@ extension MastodonNotificationSubscription: AutoUpdatableObject {
self.updatedAt = updatedAt
}
}
public func update(mentionPreference: MentionPreference) {
if self.mentionPreference != mentionPreference {
self.mentionPreference = mentionPreference
public func update(mentionPreferenceTransient: MentionPreference) {
if self.mentionPreferenceTransient != mentionPreferenceTransient {
self.mentionPreferenceTransient = mentionPreferenceTransient
}
}

Expand Down
Loading

0 comments on commit b7ba491

Please sign in to comment.